blob: b847647a4d3ec9c070b923dd523ce014f880ec9a [file] [log] [blame]
Andreas Papazois1dff77c2016-02-16 16:27:33 +02001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Andreas Papazois1dff77c2016-02-16 16:27:33 +02003 *
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 */
16package org.onosproject.net.behaviour;
17
18import org.onlab.packet.VlanId;
19import org.onosproject.net.DeviceId;
20import org.onosproject.net.driver.HandlerBehaviour;
21
Andreas Papazois59e19bb2016-04-12 13:59:58 +030022import java.util.List;
23
Andreas Papazois1dff77c2016-02-16 16:27:33 +020024/**
25 * Means to configure interfaces on devices.
26 */
27public interface InterfaceConfig extends HandlerBehaviour {
28
29 /**
30 * Adds an interface to a VLAN.
31 * @param deviceId the device ID
32 * @param intf the name of the interface
33 * @param vlanId the VLAN ID
34 * @return the result of operation
35 */
36 boolean addInterfaceToVlan(DeviceId deviceId, String intf, VlanId vlanId);
37
38 /**
Andreas Papazois92e4a042016-02-24 15:29:30 +020039 * Removes an interface from a VLAN.
40 * @param deviceId the device ID
41 * @param intf the name of the interface
42 * @param vlanId the VLAN ID
43 * @return the result of operation
44 */
45 boolean removeInterfaceFromVlan(DeviceId deviceId, String intf, VlanId vlanId);
46
47 /**
Andreas Papazois59e19bb2016-04-12 13:59:58 +030048 * Configures an interface as trunk for VLANs.
Andreas Papazois1dff77c2016-02-16 16:27:33 +020049 * @param deviceId the device ID
50 * @param intf the name of the interface
Andreas Papazois59e19bb2016-04-12 13:59:58 +030051 * @param vlanIds the VLAN IDs
Andreas Papazois1dff77c2016-02-16 16:27:33 +020052 * @return the result of operation
53 */
Andreas Papazois59e19bb2016-04-12 13:59:58 +030054 boolean addTrunkInterface(DeviceId deviceId, String intf, List<VlanId> vlanIds);
Andreas Papazois1dff77c2016-02-16 16:27:33 +020055
Andreas Papazois92e4a042016-02-24 15:29:30 +020056 /**
Andreas Papazois59e19bb2016-04-12 13:59:58 +030057 * Removes trunk mode configuration for VLANs from an interface.
Andreas Papazois92e4a042016-02-24 15:29:30 +020058 * @param deviceId the device ID
59 * @param intf the name of the interface
Andreas Papazois59e19bb2016-04-12 13:59:58 +030060 * @param vlanIds the VLAN IDs
Andreas Papazois92e4a042016-02-24 15:29:30 +020061 * @return the result of operation
Andreas Papazois1dff77c2016-02-16 16:27:33 +020062 */
Andreas Papazois59e19bb2016-04-12 13:59:58 +030063 boolean removeTrunkInterface(DeviceId deviceId, String intf, List<VlanId> vlanIds);
Andreas Papazois92e4a042016-02-24 15:29:30 +020064
65 /**
66 * TODO Addition of more methods to make the behavior symmetrical.
67 * Methods getInterfacesForVlan, getVlansForInterface, getTrunkforInterface,
68 * getInterfacesForTrunk should be added to complete the behavior.
69 */
70
Andreas Papazois1dff77c2016-02-16 16:27:33 +020071}