blob: 3b7053363dfc85ff09014503790db6cc6dcc6448 [file] [log] [blame]
Tunahan Sezen03e55272020-04-18 09:18:53 +00001/*
Joey Armstrong53fcac22023-01-11 13:25:01 -05002 * Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
Tunahan Sezen03e55272020-04-18 09:18:53 +00003 *
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 */
16package org.opencord.maclearner.api;
17
18import org.onlab.packet.MacAddress;
19import org.onlab.packet.VlanId;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.PortNumber;
22
23/**
24 * Representation of a mac learner object.
25 */
26public 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}