xorp

FirewallSetNetfilter Class Reference

Inheritance diagram for FirewallSetNetfilter:
FirewallSet

List of all members.

Public Types

typedef map< uint32_t,
FirewallEntry
FirewallTrie

Public Member Functions

 FirewallSetNetfilter (FeaDataPlaneManager &fea_data_plane_manager)
 Constructor.
virtual ~FirewallSetNetfilter ()
 Virtual destructor.
virtual int start (string &error_msg)
 Start operation.
virtual int stop (string &error_msg)
 Stop operation.
virtual int update_entries (const list< FirewallEntry > &added_entries, const list< FirewallEntry > &replaced_entries, const list< FirewallEntry > &deleted_entries, string &error_msg)
 Update the firewall entries by pushing them into the underlying system.
virtual int set_table4 (const list< FirewallEntry > &firewall_entry_list, string &error_msg)
 Set the IPv4 firewall table.
virtual int delete_all_entries4 (string &error_msg)
 Delete all entries in the IPv4 firewall table.
virtual int set_table6 (const list< FirewallEntry > &firewall_entry_list, string &error_msg)
 Set the IPv6 firewall table.
virtual int delete_all_entries6 (string &error_msg)
 Delete all entries in the IPv6 firewall table.

Private Member Functions

virtual int add_entry (const FirewallEntry &firewall_entry, string &error_msg)
 Add a single firewall entry.
virtual int replace_entry (const FirewallEntry &firewall_entry, string &error_msg)
 Replace a single firewall entry.
virtual int delete_entry (const FirewallEntry &firewall_entry, string &error_msg)
 Delete a single firewall entry.
int encode_chain4 (const string &chain_name, vector< uint8_t > &buffer, size_t &next_data_index, string &error_msg)
 Encode a single IPv4 firewall chain.
int encode_chain6 (const string &chain_name, vector< uint8_t > &buffer, size_t &next_data_index, string &error_msg)
 Encode a single IPv6 firewall chain.
int encode_entry4 (const FirewallEntry &firewall_entry, vector< uint8_t > &buffer, size_t &next_data_index, string &error_msg)
 Encode a single IPv4 firewall entry.
int encode_entry6 (const FirewallEntry &firewall_entry, vector< uint8_t > &buffer, size_t &next_data_index, string &error_msg)
 Encode a single IPv6 firewall entry.
int push_entries4 (string &error_msg)
 Push all locally stored IPv4 firewall entries.
int push_entries6 (string &error_msg)
 Push all locally stored IPv6 firewall entries.

Private Attributes

int _s4
int _s6
FirewallTrie _firewall_entries4
FirewallTrie _firewall_entries6
size_t _num_entries
size_t _head_offset
size_t _foot_offset

Static Private Attributes

static const string _netfilter_table_name
static const string _netfilter_match_tcp
static const string _netfilter_match_udp
static const string _netfilter_chain_input
static const string _netfilter_chain_forward
static const string _netfilter_chain_output

Constructor & Destructor Documentation

FirewallSetNetfilter::FirewallSetNetfilter ( FeaDataPlaneManager fea_data_plane_manager)

Constructor.

Parameters:
fea_data_plane_managerthe corresponding data plane manager (FeaDataPlaneManager).

Member Function Documentation

virtual int FirewallSetNetfilter::add_entry ( const FirewallEntry firewall_entry,
string &  error_msg 
) [private, virtual]

Add a single firewall entry.

Parameters:
firewall_entrythe entry to add.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
virtual int FirewallSetNetfilter::delete_all_entries4 ( string &  error_msg) [virtual]

Delete all entries in the IPv4 firewall table.

Parameters:
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.

virtual int FirewallSetNetfilter::delete_all_entries6 ( string &  error_msg) [virtual]

Delete all entries in the IPv6 firewall table.

Parameters:
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.

virtual int FirewallSetNetfilter::delete_entry ( const FirewallEntry firewall_entry,
string &  error_msg 
) [private, virtual]

Delete a single firewall entry.

Parameters:
firewall_entrythe entry to delete.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int FirewallSetNetfilter::encode_chain4 ( const string &  chain_name,
vector< uint8_t > &  buffer,
size_t &  next_data_index,
string &  error_msg 
) [private]

Encode a single IPv4 firewall chain.

Parameters:
chain_namethe name of the chain to encode.
bufferthe buffer to store the encoded chain.
next_data_indexthe return-by-reference index into the buffer with the location to store the encoded chain.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int FirewallSetNetfilter::encode_chain6 ( const string &  chain_name,
vector< uint8_t > &  buffer,
size_t &  next_data_index,
string &  error_msg 
) [private]

Encode a single IPv6 firewall chain.

Parameters:
chain_namethe name of the chain to encode.
bufferthe buffer to store the encoded chain.
next_data_indexthe return-by-reference index into the buffer with the location to store the encoded chain.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int FirewallSetNetfilter::encode_entry4 ( const FirewallEntry firewall_entry,
vector< uint8_t > &  buffer,
size_t &  next_data_index,
string &  error_msg 
) [private]

Encode a single IPv4 firewall entry.

Parameters:
firewall_entrythe entry to encode.
bufferthe buffer to store the encoded entry.
next_data_indexthe return-by-reference index into the buffer to store the encoded entry.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int FirewallSetNetfilter::encode_entry6 ( const FirewallEntry firewall_entry,
vector< uint8_t > &  buffer,
size_t &  next_data_index,
string &  error_msg 
) [private]

Encode a single IPv6 firewall entry.

Parameters:
firewall_entrythe entry to encode.
bufferthe buffer to store the encoded entry.
next_data_indexthe return-by-reference index into the buffer to store the encoded entry.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int FirewallSetNetfilter::push_entries4 ( string &  error_msg) [private]

Push all locally stored IPv4 firewall entries.

Parameters:
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int FirewallSetNetfilter::push_entries6 ( string &  error_msg) [private]

Push all locally stored IPv6 firewall entries.

Parameters:
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
virtual int FirewallSetNetfilter::replace_entry ( const FirewallEntry firewall_entry,
string &  error_msg 
) [private, virtual]

Replace a single firewall entry.

Parameters:
firewall_entrythe replacement entry.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.
virtual int FirewallSetNetfilter::set_table4 ( const list< FirewallEntry > &  firewall_entry_list,
string &  error_msg 
) [virtual]

Set the IPv4 firewall table.

Parameters:
firewall_entry_listthe list with all entries to install into the IPv4 firewall table.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.

virtual int FirewallSetNetfilter::set_table6 ( const list< FirewallEntry > &  firewall_entry_list,
string &  error_msg 
) [virtual]

Set the IPv6 firewall table.

Parameters:
firewall_entry_listthe list with all entries to install into the IPv6 firewall table.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.

virtual int FirewallSetNetfilter::start ( string &  error_msg) [virtual]

Start operation.

Parameters:
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.

virtual int FirewallSetNetfilter::stop ( string &  error_msg) [virtual]

Stop operation.

Parameters:
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.

virtual int FirewallSetNetfilter::update_entries ( const list< FirewallEntry > &  added_entries,
const list< FirewallEntry > &  replaced_entries,
const list< FirewallEntry > &  deleted_entries,
string &  error_msg 
) [virtual]

Update the firewall entries by pushing them into the underlying system.

Parameters:
added_entriesthe entries to add.
replaced_entriesthe entries to replace.
deleted_entriesthe deleted entries.
error_msgthe error message (if error).
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements FirewallSet.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations