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.
18 #include "vom/acl_l2_rule.hpp"
23 l2_rule::l2_rule(uint32_t priority,
24 const action_t& action,
25 const route::prefix_t& ip,
26 const mac_address_t& mac,
27 const mac_address_t& mac_mask)
28 : m_priority(priority)
32 , m_mac_mask(mac_mask)
37 l2_rule::operator<(const l2_rule& other) const
39 return (other.m_priority < m_priority);
43 l2_rule::operator==(const l2_rule& rule) const
45 return ((m_action == rule.m_action) && (m_src_ip == rule.m_src_ip) &&
46 (m_mac == rule.m_mac) && (m_mac_mask == rule.m_mac_mask));
50 l2_rule::to_string() const
55 << "priority:" << m_priority << " action:" << m_action.to_string()
56 << " ip:" << m_src_ip.to_string() << " mac:" << m_mac
57 << " mac-mask:" << m_mac_mask << "]";
63 l2_rule::priority() const
69 l2_rule::action() const
74 const route::prefix_t&
75 l2_rule::src_ip() const
87 l2_rule::mac_mask() const
94 * fd.io coding-style-patch-verification: ON
97 * eval: (c-set-style "mozilla")