FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
gbp_vxlan_cmds.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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_VXLAN_CMDS_H__
17 #define __VOM_GBP_VXLAN_CMDS_H__
18 
19 #include "vom/dump_cmd.hpp"
20 #include "vom/gbp_vxlan.hpp"
21 #include "vom/interface.hpp"
22 
23 #include <vapi/gbp.api.vapi.hpp>
24 
25 namespace VOM {
26 namespace gbp_vxlan_cmds {
27 /**
28  * A command class that creates an Bridge-Domain
29  */
30 class create_cmd : public interface::create_cmd<vapi::Gbp_vxlan_tunnel_add>
31 {
32 public:
33  /**
34  * Constructor
35  */
37  const std::string& name,
38  const boost::asio::ip::address_v4& src,
39  uint32_t vni,
40  bool is_l2,
41  uint32_t bd_rd);
42 
43  /**
44  * Issue the command to VPP/HW
45  */
46  rc_t issue(connection& con);
47  /**
48  * convert to string format for debug purposes
49  */
50  std::string to_string() const;
51 
52  /**
53  * Comparison operator - only used for UT
54  */
55  bool operator==(const create_cmd& i) const;
56 
57 private:
58  boost::asio::ip::address_v4 m_src;
59  uint32_t m_vni;
60  bool m_is_l2;
61  uint32_t m_bd_rd;
62 };
63 
64 /**
65  * A cmd class that Delete an Bridge-Domain
66  */
67 class delete_cmd : public interface::delete_cmd<vapi::Gbp_vxlan_tunnel_del>
68 {
69 public:
70  /**
71  * Constructor
72  */
74 
75  /**
76  * Issue the command to VPP/HW
77  */
78  rc_t issue(connection& con);
79  /**
80  * convert to string format for debug purposes
81  */
82  std::string to_string() const;
83 
84  /**
85  * Comparison operator - only used for UT
86  */
87  bool operator==(const delete_cmd& i) const;
88 
89 private:
90  uint32_t m_vni;
91 };
92 
93 /**
94  * A cmd class that Dumps all the bridge domains
95  */
96 class dump_cmd : public VOM::dump_cmd<vapi::Gbp_vxlan_tunnel_dump>
97 {
98 public:
99  /**
100  * Constructor
101  */
102  dump_cmd();
103  dump_cmd(const dump_cmd& d);
104 
105  /**
106  * Issue the command to VPP/HW
107  */
108  rc_t issue(connection& con);
109  /**
110  * convert to string format for debug purposes
111  */
112  std::string to_string() const;
113 
114  /**
115  * Comparison operator - only used for UT
116  */
117  bool operator==(const dump_cmd& i) const;
118 
119 private:
120  /**
121  * HW reutrn code
122  */
124 };
125 
126 }; // gbp_vxlan_cmds
127 }; // VOM
128 
129 /*
130  * fd.io coding-style-patch-verification: ON
131  *
132  * Local Variables:
133  * eval: (c-set-style "mozilla")
134  * End:
135  */
136 
137 #endif
vl_api_address_t src
Definition: gre.api:51
int i
A cmd class that Dumps all the bridge domains.
Error codes that VPP will return during a HW write.
Definition: types.hpp:89
A command class that creates an Bridge-Domain.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A representation of the connection to VPP.
Definition: connection.hpp:33
create_cmd(HW::item< handle_t > &item, const std::string &name, const boost::asio::ip::address_v4 &src, uint32_t vni, bool is_l2, uint32_t bd_rd)
Constructor.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
u8 name[64]
Definition: memclnt.api:152
A cmd class that Delete an Bridge-Domain.
Base class for intterface Delete commands.
Definition: interface.hpp:376
A base class for interface Create commands.
Definition: interface.hpp:309
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
u32 vni
Definition: vxlan_gbp.api:42
A base class for VPP dump commands.
Definition: dump_cmd.hpp:43
HW::item< handle_t > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:66