blob: 37726baf4fa22a415796f280f5e850bca7b6627d [file] [log] [blame]
Jonathan Hart26a8d952015-12-02 15:16:35 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Jonathan Hart26a8d952015-12-02 15:16:35 -08003 *
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
17package org.onosproject.openflow.controller;
18
19import com.google.common.annotations.Beta;
Jian Lidab72562016-04-12 14:10:32 -070020import org.onosproject.codec.ExtensionSelectorCodec;
Jonathan Hart26a8d952015-12-02 15:16:35 -080021import org.onosproject.net.flow.criteria.ExtensionSelector;
22import org.onosproject.net.flow.criteria.ExtensionSelectorType;
23import org.projectfloodlight.openflow.protocol.OFFactory;
24import org.projectfloodlight.openflow.protocol.oxm.OFOxm;
25
26/**
27 * Interprets extension selectors and converts them to/from OpenFlow objects.
28 */
29@Beta
Jian Lidab72562016-04-12 14:10:32 -070030public interface ExtensionSelectorInterpreter extends ExtensionSelectorCodec {
Jonathan Hart26a8d952015-12-02 15:16:35 -080031
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 Chan14967c22015-12-07 11:11:50 -080046 * @return OpenFlow OXM
Jonathan Hart26a8d952015-12-02 15:16:35 -080047 */
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}