Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [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 | |
| 17 | package org.onosproject.openflow.controller; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
Andrea Campanella | 2cfe8ef | 2017-07-13 19:45:15 +0200 | [diff] [blame] | 20 | import org.onosproject.net.flow.ExtensionSelectorCodec; |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 21 | import org.onosproject.net.flow.criteria.ExtensionSelector; |
| 22 | import org.onosproject.net.flow.criteria.ExtensionSelectorType; |
| 23 | import org.projectfloodlight.openflow.protocol.OFFactory; |
| 24 | import org.projectfloodlight.openflow.protocol.oxm.OFOxm; |
| 25 | |
| 26 | /** |
| 27 | * Interprets extension selectors and converts them to/from OpenFlow objects. |
| 28 | */ |
| 29 | @Beta |
Jian Li | dab7256 | 2016-04-12 14:10:32 -0700 | [diff] [blame] | 30 | public interface ExtensionSelectorInterpreter extends ExtensionSelectorCodec { |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Returns true if the given extension selector is supported by this |
| 34 | * driver. |
| 35 | * |
| 36 | * @param extensionSelectorType extension selector type |
| 37 | * @return true if the instruction is supported, otherwise false |
| 38 | */ |
| 39 | boolean supported(ExtensionSelectorType extensionSelectorType); |
| 40 | |
| 41 | /** |
| 42 | * Maps an extension selector to an OpenFlow OXM. |
| 43 | * |
| 44 | * @param factory OpenFlow factory |
| 45 | * @param extensionSelector extension selector |
Charles Chan | 14967c2 | 2015-12-07 11:11:50 -0800 | [diff] [blame] | 46 | * @return OpenFlow OXM |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 47 | */ |
| 48 | OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector); |
| 49 | |
| 50 | /** |
| 51 | * Maps an OpenFlow OXM to an extension selector. |
| 52 | * |
| 53 | * @param oxm OpenFlow OXM |
| 54 | * @return extension selector |
| 55 | */ |
| 56 | ExtensionSelector mapOxm(OFOxm<?> oxm); |
| 57 | } |