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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include "vom/l2_vtr_cmds.hpp"
19 namespace l2_vtr_cmds {
21 set_cmd::set_cmd(HW::item<l2_vtr::option_t>& item,
31 set_cmd::operator==(const set_cmd& other) const
34 (m_hw_item.data() == other.m_hw_item.data() && m_itf == other.m_itf) &&
35 (m_tag == other.m_tag));
39 set_cmd::issue(connection& con)
41 msg_t req(con.ctx(), std::ref(*this));
43 auto& payload = req.get_request().get_payload();
44 payload.sw_if_index = m_itf.value();
45 payload.vtr_op = m_hw_item.data().value();
46 payload.push_dot1q = 1;
49 VAPI_CALL(req.execute());
55 set_cmd::to_string() const
58 s << "L2-vtr-set: " << m_hw_item.to_string() << " itf:" << m_itf.to_string()
64 }; // namespace vtr_cmds
68 * fd.io coding-style-patch-verification: ON
71 * eval: (c-set-style "mozilla")