blob: 322b57d7cbfb0693b8ce1a29a7f8b01e414684a8 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.host;
tom0eb04ca2014-08-25 14:34:51 -070017
Yuta HIGUCHI5fa3dc02014-10-15 17:08:13 -070018import java.util.Set;
19
Brian O'Connorabafb502014-12-02 22:26:20 -080020import org.onosproject.net.Description;
21import org.onosproject.net.HostLocation;
Pavlin Radoslavov33f228a2014-10-27 19:33:16 -070022import org.onlab.packet.IpAddress;
Ayaka Koshibea9c199f2014-09-16 16:21:40 -070023import org.onlab.packet.MacAddress;
24import org.onlab.packet.VlanId;
Jonghwan Hyun2c95acf2018-03-14 16:47:34 -070025import org.onlab.packet.EthType;
Ayaka Koshibe74a23922014-09-09 16:45:39 -070026
tom0eb04ca2014-08-25 14:34:51 -070027/**
28 * Information describing host and its location.
29 */
Ayaka Koshibe74a23922014-09-09 16:45:39 -070030public interface HostDescription extends Description {
tom0eb04ca2014-08-25 14:34:51 -070031
Ayaka Koshibe74a23922014-09-09 16:45:39 -070032 /**
33 * Returns the MAC address associated with this host (NIC).
34 *
35 * @return the MAC address of this host
36 */
Ayaka Koshibea9c199f2014-09-16 16:21:40 -070037 MacAddress hwAddress();
Ayaka Koshibe74a23922014-09-09 16:45:39 -070038
39 /**
40 * Returns the VLAN associated with this host.
41 *
42 * @return the VLAN ID value
43 */
Ayaka Koshibea9c199f2014-09-16 16:21:40 -070044 VlanId vlan();
Ayaka Koshibe74a23922014-09-09 16:45:39 -070045
46 /**
Jonghwan Hyun2c95acf2018-03-14 16:47:34 -070047 * Returns the inner VLAN associated with this host.
48 *
49 * @return VLAN ID value; VlanId.NONE if only one VLAN ID is associated with this host
50 */
51 default VlanId innerVlan() {
52 return VlanId.NONE;
53 }
54
55 /**
56 * Returns the TPID of the outermost VLAN associated with this host.
57 *
58 * @return TPID of the outermost VLAN header
59 */
60 default EthType tpid() {
61 return EthType.EtherType.UNKNOWN.ethType();
62 }
63
64 /**
Charles Chancd06c692017-04-27 20:46:06 -070065 * Returns the most recent location of the host on the network edge.
Ayaka Koshibe74a23922014-09-09 16:45:39 -070066 *
Charles Chancd06c692017-04-27 20:46:06 -070067 * @return the most recent host location
Ayaka Koshibe74a23922014-09-09 16:45:39 -070068 */
69 HostLocation location();
70
71 /**
Charles Chancd06c692017-04-27 20:46:06 -070072 * Returns all locations of the host on the network edge.
73 *
74 * @return all host locations
75 */
76 Set<HostLocation> locations();
77
78 /**
Charles Chanf42939d2019-12-06 19:19:30 -080079 * Returns host auxiliary locations, which could be useful for app operations in addition to the attach points.
80 *
81 * @return auxiliary locations, or null if unspecified
82 */
83 Set<HostLocation> auxLocations();
84
85 /**
tom093340b2014-10-10 00:15:36 -070086 * Returns the IP address associated with this host's MAC.
Ayaka Koshibe74a23922014-09-09 16:45:39 -070087 *
tom093340b2014-10-10 00:15:36 -070088 * @return host IP address
Ayaka Koshibe74a23922014-09-09 16:45:39 -070089 */
Pavlin Radoslavov33f228a2014-10-27 19:33:16 -070090 Set<IpAddress> ipAddress();
sdn5e935452016-08-30 04:12:54 -070091
92 /**
93 * Returns true if configured by NetworkConfiguration.
94 * @return configured/learnt dynamically
95 */
96 default boolean configured() {
97 return false;
98 }
tom0eb04ca2014-08-25 14:34:51 -070099}