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:
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/acl_binding_cmds.hpp"
18 DEFINE_VAPI_MSG_IDS_ACL_API_JSON;
22 namespace binding_cmds {
25 l3_bind_cmd::issue(connection& con)
27 msg_t req(con.ctx(), std::ref(*this));
29 auto& payload = req.get_request().get_payload();
30 payload.sw_if_index = m_itf.value();
32 payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
33 payload.acl_index = m_acl.value();
35 VAPI_CALL(req.execute());
37 m_hw_item.set(wait());
44 l3_unbind_cmd::issue(connection& con)
46 msg_t req(con.ctx(), std::ref(*this));
48 auto& payload = req.get_request().get_payload();
49 payload.sw_if_index = m_itf.value();
51 payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
52 payload.acl_index = m_acl.value();
54 VAPI_CALL(req.execute());
56 m_hw_item.set(wait());
63 l3_dump_cmd::issue(connection& con)
65 m_dump.reset(new msg_t(con.ctx(), std::ref(*this)));
67 auto& payload = m_dump->get_request().get_payload();
68 payload.sw_if_index = ~0;
70 VAPI_CALL(m_dump->execute());
79 l2_bind_cmd::issue(connection& con)
81 msg_t req(con.ctx(), std::ref(*this));
83 auto& payload = req.get_request().get_payload();
84 payload.sw_if_index = m_itf.value();
86 // payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
87 payload.acl_index = m_acl.value();
89 VAPI_CALL(req.execute());
91 m_hw_item.set(wait());
98 l2_unbind_cmd::issue(connection& con)
100 msg_t req(con.ctx(), std::ref(*this));
102 auto& payload = req.get_request().get_payload();
103 payload.sw_if_index = m_itf.value();
105 // payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
106 payload.acl_index = m_acl.value();
108 VAPI_CALL(req.execute());
110 m_hw_item.set(wait());
117 l2_dump_cmd::issue(connection& con)
119 m_dump.reset(new msg_t(con.ctx(), std::ref(*this)));
121 auto& payload = m_dump->get_request().get_payload();
122 payload.sw_if_index = ~0;
124 VAPI_CALL(m_dump->execute());
131 }; // namespace binding_cmds
136 * fd.io coding-style-patch-verification: ON
139 * eval: (c-set-style "mozilla")