FD.io VPP  v21.01
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  */
40  rc_t issue(connection& con);
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  */
72  rc_t issue(connection& con);
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
const char *const string
Definition: cJSON.h:172
rc_t issue(connection &con)
Issue the command to VPP/HW.
Error codes that VPP will return during a HW write.
Definition: types.hpp:89
A command class that binds the IGMP config to the interface.
bind_cmd(HW::item< bool > &item, const handle_t &itf)
Constructor.
bool operator==(const bind_cmd &i) const
Comparison operator - only used for UT.
A representation of the connection to VPP.
Definition: connection.hpp:33
A base class for all RPC commands to VPP.
Definition: rpc_cmd.hpp:40
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:317
A type declaration of an interface handle in VPP.
Definition: types.hpp:233
A cmd class that Unbinds IGMP Config from an interface.
std::string to_string() const
convert to string format for debug purposes
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
HW::item< bool > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:66