vxlan: vxlan/vxlan.api API cleanup
[vpp.git] / extras / vom / vom / qos_record_cmds.hpp
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  */
31 class create_cmd
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  */
63 class delete_cmd
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    */
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: ON
130  *
131  * Local Variables:
132  * eval: (c-set-style "mozilla")
133  * End:
134  */
135
136 #endif