tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
2 | |||||
Ayaka Koshibe | 1d56fe4 | 2014-09-19 16:51:58 -0700 | [diff] [blame] | 3 | import org.onlab.packet.IpPrefix; |
Ayaka Koshibe | a9c199f | 2014-09-16 16:21:40 -0700 | [diff] [blame] | 4 | import org.onlab.packet.MacAddress; |
5 | import org.onlab.packet.VlanId; | ||||
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 6 | |
7 | import java.util.Set; | ||||
8 | |||||
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 9 | /** |
10 | * Abstraction of an end-station host on the network, essentially a NIC. | ||||
11 | */ | ||||
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 12 | public interface Host extends Element { |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 13 | |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 14 | /** |
15 | * Host identification. | ||||
16 | * | ||||
17 | * @return host id | ||||
18 | */ | ||||
Ayaka Koshibe | 1c7b38e | 2014-09-11 13:09:51 -0700 | [diff] [blame] | 19 | @Override |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 20 | HostId id(); |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 21 | |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 22 | /** |
23 | * Returns the host MAC address. | ||||
24 | * | ||||
25 | * @return mac address | ||||
26 | */ | ||||
Ayaka Koshibe | a9c199f | 2014-09-16 16:21:40 -0700 | [diff] [blame] | 27 | MacAddress mac(); |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 28 | |
29 | /** | ||||
Ayaka Koshibe | 74a2392 | 2014-09-09 16:45:39 -0700 | [diff] [blame] | 30 | * Returns the VLAN ID tied to this host. |
31 | * | ||||
32 | * @return VLAN ID value | ||||
33 | */ | ||||
Ayaka Koshibe | a9c199f | 2014-09-16 16:21:40 -0700 | [diff] [blame] | 34 | VlanId vlan(); |
Ayaka Koshibe | 74a2392 | 2014-09-09 16:45:39 -0700 | [diff] [blame] | 35 | |
36 | /** | ||||
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 37 | * Returns set of IP addresses currently bound to the host MAC address. |
38 | * | ||||
39 | * @return set of IP addresses; empty if no IP address is bound | ||||
40 | */ | ||||
Yuta HIGUCHI | a263915 | 2014-10-14 15:08:10 -0700 | [diff] [blame] | 41 | // FIXME: Switch to IpAddress |
Ayaka Koshibe | 1d56fe4 | 2014-09-19 16:51:58 -0700 | [diff] [blame] | 42 | Set<IpPrefix> ipAddresses(); |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 43 | |
44 | /** | ||||
45 | * Returns the most recent host location where the host attaches to the | ||||
46 | * network edge. | ||||
47 | * | ||||
48 | * @return host location | ||||
49 | */ | ||||
50 | HostLocation location(); | ||||
51 | |||||
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 52 | // TODO: explore capturing list of recent locations to aid in mobility |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 53 | |
54 | } |