Alex Yashchuk | 4caa8e8 | 2017-12-08 17:40:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Open Networking Foundation |
| 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.net.behaviour.PipelinerContext; |
| 20 | import org.onosproject.net.flow.FlowRule; |
| 21 | import org.onosproject.net.flowobjective.ForwardingObjective; |
| 22 | import org.onosproject.driver.pipeline.ofdpa.Ofdpa3Pipeline; |
| 23 | import java.util.Collection; |
| 24 | |
pier | 9469f3e | 2019-04-17 17:05:08 +0200 | [diff] [blame] | 25 | import static org.onosproject.driver.pipeline.ofdpa.OfdpaPipelineUtility.ACL_TABLE; |
| 26 | |
Alex Yashchuk | 4caa8e8 | 2017-12-08 17:40:05 +0200 | [diff] [blame] | 27 | public class XpliantPipeline extends Ofdpa3Pipeline { |
| 28 | |
| 29 | @Override |
| 30 | protected void initDriverId() { |
| 31 | driverId = coreService.registerApplication( |
| 32 | "org.onosproject.driver.XpliantPipeline"); |
| 33 | } |
| 34 | |
| 35 | @Override |
| 36 | protected void initGroupHander(PipelinerContext context) { |
pier | 9ada419 | 2020-03-20 11:00:38 +0100 | [diff] [blame] | 37 | // Terminate internal references |
| 38 | // We are terminating the references here |
| 39 | // because when the device is offline the apps |
| 40 | // are still sending flowobjectives |
| 41 | if (groupHandler != null) { |
| 42 | groupHandler.terminate(); |
| 43 | } |
Alex Yashchuk | 4caa8e8 | 2017-12-08 17:40:05 +0200 | [diff] [blame] | 44 | groupHandler = new XpliantGroupHandler(); |
| 45 | groupHandler.init(deviceId, context); |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | protected Collection<FlowRule> processEthTypeSpecific(ForwardingObjective fwd) { |
| 50 | return processEthTypeSpecificInternal(fwd, true, ACL_TABLE); |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public boolean requireMplsPop() { |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public boolean requireMplsBosMatch() { |
| 60 | return false; |
| 61 | } |
| 62 | |
| 63 | @Override |
| 64 | public boolean requireMplsTtlModification() { |
| 65 | return false; |
| 66 | } |
Harshada Chaundkar | 77958a5 | 2019-08-05 15:33:30 +0000 | [diff] [blame] | 67 | |
| 68 | @Override |
| 69 | protected boolean requireEthType() { |
| 70 | return false; |
| 71 | } |
Alex Yashchuk | 4caa8e8 | 2017-12-08 17:40:05 +0200 | [diff] [blame] | 72 | } |