blob: fdef34d02aa68fd32742cbc8446dc45df9cd2ba1 [file] [log] [blame]
Tunahan Sezen1f65c902020-09-08 13:10:16 +00001/*
Joey Armstrong53fcac22023-01-11 13:25:01 -05002 * Copyright 2020-2023 Open Networking Foundation (ONF) and the ONF Contributors
Tunahan Sezen1f65c902020-09-08 13:10:16 +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.EthType;
19import org.onlab.packet.IpAddress;
20import org.onlab.packet.MacAddress;
21import org.onlab.packet.VlanId;
22import org.onosproject.net.HostId;
23import org.onosproject.net.HostLocation;
24
25/**
26 * Mac Learner Host Location Service.
27 */
28public 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}