blob: 22c2d8aa90c5f7dab28dee124ea6662532cb883c [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;
Andreas Papazois1ed54cf2016-05-04 16:22:40 +030020import org.onosproject.net.device.DeviceInterfaceDescription;
Andreas Papazois1dff77c2016-02-16 16:27:33 +020021import org.onosproject.net.driver.HandlerBehaviour;
22
Andreas Papazois59e19bb2016-04-12 13:59:58 +030023import java.util.List;
24
Andreas Papazois1dff77c2016-02-16 16:27:33 +020025/**
26 * Means to configure interfaces on devices.
27 */
28public interface InterfaceConfig extends HandlerBehaviour {
29
30 /**
Andreas Papazois827d8d02016-04-15 11:53:16 +030031 * Adds an access interface to a VLAN.
Andreas Papazois1ed54cf2016-05-04 16:22:40 +030032 *
Andreas Papazois1dff77c2016-02-16 16:27:33 +020033 * @param deviceId the device ID
34 * @param intf the name of the interface
35 * @param vlanId the VLAN ID
36 * @return the result of operation
37 */
Andreas Papazois827d8d02016-04-15 11:53:16 +030038 boolean addAccessInterface(DeviceId deviceId, String intf, VlanId vlanId);
Andreas Papazois1dff77c2016-02-16 16:27:33 +020039
40 /**
Andreas Papazois827d8d02016-04-15 11:53:16 +030041 * Removes an access interface to a VLAN.
Andreas Papazois1ed54cf2016-05-04 16:22:40 +030042 *
Andreas Papazois92e4a042016-02-24 15:29:30 +020043 * @param deviceId the device ID
44 * @param intf the name of the interface
Andreas Papazois92e4a042016-02-24 15:29:30 +020045 * @return the result of operation
46 */
Andreas Papazois827d8d02016-04-15 11:53:16 +030047 boolean removeAccessInterface(DeviceId deviceId, String intf);
Andreas Papazois92e4a042016-02-24 15:29:30 +020048
49 /**
Andreas Papazois827d8d02016-04-15 11:53:16 +030050 * Adds a trunk interface for VLANs.
Andreas Papazois1ed54cf2016-05-04 16:22:40 +030051 *
Andreas Papazois1dff77c2016-02-16 16:27:33 +020052 * @param deviceId the device ID
53 * @param intf the name of the interface
Andreas Papazois59e19bb2016-04-12 13:59:58 +030054 * @param vlanIds the VLAN IDs
Andreas Papazois1dff77c2016-02-16 16:27:33 +020055 * @return the result of operation
56 */
Andreas Papazois59e19bb2016-04-12 13:59:58 +030057 boolean addTrunkInterface(DeviceId deviceId, String intf, List<VlanId> vlanIds);
Andreas Papazois1dff77c2016-02-16 16:27:33 +020058
Andreas Papazois92e4a042016-02-24 15:29:30 +020059 /**
Andreas Papazois827d8d02016-04-15 11:53:16 +030060 * Removes trunk mode configuration from an interface.
Andreas Papazois1ed54cf2016-05-04 16:22:40 +030061 *
Andreas Papazois92e4a042016-02-24 15:29:30 +020062 * @param deviceId the device ID
63 * @param intf the name of the interface
Andreas Papazois92e4a042016-02-24 15:29:30 +020064 * @return the result of operation
Andreas Papazois1dff77c2016-02-16 16:27:33 +020065 */
Andreas Papazois827d8d02016-04-15 11:53:16 +030066 boolean removeTrunkInterface(DeviceId deviceId, String intf);
Andreas Papazois92e4a042016-02-24 15:29:30 +020067
68 /**
Andreas Papazois1ed54cf2016-05-04 16:22:40 +030069 * Provides the interfaces configured on a device.
70 *
71 * @param deviceId the device ID
72 * @return the list of the configured interfaces
73 */
74 List<DeviceInterfaceDescription> getInterfaces(DeviceId deviceId);
75
76 /**
Andreas Papazois92e4a042016-02-24 15:29:30 +020077 * TODO Addition of more methods to make the behavior symmetrical.
78 * Methods getInterfacesForVlan, getVlansForInterface, getTrunkforInterface,
79 * getInterfacesForTrunk should be added to complete the behavior.
80 */
81
Andreas Papazois1dff77c2016-02-16 16:27:33 +020082}