Daniele Moro | 8d630f1 | 2021-06-15 20:53:22 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2021-present 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.pipelines.fabric.impl.behaviour.upf; |
| 18 | |
| 19 | import com.google.common.collect.Queues; |
| 20 | import org.onosproject.core.ApplicationId; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.flow.TrafficSelector; |
| 23 | import org.onosproject.net.packet.OutboundPacket; |
| 24 | import org.onosproject.net.packet.PacketPriority; |
| 25 | import org.onosproject.net.packet.PacketProcessor; |
| 26 | import org.onosproject.net.packet.PacketProcessorEntry; |
| 27 | import org.onosproject.net.packet.PacketRequest; |
| 28 | import org.onosproject.net.packet.PacketService; |
| 29 | |
| 30 | import java.util.List; |
| 31 | import java.util.Optional; |
| 32 | import java.util.Queue; |
| 33 | |
| 34 | public class MockPacketService implements PacketService { |
| 35 | |
| 36 | Queue<OutboundPacket> emittedPackets = Queues.newArrayDeque(); |
| 37 | |
| 38 | @Override |
| 39 | public void addProcessor(PacketProcessor processor, int priority) { |
| 40 | |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public void removeProcessor(PacketProcessor processor) { |
| 45 | |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public List<PacketProcessorEntry> getProcessors() { |
| 50 | return null; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public void requestPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId) { |
| 55 | |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public void requestPackets(TrafficSelector selector, PacketPriority priority, |
| 60 | ApplicationId appId, Optional<DeviceId> deviceId) { |
| 61 | |
| 62 | } |
| 63 | |
| 64 | @Override |
| 65 | public void cancelPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId) { |
| 66 | |
| 67 | } |
| 68 | |
| 69 | @Override |
| 70 | public void cancelPackets(TrafficSelector selector, PacketPriority priority, |
| 71 | ApplicationId appId, Optional<DeviceId> deviceId) { |
| 72 | |
| 73 | } |
| 74 | |
| 75 | @Override |
| 76 | public List<PacketRequest> getRequests() { |
| 77 | return null; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public void emit(OutboundPacket packet) { |
| 82 | emittedPackets.add(packet); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | |