FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
gbp_endpoint_group_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_GBP_ENDPOINT_GROUP_CMDS_H__
17 #define __VOM_GBP_ENDPOINT_GROUP_CMDS_H__
18 
19 #include "vom/dump_cmd.hpp"
21 
22 #include <vapi/gbp.api.vapi.hpp>
23 
24 namespace VOM {
25 namespace gbp_endpoint_group_cmds {
26 
27 /**
28 * A command class that creates or updates the GBP endpoint_group
29 */
31  : public rpc_cmd<HW::item<bool>, vapi::Gbp_endpoint_group_add_del>
32 {
33 public:
34  /**
35  * Constructor
36  */
38  epg_id_t epg_id,
39  uint32_t bd_id,
40  route::table_id_t rd_id,
41  const handle_t& itf);
42 
43  /**
44  * Issue the command to VPP/HW
45  */
46  rc_t issue(connection& con);
47 
48  /**
49  * convert to string format for debug purposes
50  */
51  std::string to_string() const;
52 
53  /**
54  * Comparison operator - only used for UT
55  */
56  bool operator==(const create_cmd& i) const;
57 
58 private:
59  const epg_id_t m_epg_id;
60  const uint32_t m_bd_id;
61  const route::table_id_t m_rd_id;
62  const handle_t m_itf;
63 };
64 
65 /**
66  * A cmd class that deletes a GBP endpoint_group
67  */
69  : public rpc_cmd<HW::item<bool>, vapi::Gbp_endpoint_group_add_del>
70 {
71 public:
72  /**
73  * Constructor
74  */
76 
77  /**
78  * Issue the command to VPP/HW
79  */
80  rc_t issue(connection& con);
81 
82  /**
83  * convert to string format for debug purposes
84  */
85  std::string to_string() const;
86 
87  /**
88  * Comparison operator - only used for UT
89  */
90  bool operator==(const delete_cmd& i) const;
91 
92 private:
93  const epg_id_t m_epg_id;
94 };
95 
96 /**
97  * A cmd class that Dumps all the GBP endpoint_groups
98  */
99 class dump_cmd : public VOM::dump_cmd<vapi::Gbp_endpoint_group_dump>
100 {
101 public:
102  /**
103  * Constructor
104  */
105  dump_cmd();
106  dump_cmd(const dump_cmd& d);
107 
108  /**
109  * Issue the command to VPP/HW
110  */
111  rc_t issue(connection& con);
112  /**
113  * convert to string format for debug purposes
114  */
115  std::string to_string() const;
116 
117  /**
118  * Comparison operator - only used for UT
119  */
120  bool operator==(const dump_cmd& i) const;
121 
122 private:
123  /**
124  * HW reutrn code
125  */
127 };
128 }; // namespace gbp_enpoint_cms
129 }; // namespace VOM
130 
131 /*
132  * fd.io coding-style-patch-verification: ON
133  *
134  * Local Variables:
135  * eval: (c-set-style "mozilla")
136  * End:
137  */
138 
139 #endif
uint32_t table_id_t
type def the table-id
Definition: prefix.hpp:83
uint32_t epg_id_t
EPG IDs are 32 bit integers.
A cmd class that deletes a GBP endpoint_group.
rc_t issue(connection &con)
Issue the command to VPP/HW.
int i
Error codes that VPP will return during a HW write.
Definition: types.hpp:84
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
create_cmd(HW::item< bool > &item, epg_id_t epg_id, uint32_t bd_id, route::table_id_t rd_id, const handle_t &itf)
Constructor.
A cmd class that Dumps all the GBP endpoint_groups.
A representation of the connection to VPP.
Definition: connection.hpp:33
A base class for all RPC commands to VPP.
Definition: rpc_cmd.hpp:38
A type declaration of an interface handle in VPP.
Definition: types.hpp:228
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
std::string to_string() const
convert to string format for debug purposes
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:64
A command class that creates or updates the GBP endpoint_group.