2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onosproject.openflow.controller;
19 import com.google.common.annotations.Beta;
20 import org.onosproject.net.driver.HandlerBehaviour;
21 import org.onosproject.net.flow.instructions.ExtensionTreatment;
22 import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
23 import org.projectfloodlight.openflow.protocol.OFFactory;
24 import org.projectfloodlight.openflow.protocol.action.OFAction;
27 * Interprets extension instructions and converts them to/from OpenFlow objects.
30 public interface ExtensionTreatmentInterpreter extends HandlerBehaviour {
33 * Returns true if the given extension instruction is supported by this
36 * @param extensionTreatmentType extension instruction type
37 * @return true if the instruction is supported, otherwise false
39 boolean supported(ExtensionTreatmentType extensionTreatmentType);
42 * Maps an extension instruction to an OpenFlow action.
44 * @param factory OpenFlow factory
45 * @param extensionTreatment extension instruction
46 * @return OpenFlow action
48 OFAction mapInstruction(OFFactory factory, ExtensionTreatment extensionTreatment);
51 * Maps an OpenFlow action to an extension instruction.
53 * @param action OpenFlow action
54 * @return extension instruction
56 ExtensionTreatment mapAction(OFAction action);