blob: 6ef46d1b0c94b913a3f2c6dc53aa37b323760438 [file] [log] [blame]
Carmelo Cascone0831efb2016-05-31 14:50:19 -07001/*
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
17package org.onosproject.drivers.bmv2;
18
19import org.onosproject.bmv2.api.runtime.Bmv2ExtensionTreatment;
20import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
21import org.onosproject.net.driver.AbstractHandlerBehaviour;
22import org.onosproject.net.flow.instructions.ExtensionTreatment;
23import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
24
25import static org.onosproject.net.flow.instructions.ExtensionTreatmentType.ExtensionTreatmentTypes.BMV2_ACTION;
26
27/**
28 * Implementation of the extension treatment resolver behavior for BMv2.
29 */
30public class Bmv2ExtensionTreatmentResolver extends AbstractHandlerBehaviour implements ExtensionTreatmentResolver {
31
32 @Override
33 public ExtensionTreatment getExtensionInstruction(ExtensionTreatmentType type) {
34 if (type.equals(BMV2_ACTION.type())) {
Carmelo Cascone0ec92f12016-06-17 14:41:40 -070035 return Bmv2ExtensionTreatment.empty();
Carmelo Cascone0831efb2016-05-31 14:50:19 -070036 }
37 return null;
38 }
39}