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.hpp"
18 DEFINE_VAPI_MSG_IDS_ACL_API_JSON;
24 l3_binding::bind_cmd::issue(connection& con)
26 msg_t req(con.ctx(), std::ref(*this));
28 auto& payload = req.get_request().get_payload();
29 payload.sw_if_index = m_itf.value();
31 payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
32 payload.acl_index = m_acl.value();
34 VAPI_CALL(req.execute());
36 m_hw_item.set(wait());
43 l3_binding::unbind_cmd::issue(connection& con)
45 msg_t req(con.ctx(), std::ref(*this));
47 auto& payload = req.get_request().get_payload();
48 payload.sw_if_index = m_itf.value();
50 payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
51 payload.acl_index = m_acl.value();
53 VAPI_CALL(req.execute());
55 m_hw_item.set(wait());
62 l3_binding::dump_cmd::issue(connection& con)
64 m_dump.reset(new msg_t(con.ctx(), std::ref(*this)));
66 auto& payload = m_dump->get_request().get_payload();
67 payload.sw_if_index = ~0;
69 VAPI_CALL(m_dump->execute());
78 l2_binding::bind_cmd::issue(connection& con)
80 msg_t req(con.ctx(), std::ref(*this));
82 auto& payload = req.get_request().get_payload();
83 payload.sw_if_index = m_itf.value();
85 // payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
86 payload.acl_index = m_acl.value();
88 VAPI_CALL(req.execute());
90 m_hw_item.set(wait());
97 l2_binding::unbind_cmd::issue(connection& con)
99 msg_t req(con.ctx(), std::ref(*this));
101 auto& payload = req.get_request().get_payload();
102 payload.sw_if_index = m_itf.value();
104 // payload.is_input = (m_direction == direction_t::INPUT ? 1 : 0);
105 payload.acl_index = m_acl.value();
107 VAPI_CALL(req.execute());
109 m_hw_item.set(wait());
116 l2_binding::dump_cmd::issue(connection& con)
118 m_dump.reset(new msg_t(con.ctx(), std::ref(*this)));
120 auto& payload = m_dump->get_request().get_payload();
121 payload.sw_if_index = ~0;
123 VAPI_CALL(m_dump->execute());
133 * fd.io coding-style-patch-verification: ON
136 * eval: (c-set-style "mozilla")