FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
qos_record_cmds.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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_QOS_RECORD_CMDS_H__
17 #define __VOM_QOS_RECORD_CMDS_H__
18 
19 #include "vom/dump_cmd.hpp"
20 #include "vom/qos_record.hpp"
21 
22 #include <vapi/qos.api.vapi.hpp>
23 
24 namespace VOM {
25 namespace QoS {
26 namespace record_cmds {
27 
28 /**
29  * A command class that creates or updates the GBP endpoint
30  */
32  : public rpc_cmd<HW::item<bool>, vapi::Qos_record_enable_disable>
33 {
34 public:
35  /**
36  * Constructor
37  */
38  create_cmd(HW::item<bool>& item, const handle_t& itf, const source_t& src);
39 
40  /**
41  * Issue the command to VPP/HW
42  */
44 
45  /**
46  * convert to string format for debug purposes
47  */
48  std::string to_string() const;
49 
50  /**
51  * Comparison operator - only used for UT
52  */
53  bool operator==(const create_cmd& i) const;
54 
55 private:
56  const handle_t m_itf;
57  const source_t& m_src;
58 };
59 
60 /**
61  * A cmd class that deletes a GBP endpoint
62  */
64  : public rpc_cmd<HW::item<bool>, vapi::Qos_record_enable_disable>
65 {
66 public:
67  /**
68  * Constructor
69  */
70  delete_cmd(HW::item<bool>& item, const handle_t& itf, const source_t& src);
71 
72  /**
73  * Issue the command to VPP/HW
74  */
76 
77  /**
78  * convert to string format for debug purposes
79  */
80  std::string to_string() const;
81 
82  /**
83  * Comparison operator - only used for UT
84  */
85  bool operator==(const delete_cmd& i) const;
86 
87 private:
88  const handle_t m_itf;
89  const source_t& m_src;
90 };
91 
92 /**
93  * A cmd class that Dumps all the GBP endpoints
94  */
95 class dump_cmd : public VOM::dump_cmd<vapi::Qos_record_dump>
96 {
97 public:
98  /**
99  * Constructor
100  */
101  dump_cmd();
102  dump_cmd(const dump_cmd& d);
103 
104  /**
105  * Issue the command to VPP/HW
106  */
108  /**
109  * convert to string format for debug purposes
110  */
111  std::string to_string() const;
112 
113  /**
114  * Comparison operator - only used for UT
115  */
116  bool operator==(const dump_cmd& i) const;
117 
118 private:
119  /**
120  * HW reutrn code
121  */
122  HW::item<bool> item;
123 };
124 }; // namespace record_cmds
125 }; // namespace Qos
126 }; // namespace VOM
127 
128 /*
129  * fd.io coding-style-patch-verification: OFF
130  *
131  * Local Variables:
132  * eval: (c-set-style "mozilla")
133  * End:
134  */
135 
136 #endif
VOM::HW::item< bool >
VOM::QoS::record_cmds::delete_cmd::operator==
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
Definition: qos_record_cmds.cpp:72
qos_record.hpp
VOM
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
VOM::QoS::record_cmds::delete_cmd::issue
rc_t issue(connection &con)
Issue the command to VPP/HW.
Definition: qos_record_cmds.cpp:79
VOM::QoS::record_cmds::dump_cmd
A cmd class that Dumps all the GBP endpoints.
Definition: qos_record_cmds.hpp:95
VOM::rpc_cmd
A base class for all RPC commands to VPP.
Definition: rpc_cmd.hpp:40
VOM::QoS::record_cmds::delete_cmd
A cmd class that deletes a GBP endpoint.
Definition: qos_record_cmds.hpp:63
con
Connection con
Definition: vapi_cpp_test.cpp:56
VOM::QoS::record_cmds::dump_cmd::operator==
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
Definition: qos_record_cmds.cpp:106
VOM::QoS::record_cmds::dump_cmd::to_string
std::string to_string() const
convert to string format for debug purposes
Definition: qos_record_cmds.cpp:124
VOM::QoS::record_cmds::create_cmd::to_string
std::string to_string() const
convert to string format for debug purposes
Definition: qos_record_cmds.cpp:53
VOM::connection
A representation of the connection to VPP.
Definition: connection.hpp:33
VOM::QoS::record_cmds::delete_cmd::delete_cmd
delete_cmd(HW::item< bool > &item, const handle_t &itf, const source_t &src)
Constructor.
Definition: qos_record_cmds.cpp:62
VOM::QoS::record_cmds::create_cmd
A command class that creates or updates the GBP endpoint.
Definition: qos_record_cmds.hpp:31
i
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
VOM::handle_t
A type declaration of an interface handle in VPP.
Definition: types.hpp:233
src
vl_api_address_t src
Definition: gre.api:54
dump_cmd.hpp
VOM::rpc_cmd< HW::item< bool >, vapi::Qos_record_enable_disable >::item
HW::item< bool > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:66
VOM::QoS::record_cmds::create_cmd::create_cmd
create_cmd(HW::item< bool > &item, const handle_t &itf, const source_t &src)
Constructor.
Definition: qos_record_cmds.cpp:23
VOM::QoS::record_cmds::create_cmd::operator==
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
Definition: qos_record_cmds.cpp:33
VOM::rc_t
Error codes that VPP will return during a HW write.
Definition: types.hpp:89
VOM::dump_cmd
A base class for VPP dump commands.
Definition: dump_cmd.hpp:43
VOM::QoS::record_cmds::dump_cmd::issue
rc_t issue(connection &con)
Issue the command to VPP/HW.
Definition: qos_record_cmds.cpp:112
VOM::QoS::record_cmds::create_cmd::issue
rc_t issue(connection &con)
Issue the command to VPP/HW.
Definition: qos_record_cmds.cpp:39
VOM::QoS::source_t
The Source of the QoS classification (i.e.
Definition: qos_types.hpp:33
VOM::QoS::record_cmds::delete_cmd::to_string
std::string to_string() const
convert to string format for debug purposes
Definition: qos_record_cmds.cpp:93
VOM::QoS::record_cmds::dump_cmd::dump_cmd
dump_cmd()
Constructor.
Definition: qos_record_cmds.cpp:101
string
const char *const string
Definition: cJSON.h:172