blob: ff39de664ec45fab061edbf49776831750da282a [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.device;
tom0eb04ca2014-08-25 14:34:51 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.net.Description;
19import org.onosproject.net.PortNumber;
tomca20e0c2014-09-03 23:22:24 -070020
Brian O'Connorabafb502014-12-02 22:26:20 -080021import static org.onosproject.net.Port.Type;
Thomas Vachuskad16ce182014-10-29 17:25:29 -070022
tom0eb04ca2014-08-25 14:34:51 -070023/**
24 * Information about a port.
25 */
Yuta HIGUCHI55710e72014-10-02 14:58:32 -070026public interface PortDescription extends Description {
tom0eb04ca2014-08-25 14:34:51 -070027
tomca20e0c2014-09-03 23:22:24 -070028 /**
29 * Returns the port number.
30 *
31 * @return port number
32 */
33 PortNumber portNumber();
34
35 /**
tomd40fc7a2014-09-04 16:41:10 -070036 * Indicates whether or not the port is up and active.
tomca20e0c2014-09-03 23:22:24 -070037 *
tomd40fc7a2014-09-04 16:41:10 -070038 * @return true if the port is active and has carrier signal
tomca20e0c2014-09-03 23:22:24 -070039 */
tomd40fc7a2014-09-04 16:41:10 -070040 boolean isEnabled();
tomca20e0c2014-09-03 23:22:24 -070041
Thomas Vachuskad16ce182014-10-29 17:25:29 -070042 /**
Michal Machce774332017-01-25 11:02:55 +010043 * Indicates whether or not the port was removed.
44 *
45 * @return true if the port is removed.
46 */
47 boolean isRemoved();
48
49 /**
Thomas Vachuskad16ce182014-10-29 17:25:29 -070050 * Returns the port type.
51 *
52 * @return port type
53 */
54 Type type();
55
56 /**
57 * Returns the current port speed in Mbps.
58 *
59 * @return current port speed
60 */
61 long portSpeed();
62
tom0eb04ca2014-08-25 14:34:51 -070063}