FD.io VPP  v19.08-27-gf4dcae4
Vector Packet Processing
route_domain_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_ROUTE_DOMAIN_CMDS_H__
17 #define __VOM_ROUTE_DOMAIN_CMDS_H__
18 
19 #include "vom/dump_cmd.hpp"
20 #include "vom/route_domain.hpp"
21 #include "vom/rpc_cmd.hpp"
22 
23 #include <vapi/ip.api.vapi.hpp>
24 
25 namespace VOM {
26 namespace route_domain_cmds {
27 
28 /**
29  * A command class that creates the IP table
30  */
31 class create_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_table_add_del>
32 {
33 public:
34  /**
35  * Constructor
36  */
38 
39  /**
40  * Issue the command to VPP/HW
41  */
42  rc_t issue(connection& con);
43 
44  /**
45  * convert to string format for debug purposes
46  */
47  std::string to_string() const;
48 
49  /**
50  * Comparison operator - only used for UT
51  */
52  bool operator==(const create_cmd& i) const;
53 
54 private:
55  /**
56  * table-ID to create
57  */
58  route::table_id_t m_id;
59 
60  /**
61  * L3 protocol of the table
62  */
63  l3_proto_t m_proto;
64 };
65 
66 /**
67  * A cmd class that Deletes the IP Table
68  */
69 class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_table_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  /**
94  * table-ID to create
95  */
96  route::table_id_t m_id;
97 
98  /**
99  * L3 protocol of the table
100  */
101  l3_proto_t m_proto;
102 };
103 
104 /**
105  * A cmd class that Dumps IP fib tables
106  */
107 class dump_cmd : public VOM::dump_cmd<vapi::Ip_table_dump>
108 {
109 public:
110  /**
111  * Constructor
112  */
113  dump_cmd();
114  dump_cmd(const dump_cmd& d);
115 
116  /**
117  * Issue the command to VPP/HW
118  */
119  rc_t issue(connection& con);
120  /**
121  * convert to string format for debug purposes
122  */
123  std::string to_string() const;
124 
125  /**
126  * Comparison operator - only used for UT
127  */
128  bool operator==(const dump_cmd& i) const;
129 
130 private:
131  /**
132  * HW reutrn code
133  */
135 };
136 
137 }; // namespace route_domain_cmds
138 }; // namespace VOM
139 
140 /*
141  * fd.io coding-style-patch-verification: ON
142  *
143  * Local Variables:
144  * eval: (c-set-style "mozilla")
145  * End:
146  */
147 
148 #endif
uint32_t table_id_t
type def the table-id
Definition: prefix.hpp:121
create_cmd(HW::item< bool > &item, l3_proto_t proto, route::table_id_t id)
Constructor.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
int i
Error codes that VPP will return during a HW write.
Definition: types.hpp:89
An L3 protocol can be used to construct a prefix that is used to match packets are part of a route...
Definition: prefix.hpp:52
A representation of the connection to VPP.
Definition: connection.hpp:33
A base class for all RPC commands to VPP.
Definition: rpc_cmd.hpp:40
A command class that creates the IP table.
A cmd class that Deletes the IP Table.
The VPP Object Model (VOM) library.
Definition: acl_binding.cpp:19
A cmd class that Dumps IP fib tables.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A base class for VPP dump commands.
Definition: dump_cmd.hpp:43
std::string to_string() const
convert to string format for debug purposes
HW::item< bool > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:66
vl_api_fib_path_nh_proto_t proto
Definition: fib_types.api:125