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.onlab.packet.VlanId; |
| 20 | import org.onosproject.core.ApplicationId; |
| 21 | import org.onosproject.core.CoreService; |
| 22 | import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.net.behaviour.PipelinerContext; |
| 24 | import org.onosproject.net.device.DeviceService; |
| 25 | import org.onosproject.net.flow.FlowRule; |
| 26 | import org.onosproject.net.flow.FlowRuleService; |
| 27 | import org.onosproject.net.flow.criteria.PortCriterion; |
| 28 | import org.onosproject.net.flow.criteria.VlanIdCriterion; |
| 29 | import org.onosproject.net.flowobjective.ForwardingObjective; |
| 30 | import org.onosproject.net.group.GroupService; |
| 31 | |
| 32 | import java.util.Collection; |
| 33 | import java.util.List; |
| 34 | |
| 35 | /** |
| 36 | * Pipeliner for Broadcom OF-DPA 3.0 TTP. |
| 37 | */ |
| 38 | public class Ofdpa3Pipeline extends Ofdpa2Pipeline { |
| 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.Ofdpa3Pipeline"); |
| 56 | |
| 57 | initializePipeline(); |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | protected List<FlowRule> processVlanIdFilter(PortCriterion portCriterion, |
| 62 | VlanIdCriterion vidCriterion, |
| 63 | VlanId assignedVlan, |
| 64 | ApplicationId applicationId) { |
| 65 | return processVlanIdFilterInternal(portCriterion, vidCriterion, assignedVlan, |
| 66 | applicationId, false); |
| 67 | } |
| 68 | |
| 69 | @Override |
| 70 | protected Collection<FlowRule> processEthTypeSpecific(ForwardingObjective fwd) { |
Charles Chan | cad338a | 2016-09-16 18:03:11 -0700 | [diff] [blame] | 71 | return processEthTypeSpecificInternal(fwd, true, MPLS_L3_TYPE); |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 72 | } |
| 73 | } |