FD.io VPP  v21.01.1
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  */
43  rc_t issue(connection& con);
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  */
75  rc_t issue(connection& con);
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  */
107  rc_t issue(connection& con);
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  */
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
const char *const string
Definition: cJSON.h:172
A cmd class that deletes a GBP endpoint.
vl_api_address_t src
Definition: gre.api:54
Error codes that VPP will return during a HW write.
Definition: types.hpp:89
create_cmd(HW::item< bool > &item, const handle_t &itf, const source_t &src)
Constructor.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A command class that creates or updates the GBP endpoint.
A representation of the connection to VPP.
Definition: connection.hpp:33
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
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
The Source of the QoS classification (i.e.
Definition: qos_types.hpp:33
A type declaration of an interface handle in VPP.
Definition: types.hpp:233
std::string to_string() const
convert to string format for debug purposes
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
A cmd class that Dumps all the GBP endpoints.
A base class for VPP dump commands.
Definition: dump_cmd.hpp:43
HW::item< bool > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:66