blob: 9cf05d20af4f976a6312153f96b171119f0b6009 [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.onosproject.core.CoreService;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.behaviour.PipelinerContext;
22import org.onosproject.net.device.DeviceService;
23import org.onosproject.net.flow.FlowRule;
24import org.onosproject.net.flow.FlowRuleService;
25import org.onosproject.net.flowobjective.ForwardingObjective;
26import org.onosproject.net.group.GroupService;
27
28import 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 */
38public 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 Chancad338a2016-09-16 18:03:11 -070062 return processEthTypeSpecificInternal(fwd, true, ACL_TABLE);
Charles Chanf9e98652016-09-07 16:54:23 -070063 }
64}