Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-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.kubevirtnetworking.api; |
| 17 | |
| 18 | import org.onosproject.core.ApplicationId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.flow.TrafficSelector; |
| 21 | import org.onosproject.net.flow.TrafficTreatment; |
| 22 | |
| 23 | /** |
| 24 | * Service for setting flow rules. |
| 25 | */ |
| 26 | public interface KubevirtFlowRuleService { |
| 27 | |
| 28 | /** |
| 29 | * Sets the flow rule. |
| 30 | * |
| 31 | * @param appId application ID |
| 32 | * @param deviceId device ID |
| 33 | * @param selector matches of the flow rule |
| 34 | * @param treatment actions of the flow rule |
| 35 | * @param priority priority of the flow rule |
| 36 | * @param tableType table number to put the flow rule |
| 37 | * @param install add the rule if true, remove it otherwise |
| 38 | */ |
| 39 | void setRule(ApplicationId appId, |
| 40 | DeviceId deviceId, |
| 41 | TrafficSelector selector, |
| 42 | TrafficTreatment treatment, |
| 43 | int priority, |
| 44 | int tableType, |
| 45 | boolean install); |
| 46 | |
| 47 | /** |
| 48 | * Install table miss entry (drop rule) in the table. |
| 49 | * |
| 50 | * @param deviceId device ID |
| 51 | * @param table table number |
| 52 | */ |
| 53 | void setUpTableMissEntry(DeviceId deviceId, int table); |
| 54 | |
| 55 | /** |
| 56 | * Install a flor rule for transition from table A to table B. |
| 57 | * |
| 58 | * @param deviceId device Id |
| 59 | * @param fromTable table number of table A |
| 60 | * @param toTable table number of table B |
| 61 | */ |
| 62 | void connectTables(DeviceId deviceId, int fromTable, int toTable); |
| 63 | } |