Android-cuttlefish cvd tool
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cuttlefish::FakeNftables Class Reference

#include <fake_nftables.h>

Inheritance diagram for cuttlefish::FakeNftables:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::FakeNftables:
Collaboration graph
[legend]

Classes

struct  Rule
 
struct  Table
 

Public Member Functions

Result< void > EnsureTable (std::string_view family, std::string_view table) override
 
Result< void > DeleteTable (std::string_view family, std::string_view table) override
 
Result< void > EnsureChain (std::string_view family, std::string_view table, std::string_view chain, std::string_view content) override
 
Result< uint64_t > AddRule (std::string_view family, std::string_view table, std::string_view chain, std::string_view content, std::string_view comment) override
 
Result< void > DeleteRule (std::string_view family, std::string_view table, std::string_view chain, uint64_t handle) override
 
Result< void > DeleteRulesByComment (std::string_view family, std::string_view table, std::string_view chain, std::string_view comment) override
 
bool HasTable (std::string_view family, std::string_view table) const
 
bool HasChain (std::string_view family, std::string_view table, std::string_view chain) const
 
bool HasRuleWithComment (std::string_view family, std::string_view table, std::string_view chain, std::string_view comment) const
 
int RuleCount (std::string_view family, std::string_view table, std::string_view chain) const
 
- Public Member Functions inherited from cuttlefish::Nftables
virtual ~Nftables ()=default
 
virtual Result< void > EnsureTable (std::string_view family, std::string_view table)=0
 
virtual Result< void > DeleteTable (std::string_view family, std::string_view table)=0
 
virtual Result< void > EnsureChain (std::string_view family, std::string_view table, std::string_view chain, std::string_view content)=0
 
virtual Result< uint64_t > AddRule (std::string_view family, std::string_view table, std::string_view chain, std::string_view content, std::string_view comment)=0
 
virtual Result< void > DeleteRule (std::string_view family, std::string_view table, std::string_view chain, uint64_t handle)=0
 
virtual Result< void > DeleteRulesByComment (std::string_view family, std::string_view table, std::string_view chain, std::string_view comment)=0
 

Private Types

using TableKey = std::pair< std::string, std::string >
 

Private Member Functions

const TableFindTable (std::string_view family, std::string_view table) const
 
TableFindTable (std::string_view family, std::string_view table)
 

Private Attributes

std::map< TableKey, Tabletables_
 

Member Typedef Documentation

◆ TableKey

using cuttlefish::FakeNftables::TableKey = std::pair<std::string, std::string>
private

Member Function Documentation

◆ AddRule()

Result< uint64_t > cuttlefish::FakeNftables::AddRule ( std::string_view  family,
std::string_view  table,
std::string_view  chain,
std::string_view  content,
std::string_view  comment 
)
overridevirtual

Implements cuttlefish::Nftables.

◆ DeleteRule()

Result< void > cuttlefish::FakeNftables::DeleteRule ( std::string_view  family,
std::string_view  table,
std::string_view  chain,
uint64_t  handle 
)
overridevirtual

Implements cuttlefish::Nftables.

◆ DeleteRulesByComment()

Result< void > cuttlefish::FakeNftables::DeleteRulesByComment ( std::string_view  family,
std::string_view  table,
std::string_view  chain,
std::string_view  comment 
)
overridevirtual

Implements cuttlefish::Nftables.

◆ DeleteTable()

Result< void > cuttlefish::FakeNftables::DeleteTable ( std::string_view  family,
std::string_view  table 
)
overridevirtual

Implements cuttlefish::Nftables.

◆ EnsureChain()

Result< void > cuttlefish::FakeNftables::EnsureChain ( std::string_view  family,
std::string_view  table,
std::string_view  chain,
std::string_view  content 
)
overridevirtual

Implements cuttlefish::Nftables.

◆ EnsureTable()

Result< void > cuttlefish::FakeNftables::EnsureTable ( std::string_view  family,
std::string_view  table 
)
overridevirtual

Implements cuttlefish::Nftables.

◆ FindTable() [1/2]

FakeNftables::Table * cuttlefish::FakeNftables::FindTable ( std::string_view  family,
std::string_view  table 
)
private

◆ FindTable() [2/2]

const FakeNftables::Table * cuttlefish::FakeNftables::FindTable ( std::string_view  family,
std::string_view  table 
) const
private

◆ HasChain()

bool cuttlefish::FakeNftables::HasChain ( std::string_view  family,
std::string_view  table,
std::string_view  chain 
) const

◆ HasRuleWithComment()

bool cuttlefish::FakeNftables::HasRuleWithComment ( std::string_view  family,
std::string_view  table,
std::string_view  chain,
std::string_view  comment 
) const

◆ HasTable()

bool cuttlefish::FakeNftables::HasTable ( std::string_view  family,
std::string_view  table 
) const

◆ RuleCount()

int cuttlefish::FakeNftables::RuleCount ( std::string_view  family,
std::string_view  table,
std::string_view  chain 
) const

Member Data Documentation

◆ tables_

std::map<TableKey, Table> cuttlefish::FakeNftables::tables_
private

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