blob: be4f1ea8a3acdb11e0bcdcda6ddbdeb75ca5f647 [file] [log] [blame]
Andreas Papazois1ed54cf2016-05-04 16:22:40 +03001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Andreas Papazois1ed54cf2016-05-04 16:22:40 +03003 *
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 */
16
17package org.onosproject.net.device;
18
19import org.onlab.packet.VlanId;
20
21import java.util.List;
22
23/**
24 * The description of an interface used for legacy devices.
25 */
26public interface DeviceInterfaceDescription {
27 /**
28 * Represents the type of operation of the interface.
29 */
30 enum Mode {
31 /**
32 * Normal mode of interface operation.
33 */
34 NORMAL,
35 /**
36 * Access mode to a VLAN for interface.
37 */
38 ACCESS,
39 /**
40 * Trunk mode for a set of VLANs for interface.
41 */
42 TRUNK
43 }
44
45 /**
46 * Returns the name of the interface.
47 *
48 * @return name of the interface
49 */
50 String name();
51
52 /**
53 * Returns the operation mode of the interface.
54 *
55 * @return operation mode of the interface
56 */
57 Mode mode();
58
59 /**
60 * Returns the VLAN-IDs configured for the interface. No VLAN-ID should be
61 * returned for NORMAL mode, 1 VLAN-ID for access mode and 1 or more
62 * VLAN-IDs for trunking mode.
63 *
64 * @return VLAN-ID(s) configured for the interface.
65 */
66 List<VlanId> vlans();
67
68 /**
69 * Indicates whether a rate limit has been set on the interface.
70 *
71 * @return indication whether interface is rate limited or not
72 */
73 boolean isRateLimited();
74
75 /**
76 * Returns the rate limit set on the interface bandwidth.
77 *
78 * @return the rate limit set on the interface bandwidth
79 */
80 short rateLimit();
81}