Tunahan Sezen | 03e5527 | 2020-04-18 09:18:53 +0000 | [diff] [blame] | 1 | /* |
Joey Armstrong | 53fcac2 | 2023-01-11 13:25:01 -0500 | [diff] [blame^] | 2 | * Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Tunahan Sezen | 03e5527 | 2020-04-18 09:18:53 +0000 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.opencord.maclearner.api; |
| 17 | |
| 18 | import org.onlab.packet.MacAddress; |
| 19 | import org.onlab.packet.VlanId; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.PortNumber; |
| 22 | |
| 23 | /** |
| 24 | * Representation of a mac learner object. |
| 25 | */ |
| 26 | public interface MacLearner { |
| 27 | |
| 28 | /** |
| 29 | * Returns the device identifier. |
| 30 | * |
| 31 | * @return device id |
| 32 | */ |
| 33 | DeviceId deviceId(); |
| 34 | |
| 35 | /** |
| 36 | * Returns from which port the mac address is learned. |
| 37 | * @return port number |
| 38 | */ |
| 39 | PortNumber portNumber(); |
| 40 | |
| 41 | /** |
| 42 | * Returns which vlan id of the package the mac address is learned from. |
| 43 | * If packet is double tagged, vlan id is equal to QinQVID. |
| 44 | * @return vlan id |
| 45 | */ |
| 46 | VlanId vlanId(); |
| 47 | |
| 48 | /** |
| 49 | * Returns Mac Address information. |
| 50 | * @return mac address |
| 51 | */ |
| 52 | MacAddress macAddress(); |
| 53 | |
| 54 | } |