Jian Li | 38e4d94 | 2018-07-03 22:19:16 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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.openstackvtap.api; |
| 17 | |
| 18 | import org.onlab.packet.VlanId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.PortNumber; |
| 21 | |
| 22 | /** |
| 23 | * Service for administering the inventory of vTap. |
| 24 | */ |
| 25 | public interface OpenstackVtapAdminService extends OpenstackVtapService { |
| 26 | |
| 27 | /** |
| 28 | * Creates a new vTap based on the specified description. |
| 29 | * |
| 30 | * @param type vTap type |
| 31 | * @param vTapCriterion criterion of a vTap |
| 32 | * @return created vTap object or null if error occurred |
| 33 | */ |
| 34 | OpenstackVtap createVtap(OpenstackVtap.Type type, OpenstackVtapCriterion vTapCriterion); |
| 35 | |
| 36 | /** |
| 37 | * Updates the existing vTap based on the given vTap instance. |
| 38 | * |
| 39 | * @param vTapId vTap identifier |
| 40 | * @param vTap vTap instance to be modified |
| 41 | * @return updated vTap object or null if error occurred |
| 42 | */ |
| 43 | OpenstackVtap updateVtap(OpenstackVtapId vTapId, OpenstackVtap vTap); |
| 44 | |
| 45 | /** |
| 46 | * Removes the specified vTap with given vTap identifier. |
| 47 | * |
| 48 | * @param vTapId vTap identifier |
| 49 | * @return removed vTap object or null if error occurred |
| 50 | */ |
| 51 | OpenstackVtap removeVtap(OpenstackVtapId vTapId); |
| 52 | |
| 53 | /** |
| 54 | * Sets output port and VLAN tag for vTap. |
| 55 | * |
| 56 | * @param deviceId device identifier |
| 57 | * @param type vTap type |
| 58 | * @param portNumber port number |
| 59 | * @param vlanId VLAN tag |
| 60 | */ |
| 61 | void setVtapOutput(DeviceId deviceId, OpenstackVtap.Type type, |
| 62 | PortNumber portNumber, VlanId vlanId); |
| 63 | |
| 64 | /** |
| 65 | * Sets output port and VNI for vTap. |
| 66 | * |
| 67 | * @param deviceId device identifier |
| 68 | * @param type vTap type |
| 69 | * @param portNumber port number |
| 70 | * @param vni virtual network index (VNI) of VxLAN |
| 71 | */ |
| 72 | void setVtapOutput(DeviceId deviceId, OpenstackVtap.Type type, |
| 73 | PortNumber portNumber, int vni); |
| 74 | } |