blob: 407935073ab571e5573f164528ed3a36f7287150 [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 /**
37 * Configures an interface as trunk for 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 addTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId);
44
45 /* TODO Addition of more methods to make the behavior symmetrical.
46 Methods removeVlanFromInterface, getInterfacesForVlan, getVlansForInterface
47 should be added to complete the behavior.
48 */
49}