blob: aab10d7c8b1473a61c076e4667b19efcfaee5e15 [file] [log] [blame]
tomb36046e2014-08-27 00:22:24 -07001package org.onlab.onos.net;
2
Jonathan Hartb79d6412014-09-19 11:24:06 -07003import java.util.Set;
4
5import org.onlab.packet.IpAddress;
6
tomb36046e2014-08-27 00:22:24 -07007/**
8 * Abstraction of a network port.
9 */
10public interface Port {
11
tomca20e0c2014-09-03 23:22:24 -070012 /**
tomb36046e2014-08-27 00:22:24 -070013 * Returns the port number.
14 *
15 * @return port number
16 */
17 PortNumber number();
18
19 /**
tomca20e0c2014-09-03 23:22:24 -070020 * 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 /**
tom29df6f42014-09-05 08:14:14 -070027 * Returns the parent network element to which this port belongs.
tomb36046e2014-08-27 00:22:24 -070028 *
29 * @return parent network element
30 */
tom29df6f42014-09-05 08:14:14 -070031 Element element();
tomb36046e2014-08-27 00:22:24 -070032
33 // set of port attributes
34
Jonathan Hartb79d6412014-09-19 11:24:06 -070035 /**
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();
tomb36046e2014-08-27 00:22:24 -070043}