FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
ip_unnumbered_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_IP_UNNUMBERED_CMDS_H__
17 #define __VOM_IP_UNNUMBERED_CMDS_H__
18 
19 #include "vom/dump_cmd.hpp"
20 #include "vom/ip_unnumbered.hpp"
21 #include "vom/rpc_cmd.hpp"
22 
23 #include <vapi/interface.api.vapi.hpp>
24 
25 namespace VOM {
26 namespace ip_unnumbered_cmds {
27 
28 /**
29 *A command class that configures the IP unnumbered
30 */
32  : public rpc_cmd<HW::item<bool>, rc_t, vapi::Sw_interface_set_unnumbered>
33 {
34 public:
35  /**
36  * Constructor
37  */
38  config_cmd(HW::item<bool>& item, const handle_t& itf, const handle_t& l3_itf);
39 
40  /**
41  * Issue the command to VPP/HW
42  */
43  rc_t issue(connection& con);
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 config_cmd& i) const;
53 
54 private:
55  /**
56  * Reference to the interface for which the address is required
57  */
58  const handle_t& m_itf;
59  /**
60  * Reference to the interface which has an address
61  */
62  const handle_t& m_l3_itf;
63 };
64 
65 /**
66  * A cmd class that Unconfigs L3 Config from an interface
67  */
69  : public rpc_cmd<HW::item<bool>, rc_t, vapi::Sw_interface_set_unnumbered>
70 {
71 public:
72  /**
73  * Constructor
74  */
76  const handle_t& itf,
77  const handle_t& l3_itf);
78 
79  /**
80  * Issue the command to VPP/HW
81  */
82  rc_t issue(connection& con);
83  /**
84  * convert to string format for debug purposes
85  */
86  std::string to_string() const;
87 
88  /**
89  * Comparison operator - only used for UT
90  */
91  bool operator==(const unconfig_cmd& i) const;
92 
93 private:
94  /**
95  * Reference to the interface for which the address is required
96  */
97  const handle_t& m_itf;
98  /**
99  * Reference to the interface which has an address
100  */
101  const handle_t& m_l3_itf;
102 };
103 
104 /**
105  * A cmd class that Dumps all the IP unnumbered interfaces
106  */
107 class dump_cmd : public VOM::dump_cmd<vapi::Ip_unnumbered_dump>
108 {
109 public:
110  /**
111  * Constructor
112  */
113  dump_cmd() = default;
114 
115  /**
116  * Issue the command to VPP/HW
117  */
118  rc_t issue(connection& con);
119  /**
120  * convert to string format for debug purposes
121  */
122  std::string to_string() const;
123 
124  /**
125  * Comparison operator - only used for UT
126  */
127  bool operator==(const dump_cmd& i) const;
128 
129 private:
130  /**
131  * HW reutrn code
132  */
134 };
135 }; // namespace ip_unnumbered_cmds
136 }; // namespace VOM
137 
138 /*
139  * fd.io coding-style-patch-verification: ON
140  *
141  * Local Variables:
142  * eval: (c-set-style "mozilla")
143  * End:
144  */
145 
146 #endif
A command class that configures the IP unnumbered.
A cmd class that Dumps all the IP unnumbered interfaces.
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
config_cmd(HW::item< bool > &item, const handle_t &itf, const handle_t &l3_itf)
Constructor.
int i
Error codes that VPP will return during a HW write.
Definition: types.hpp:90
A cmd class that Unconfigs L3 Config from an interface.
A representation of the connection to VPP.
Definition: connection.hpp:33
HW::item< bool > & item()
return the HW item the command updates
Definition: rpc_cmd.hpp:64
A base class for all RPC commands to VPP.
Definition: rpc_cmd.hpp:38
rc_t issue(connection &con)
Issue the command to VPP/HW.
A type declaration of an interface handle in VPP.
Definition: types.hpp:236
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