mavtables  0.2.1
MAVLink router and firewall.
common_Rule.hpp
Go to the documentation of this file.
1 // MAVLink router and firewall.
2 // Copyright (C) 2018 Michael R. Shannon <mrshannon.aerospace@gmail.com>
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 
18 #include "Action.hpp"
19 #include "Chain.hpp"
20 #include "MAVAddress.hpp"
21 #include "Packet.hpp"
22 
23 
24 namespace
25 {
26 
27 #ifdef __clang__
28  #pragma clang diagnostic push
29  #pragma clang diagnostic ignored "-Wweak-vtables"
30 #endif
31  class TestChain : public Chain
32  {
33  public:
34  TestChain()
35  : Chain("test_chain")
36  {
37  }
38  // LCOV_EXCL_START
39  ~TestChain() = default;
40  // LCOV_EXCL_STOP
41  virtual Action action(
42  const Packet &packet, const MAVAddress &address)
43  {
44  (void)packet;
45  (void)address;
46  return Action::make_accept();
47  }
48  };
49 #ifdef __clang__
50  #pragma clang diagnostic pop
51 #endif
52 
53 }
static Action make_accept(std::optional< int > priority={})
Definition: Action.cpp:100
TEST_VIRTUAL Action action(const Packet &packet, const MAVAddress &address)
Definition: Chain.cpp:90
Definition: Chain.hpp:37