sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 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.openstacknetworking.api; |
| 17 | |
| 18 | |
sangho | dc37537 | 2017-06-08 10:41:30 +0900 | [diff] [blame] | 19 | import org.onosproject.core.ApplicationId; |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 20 | import org.onosproject.net.DeviceId; |
sangho | dc37537 | 2017-06-08 10:41:30 +0900 | [diff] [blame] | 21 | import org.onosproject.net.flow.TrafficSelector; |
| 22 | import org.onosproject.net.flow.TrafficTreatment; |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Service for setting flow rules. |
| 26 | * |
| 27 | */ |
| 28 | public interface OpenstackFlowRuleService { |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 29 | /** |
sangho | dc37537 | 2017-06-08 10:41:30 +0900 | [diff] [blame] | 30 | * Sets the flow rule. |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 31 | * |
sangho | dc37537 | 2017-06-08 10:41:30 +0900 | [diff] [blame] | 32 | * @param appId application ID |
| 33 | * @param deviceId device ID |
| 34 | * @param selector matches of the flow rule |
| 35 | * @param treatment actions of the flow rule |
| 36 | * @param priority priority of the flow rule |
| 37 | * @param tableType table number to put the flow rule |
| 38 | * @param install add the rule if true, remove it otherwise |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 39 | */ |
sangho | dc37537 | 2017-06-08 10:41:30 +0900 | [diff] [blame] | 40 | void setRule(ApplicationId appId, |
| 41 | DeviceId deviceId, |
| 42 | TrafficSelector selector, |
| 43 | TrafficTreatment treatment, |
| 44 | int priority, |
| 45 | int tableType, |
| 46 | boolean install); |
sangho | 3dd2a8b | 2017-07-19 15:54:31 +0900 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Install table miss entry (drop rule) in the table. |
| 50 | * |
| 51 | * @param deviceId device ID |
| 52 | * @param table table number |
| 53 | */ |
| 54 | void setUpTableMissEntry(DeviceId deviceId, int table); |
| 55 | |
| 56 | /** |
| 57 | * Install a flor rule for transition from table A to table B. |
| 58 | * |
| 59 | * @param deviceId device Id |
| 60 | * @param fromTable table number of table A |
| 61 | * @param toTable table number of table B |
| 62 | */ |
| 63 | void connectTables(DeviceId deviceId, int fromTable, int toTable); |
sangho | dbee233 | 2017-05-18 09:59:16 +0900 | [diff] [blame] | 64 | } |