tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
| 2 | |
Jonathan Hart | b79d641 | 2014-09-19 11:24:06 -0700 | [diff] [blame^] | 3 | import java.util.Set; |
| 4 | |
| 5 | import org.onlab.packet.IpAddress; |
| 6 | |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 7 | /** |
| 8 | * Abstraction of a network port. |
| 9 | */ |
| 10 | public interface Port { |
| 11 | |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 12 | /** |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 13 | * Returns the port number. |
| 14 | * |
| 15 | * @return port number |
| 16 | */ |
| 17 | PortNumber number(); |
| 18 | |
| 19 | /** |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 20 | * Indicates whether or not the port is currently up and active. |
| 21 | * |
| 22 | * @return true if the port is operational |
| 23 | */ |
| 24 | boolean isEnabled(); |
| 25 | |
| 26 | /** |
tom | 29df6f4 | 2014-09-05 08:14:14 -0700 | [diff] [blame] | 27 | * Returns the parent network element to which this port belongs. |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 28 | * |
| 29 | * @return parent network element |
| 30 | */ |
tom | 29df6f4 | 2014-09-05 08:14:14 -0700 | [diff] [blame] | 31 | Element element(); |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 32 | |
| 33 | // set of port attributes |
| 34 | |
Jonathan Hart | b79d641 | 2014-09-19 11:24:06 -0700 | [diff] [blame^] | 35 | /** |
| 36 | * Returns the set of IP addresses that are logically configured on this |
| 37 | * port. |
| 38 | * |
| 39 | * @return the set of IP addresses configured on the port. The set is empty |
| 40 | * if no addresses are configured. |
| 41 | */ |
| 42 | Set<IpAddress> ipAddresses(); |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 43 | } |