blob: 485b76f63836cd9ab4e4a222d40f61d5a107cd2d [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
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;
tome33cc1a2014-08-25 21:59:41 -070017
Pavlin Radoslavov33f228a2014-10-27 19:33:16 -070018import org.onlab.packet.IpAddress;
Ayaka Koshibea9c199f2014-09-16 16:21:40 -070019import org.onlab.packet.MacAddress;
20import org.onlab.packet.VlanId;
Deepa Vaddireddy50ad0802016-08-08 19:27:36 +053021import org.onosproject.store.service.WallClockTimestamp;
tom7869ad92014-09-09 14:32:08 -070022
23import java.util.Set;
24
tome33cc1a2014-08-25 21:59:41 -070025/**
26 * Abstraction of an end-station host on the network, essentially a NIC.
27 */
tomb36046e2014-08-27 00:22:24 -070028public interface Host extends Element {
tome33cc1a2014-08-25 21:59:41 -070029
tom7869ad92014-09-09 14:32:08 -070030 /**
31 * Host identification.
32 *
33 * @return host id
34 */
Ayaka Koshibe1c7b38e2014-09-11 13:09:51 -070035 @Override
tom7869ad92014-09-09 14:32:08 -070036 HostId id();
tome33cc1a2014-08-25 21:59:41 -070037
tom7869ad92014-09-09 14:32:08 -070038 /**
39 * Returns the host MAC address.
40 *
41 * @return mac address
42 */
Ayaka Koshibea9c199f2014-09-16 16:21:40 -070043 MacAddress mac();
tom7869ad92014-09-09 14:32:08 -070044
45 /**
Ayaka Koshibe74a23922014-09-09 16:45:39 -070046 * Returns the VLAN ID tied to this host.
47 *
48 * @return VLAN ID value
49 */
Ayaka Koshibea9c199f2014-09-16 16:21:40 -070050 VlanId vlan();
Ayaka Koshibe74a23922014-09-09 16:45:39 -070051
52 /**
tom7869ad92014-09-09 14:32:08 -070053 * Returns set of IP addresses currently bound to the host MAC address.
54 *
55 * @return set of IP addresses; empty if no IP address is bound
56 */
Pavlin Radoslavov33f228a2014-10-27 19:33:16 -070057 Set<IpAddress> ipAddresses();
tomb36046e2014-08-27 00:22:24 -070058
59 /**
60 * Returns the most recent host location where the host attaches to the
61 * network edge.
62 *
63 * @return host location
64 */
65 HostLocation location();
66
Deepa Vaddireddy50ad0802016-08-08 19:27:36 +053067 /**
68 * Returns the host recent time.
69 * @return host last updated time
70 */
71 default WallClockTimestamp timestamp() {
72 return null;
73 }
tom7869ad92014-09-09 14:32:08 -070074 // TODO: explore capturing list of recent locations to aid in mobility
tome33cc1a2014-08-25 21:59:41 -070075
76}
Deepa Vaddireddy50ad0802016-08-08 19:27:36 +053077