blob: 88a5353d93c29060d9118534cca8081940d3f67b [file] [log] [blame]
Jonathan Hart3c259162015-10-21 21:31:19 -07001/*
2 * Copyright 2015 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
17package org.onosproject.openflow.controller;
18
19import com.google.common.annotations.Beta;
20import org.onosproject.net.driver.HandlerBehaviour;
alshabib880b6442015-11-23 22:13:04 -080021import org.onosproject.net.flow.instructions.ExtensionTreatment;
22import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
Jonathan Hart3c259162015-10-21 21:31:19 -070023import org.projectfloodlight.openflow.protocol.OFFactory;
24import org.projectfloodlight.openflow.protocol.action.OFAction;
25
26/**
Jonathan Hart010527b2015-12-02 16:11:53 -080027 * Interprets extension treatments and converts them to/from OpenFlow objects.
Jonathan Hart3c259162015-10-21 21:31:19 -070028 */
29@Beta
alshabib880b6442015-11-23 22:13:04 -080030public interface ExtensionTreatmentInterpreter extends HandlerBehaviour {
Jonathan Hart3c259162015-10-21 21:31:19 -070031
32 /**
Jonathan Hart010527b2015-12-02 16:11:53 -080033 * Returns true if the given extension treatment is supported by this
Jonathan Hart3c259162015-10-21 21:31:19 -070034 * driver.
35 *
Jonathan Hart010527b2015-12-02 16:11:53 -080036 * @param extensionTreatmentType extension treatment type
37 * @return true if the extension is supported, otherwise false
Jonathan Hart3c259162015-10-21 21:31:19 -070038 */
alshabib880b6442015-11-23 22:13:04 -080039 boolean supported(ExtensionTreatmentType extensionTreatmentType);
Jonathan Hart3c259162015-10-21 21:31:19 -070040
41 /**
Jonathan Hart010527b2015-12-02 16:11:53 -080042 * Maps an extension treatment to an OpenFlow action.
Jonathan Hart3c259162015-10-21 21:31:19 -070043 *
44 * @param factory OpenFlow factory
Jonathan Hart010527b2015-12-02 16:11:53 -080045 * @param extensionTreatment extension treatment
Jonathan Hart3c259162015-10-21 21:31:19 -070046 * @return OpenFlow action
47 */
alshabib880b6442015-11-23 22:13:04 -080048 OFAction mapInstruction(OFFactory factory, ExtensionTreatment extensionTreatment);
Jonathan Hart3c259162015-10-21 21:31:19 -070049
50 /**
Jonathan Hart010527b2015-12-02 16:11:53 -080051 * Maps an OpenFlow action to an extension treatment.
Jonathan Hart3c259162015-10-21 21:31:19 -070052 *
53 * @param action OpenFlow action
Jonathan Hart010527b2015-12-02 16:11:53 -080054 * @return extension treatment
Jonathan Hart3c259162015-10-21 21:31:19 -070055 */
alshabib880b6442015-11-23 22:13:04 -080056 ExtensionTreatment mapAction(OFAction action);
Jonathan Hart3c259162015-10-21 21:31:19 -070057
58}