blob: 895c187b94a2f70c0910fa0c25293e550eb5df11 [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;
Charles Chanf9e98652016-09-07 16:54:23 -070021import org.onosproject.net.behaviour.PipelinerContext;
Charles Chanf9e98652016-09-07 16:54:23 -070022import org.onosproject.net.flow.FlowRule;
Charles Chanf9e98652016-09-07 16:54:23 -070023import org.onosproject.net.flow.criteria.PortCriterion;
24import org.onosproject.net.flow.criteria.VlanIdCriterion;
25import org.onosproject.net.flowobjective.ForwardingObjective;
Charles Chanf9e98652016-09-07 16:54:23 -070026
27import java.util.Collection;
28import java.util.List;
29
30/**
31 * Pipeliner for Broadcom OF-DPA 3.0 TTP.
32 */
33public class Ofdpa3Pipeline extends Ofdpa2Pipeline {
34 @Override
Charles Chan40132b32017-01-22 00:19:37 -080035 protected void initDriverId() {
Charles Chanf9e98652016-09-07 16:54:23 -070036 driverId = coreService.registerApplication(
37 "org.onosproject.driver.Ofdpa3Pipeline");
Charles Chan40132b32017-01-22 00:19:37 -080038 }
Charles Chanf9e98652016-09-07 16:54:23 -070039
Charles Chan40132b32017-01-22 00:19:37 -080040 @Override
41 protected void initGroupHander(PipelinerContext context) {
42 groupHandler = new Ofdpa3GroupHandler();
43 groupHandler.init(deviceId, context);
Charles Chanf9e98652016-09-07 16:54:23 -070044 }
45
46 @Override
47 protected List<FlowRule> processVlanIdFilter(PortCriterion portCriterion,
48 VlanIdCriterion vidCriterion,
49 VlanId assignedVlan,
50 ApplicationId applicationId) {
51 return processVlanIdFilterInternal(portCriterion, vidCriterion, assignedVlan,
52 applicationId, false);
53 }
54
55 @Override
56 protected Collection<FlowRule> processEthTypeSpecific(ForwardingObjective fwd) {
Pier Ventre140a8942016-11-02 07:26:38 -070057 if (isNotMplsBos(fwd.selector())) {
58 return processEthTypeSpecificInternal(fwd, true, MPLS_TYPE_TABLE);
59 }
60 return processEthTypeSpecificInternal(fwd, true, MPLS_L3_TYPE_TABLE);
Charles Chanf9e98652016-09-07 16:54:23 -070061 }
62}