FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
igmp_binding_cmds.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __VOM_IGMP_BINDING_CMDS_H__
17 #define __VOM_IGMP_BINDING_CMDS_H__
18 
19 #include "vom/igmp_binding.hpp"
20 #include "vom/rpc_cmd.hpp"
21 
22 #include <vapi/igmp.api.vapi.hpp>
23 
24 namespace VOM {
25 namespace igmp_binding_cmds {
26 /**
27  * A command class that binds the IGMP config to the interface
28  */
29 class bind_cmd : public rpc_cmd<HW::item<bool>, vapi::Igmp_enable_disable>
30 {
31 public:
32  /**
33  * Constructor
34  */
35  bind_cmd(HW::item<bool>& item, const handle_t& itf);
36 
37  /**
38  * Issue the command to VPP/HW
39  */
41  /**
42  * convert to string format for debug purposes
43  */
44  std::string to_string() const;
45 
46  /**
47  * Comparison operator - only used for UT
48  */
49  bool operator==(const bind_cmd& i) const;
50 
51 private:
52  /**
53  * Reference to the HW::item of the interface to bind
54  */
55  const handle_t& m_itf;
56 };
57 
58 /**
59  * A cmd class that Unbinds IGMP Config from an interface
60  */
61 class unbind_cmd : public rpc_cmd<HW::item<bool>, vapi::Igmp_enable_disable>
62 {
63 public:
64  /**
65  * Constructor
66  */
67  unbind_cmd(HW::item<bool>& item, const handle_t& itf);
68 
69  /**
70  * Issue the command to VPP/HW
71  */
73  /**
74  * convert to string format for debug purposes
75  */
76  std::string to_string() const;
77 
78  /**
79  * Comparison operator - only used for UT
80  */
81  bool operator==(const unbind_cmd& i) const;
82 
83 private:
84  /**
85  * Reference to the HW::item of the interface to unbind
86  */
87  const handle_t& m_itf;
88 };
89 
90 }; // namespace cmds
91 }; // namespace VOM
92 
93 /*
94  * fd.io coding-style-patch-verification: OFF
95  *
96  * Local Variables:
97  * eval: (c-set-style "mozilla")
98  * End:
99  */
100 
101 #endif
VOM::HW::item< bool >
VOM::igmp_binding_cmds::bind_cmd::bind_cmd
bind_cmd(HW::item< bool > &item, const handle_t &itf)
Constructor.
Definition: igmp_binding_cmds.cpp:21
VOM::igmp_binding_cmds::unbind_cmd::issue
rc_t issue(connection &con)
Issue the command to VPP/HW.
Definition: igmp_binding_cmds.cpp:70
VOM::igmp_binding_cmds::bind_cmd::operator==
bool operator==(const bind_cmd &i) const
Comparison operator - only used for UT.
Definition: igmp_binding_cmds.cpp:28
VOM
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
VOM::igmp_binding_cmds::unbind_cmd
A cmd class that Unbinds IGMP Config from an interface.
Definition: igmp_binding_cmds.hpp:61
VOM::rpc_cmd
A base class for all RPC commands to VPP.
Definition: rpc_cmd.hpp:40
con
Connection con
Definition: vapi_cpp_test.cpp:56
VOM::connection
A representation of the connection to VPP.
Definition: connection.hpp:33
VOM::igmp_binding_cmds::bind_cmd
A command class that binds the IGMP config to the interface.
Definition: igmp_binding_cmds.hpp:29
VOM::handle_t
A type declaration of an interface handle in VPP.
Definition: types.hpp:233
VOM::igmp_binding_cmds::unbind_cmd::to_string
std::string to_string() const
convert to string format for debug purposes
Definition: igmp_binding_cmds.cpp:88
VOM::rpc_cmd< HW::item< bool >, vapi::Igmp_enable_disable >::item
HW::item< bool > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:66
VOM::igmp_binding_cmds::unbind_cmd::unbind_cmd
unbind_cmd(HW::item< bool > &item, const handle_t &itf)
Constructor.
Definition: igmp_binding_cmds.cpp:57
VOM::igmp_binding_cmds::bind_cmd::to_string
std::string to_string() const
convert to string format for debug purposes
Definition: igmp_binding_cmds.cpp:49
igmp_binding.hpp
i
int i
Definition: flowhash_template.h:376
VOM::igmp_binding_cmds::bind_cmd::issue
rc_t issue(connection &con)
Issue the command to VPP/HW.
Definition: igmp_binding_cmds.cpp:34
VOM::rc_t
Error codes that VPP will return during a HW write.
Definition: types.hpp:89
rpc_cmd.hpp
VOM::igmp_binding_cmds::unbind_cmd::operator==
bool operator==(const unbind_cmd &i) const
Comparison operator - only used for UT.
Definition: igmp_binding_cmds.cpp:64
string
const char *const string
Definition: cJSON.h:172