Andreas Papazois | 1dff77c | 2016-02-16 16:27:33 +0200 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.net.behaviour; |
| 17 | |
| 18 | import org.onlab.packet.VlanId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.driver.HandlerBehaviour; |
| 21 | |
| 22 | /** |
| 23 | * Means to configure interfaces on devices. |
| 24 | */ |
| 25 | public 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 Papazois | 92e4a04 | 2016-02-24 15:29:30 +0200 | [diff] [blame] | 37 | * 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 Papazois | 1dff77c | 2016-02-16 16:27:33 +0200 | [diff] [blame] | 46 | * 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 Papazois | 92e4a04 | 2016-02-24 15:29:30 +0200 | [diff] [blame] | 54 | /** |
| 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 Papazois | 1dff77c | 2016-02-16 16:27:33 +0200 | [diff] [blame] | 60 | */ |
Andreas Papazois | 92e4a04 | 2016-02-24 15:29:30 +0200 | [diff] [blame] | 61 | 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 Papazois | 1dff77c | 2016-02-16 16:27:33 +0200 | [diff] [blame] | 69 | } |