blob: 1e1898fb596b984c13a0892e7bf4254c0be568e9 [file] [log] [blame]
Andreas Papazois1dff77c2016-02-16 16:27:33 +02001/*
2 * Copyright 2016 Open Networking Laboratory
3 *
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
22/**
23 * Means to configure interfaces on devices.
24 */
25public interface InterfaceConfig extends HandlerBehaviour {
26
27 /**
28 * Adds an interface to a VLAN.
29 * @param deviceId the device ID
30 * @param intf the name of the interface
31 * @param vlanId the VLAN ID
32 * @return the result of operation
33 */
34 boolean addInterfaceToVlan(DeviceId deviceId, String intf, VlanId vlanId);
35
36 /**
Andreas Papazois92e4a042016-02-24 15:29:30 +020037 * Removes an interface from a VLAN.
38 * @param deviceId the device ID
39 * @param intf the name of the interface
40 * @param vlanId the VLAN ID
41 * @return the result of operation
42 */
43 boolean removeInterfaceFromVlan(DeviceId deviceId, String intf, VlanId vlanId);
44
45 /**
Andreas Papazois1dff77c2016-02-16 16:27:33 +020046 * Configures an interface as trunk for VLAN.
47 * @param deviceId the device ID
48 * @param intf the name of the interface
49 * @param vlanId the VLAN ID
50 * @return the result of operation
51 */
52 boolean addTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId);
53
Andreas Papazois92e4a042016-02-24 15:29:30 +020054 /**
55 * Removes trunk mode configuration for VLAN from an interface.
56 * @param deviceId the device ID
57 * @param intf the name of the interface
58 * @param vlanId the VLAN ID
59 * @return the result of operation
Andreas Papazois1dff77c2016-02-16 16:27:33 +020060 */
Andreas Papazois92e4a042016-02-24 15:29:30 +020061 boolean removeTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId);
62
63 /**
64 * TODO Addition of more methods to make the behavior symmetrical.
65 * Methods getInterfacesForVlan, getVlansForInterface, getTrunkforInterface,
66 * getInterfacesForTrunk should be added to complete the behavior.
67 */
68
Andreas Papazois1dff77c2016-02-16 16:27:33 +020069}