Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.driver.pipeline; |
| 18 | |
| 19 | import org.onosproject.core.CoreService; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.behaviour.PipelinerContext; |
| 22 | import org.onosproject.net.device.DeviceService; |
| 23 | import org.onosproject.net.flow.FlowRule; |
| 24 | import org.onosproject.net.flow.FlowRuleService; |
| 25 | import org.onosproject.net.flowobjective.ForwardingObjective; |
| 26 | import org.onosproject.net.group.GroupService; |
| 27 | |
| 28 | import java.util.Collection; |
| 29 | |
| 30 | /** |
| 31 | * Driver for software switch emulation of the OFDPA 3.0 pipeline. |
| 32 | * The software switch is the CPqD OF 1.3 switch. Unfortunately the CPqD switch |
| 33 | * does not handle vlan tags and mpls labels simultaneously, which requires us |
| 34 | * to do some workarounds in the driver. This driver is meant for the use of |
| 35 | * the cpqd switch when MPLS is required. As a result this driver works only |
| 36 | * on incoming untagged packets. |
| 37 | */ |
| 38 | public class CpqdOfdpa3Pipeline extends CpqdOfdpa2Pipeline { |
| 39 | @Override |
| 40 | public void init(DeviceId deviceId, PipelinerContext context) { |
| 41 | this.deviceId = deviceId; |
| 42 | |
| 43 | // Initialize OFDPA group handler |
| 44 | groupHandler = new Ofdpa3GroupHandler(); |
| 45 | groupHandler.init(deviceId, context); |
| 46 | |
| 47 | serviceDirectory = context.directory(); |
| 48 | coreService = serviceDirectory.get(CoreService.class); |
| 49 | flowRuleService = serviceDirectory.get(FlowRuleService.class); |
| 50 | groupService = serviceDirectory.get(GroupService.class); |
| 51 | flowObjectiveStore = context.store(); |
| 52 | deviceService = serviceDirectory.get(DeviceService.class); |
| 53 | |
| 54 | driverId = coreService.registerApplication( |
| 55 | "org.onosproject.driver.CpqdOfdpa3Pipeline"); |
| 56 | |
| 57 | initializePipeline(); |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | protected Collection<FlowRule> processEthTypeSpecific(ForwardingObjective fwd) { |
Charles Chan | cad338a | 2016-09-16 18:03:11 -0700 | [diff] [blame] | 62 | return processEthTypeSpecificInternal(fwd, true, ACL_TABLE); |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 63 | } |
| 64 | } |