Carmelo Cascone | 17fc9e4 | 2016-05-31 11:29:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present 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 | |
| 17 | package org.onosproject.bmv2.api.service; |
| 18 | |
| 19 | |
| 20 | import org.onosproject.bmv2.api.context.Bmv2FlowRuleTranslator; |
| 21 | import org.onosproject.bmv2.api.runtime.Bmv2FlowRuleWrapper; |
Carmelo Cascone | 17fc9e4 | 2016-05-31 11:29:21 -0700 | [diff] [blame] | 22 | import org.onosproject.bmv2.api.runtime.Bmv2TableEntryReference; |
Carmelo Cascone | 17fc9e4 | 2016-05-31 11:29:21 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * A service for managing BMv2 table entries. |
| 26 | */ |
| 27 | public interface Bmv2TableEntryService { |
| 28 | |
| 29 | /** |
| 30 | * Returns a flow rule translator. |
| 31 | * |
| 32 | * @return a flow rule translator |
| 33 | */ |
| 34 | Bmv2FlowRuleTranslator getFlowRuleTranslator(); |
| 35 | |
| 36 | /** |
Carmelo Cascone | 17fc9e4 | 2016-05-31 11:29:21 -0700 | [diff] [blame] | 37 | * Binds the given ONOS flow rule with a BMv2 table entry reference. |
| 38 | * |
| 39 | * @param entryRef a table entry reference |
| 40 | * @param rule a BMv2 flow rule wrapper |
| 41 | */ |
| 42 | void bindEntryReference(Bmv2TableEntryReference entryRef, Bmv2FlowRuleWrapper rule); |
| 43 | |
| 44 | /** |
| 45 | * Returns the ONOS flow rule associated with the given BMv2 table entry reference, or null if there's no such a |
| 46 | * mapping. |
| 47 | * |
| 48 | * @param entryRef a table entry reference |
| 49 | * @return a BMv2 flow rule wrapper |
| 50 | */ |
| 51 | Bmv2FlowRuleWrapper lookupEntryReference(Bmv2TableEntryReference entryRef); |
| 52 | |
| 53 | /** |
| 54 | * Removes any flow rule previously bound with a given BMv2 table entry reference. |
| 55 | * |
| 56 | * @param entryRef a table entry reference |
| 57 | */ |
| 58 | void unbindEntryReference(Bmv2TableEntryReference entryRef); |
| 59 | } |