Tunahan Sezen | 1f65c90 | 2020-09-08 13:10:16 +0000 | [diff] [blame] | 1 | /* |
Joey Armstrong | 53fcac2 | 2023-01-11 13:25:01 -0500 | [diff] [blame^] | 2 | * Copyright 2020-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Tunahan Sezen | 1f65c90 | 2020-09-08 13:10:16 +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.EthType; |
| 19 | import org.onlab.packet.IpAddress; |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | import org.onlab.packet.VlanId; |
| 22 | import org.onosproject.net.HostId; |
| 23 | import org.onosproject.net.HostLocation; |
| 24 | |
| 25 | /** |
| 26 | * Mac Learner Host Location Service. |
| 27 | */ |
| 28 | public interface MacLearnerHostLocationService { |
| 29 | |
| 30 | /** |
| 31 | * Create or update host information. |
| 32 | * Will not update IP if IP is null, all zero or self-assigned. |
| 33 | * |
| 34 | * @param hid host ID |
| 35 | * @param srcMac source Mac address |
| 36 | * @param dstMac destination Mac address |
| 37 | * @param vlan VLAN ID |
| 38 | * @param innerVlan inner VLAN ID |
| 39 | * @param outerTpid outer TPID |
| 40 | * @param hloc host location |
| 41 | * @param auxLoc auxiliary location |
| 42 | * @param ip source IP address or null if not updating |
| 43 | */ |
| 44 | void createOrUpdateHost(HostId hid, MacAddress srcMac, MacAddress dstMac, VlanId vlan, VlanId innerVlan, |
| 45 | EthType outerTpid, HostLocation hloc, HostLocation auxLoc, IpAddress ip); |
| 46 | |
| 47 | /** |
| 48 | * Updates IP address for an existing host. |
| 49 | * |
| 50 | * @param hid host ID |
| 51 | * @param ip IP address |
| 52 | */ |
| 53 | void updateHostIp(HostId hid, IpAddress ip); |
| 54 | |
| 55 | /** |
| 56 | * Removes host completely. |
| 57 | * |
| 58 | * @param macAddress source Mac address |
| 59 | * @param vlanId VLAN ID |
| 60 | */ |
| 61 | void vanishHost(MacAddress macAddress, VlanId vlanId); |
| 62 | |
| 63 | } |