mavtables
0.2.1
MAVLink router and firewall.
|
#include <Filter.hpp>
Public Member Functions | |
Filter (const Filter &other)=default | |
Filter (Filter &&other)=default | |
Filter (Chain default_chain, bool accept_by_default=false) | |
TEST_VIRTUAL | ~Filter ()=default |
TEST_VIRTUAL std::pair< bool, int > | will_accept (const Packet &packet, const MAVAddress &address) |
Filter & | operator= (const Filter &other)=default |
Filter & | operator= (Filter &&other)=default |
Friends | |
bool | operator== (const Filter &lhs, const Filter &rhs) |
bool | operator!= (const Filter &lhs, const Filter &rhs) |
The filter used to determine whether to accept or reject a packet.
Definition at line 38 of file Filter.hpp.
|
default |
Copy constructor.
other | Filter to copy from. |
Filter::Filter | ( | Chain | default_chain, |
bool | accept_by_default = false |
||
) |
Construct a new packet filter.
default_chain | The Chain that all filtering begins with. |
accept_by_default | Whether to accept (true) or reject (false) packets that don't match any rules in the default chain or any chains called by the default chain. The default value is false and thus to reject unmatched packets. |
Definition at line 36 of file Filter.cpp.
|
default |
Assignment operator.
other | Filter to copy from. |
Assignment operator (by move semantics).
other | Filter to move from. |
std::pair< bool, int > Filter::will_accept | ( | const Packet & | packet, |
const MAVAddress & | address | ||
) |
Determine whether to accept or reject a packet/address combination.
packet | The packet to determine whether to allow or not. |
address | The address the packet will be sent out on if the action allows it. |
Definition at line 53 of file Filter.cpp.
References Action::ACCEPT, Chain::action(), Action::action(), Action::CONTINUE, Action::DEFAULT, Action::priority(), and Action::REJECT.
Inequality comparison.
The default chain and default action are compared.
lhs | The left hand side packet filter. |
rhs | The right hand side packet filter. |
true | if lhs is not the same as rhs. |
false | if lhs is the same as rhs. |
Definition at line 102 of file Filter.cpp.
Equality comparison.
The default chain and default action are compared.
lhs | The left hand side packet filter. |
rhs | The right hand side packet filter. |
true | if lhs is the same as rhs. |
false | if lhs is not the same as rhs. |
Definition at line 85 of file Filter.cpp.