blob: 68c42e0916f2cac9564fc207a18d95a197d7101f [file] [log] [blame]
Charles Chanf9e98652016-09-07 16:54:23 -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.driver.pipeline;
18
19import org.onlab.packet.VlanId;
20import org.onosproject.core.ApplicationId;
21import org.onosproject.core.CoreService;
22import org.onosproject.net.DeviceId;
23import org.onosproject.net.behaviour.PipelinerContext;
24import org.onosproject.net.device.DeviceService;
25import org.onosproject.net.flow.FlowRule;
26import org.onosproject.net.flow.FlowRuleService;
27import org.onosproject.net.flow.criteria.PortCriterion;
28import org.onosproject.net.flow.criteria.VlanIdCriterion;
29import org.onosproject.net.flowobjective.ForwardingObjective;
30import org.onosproject.net.group.GroupService;
31
32import java.util.Collection;
33import java.util.List;
34
35/**
36 * Pipeliner for Broadcom OF-DPA 3.0 TTP.
37 */
38public 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) {
71 return processEthTypeSpecificInternal(fwd, true);
72 }
73}