yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame^] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.incubator.net.virtual; |
| 18 | |
| 19 | import org.onosproject.net.packet.OutboundPacket; |
| 20 | import org.onosproject.net.packet.PacketEvent; |
| 21 | import org.onosproject.net.packet.PacketRequest; |
| 22 | import org.onosproject.net.packet.PacketStoreDelegate; |
| 23 | |
| 24 | import java.util.List; |
| 25 | |
| 26 | public interface VirtualNetworkPacketStore |
| 27 | extends VirtualStore<PacketEvent, PacketStoreDelegate> { |
| 28 | /** |
| 29 | * Decides which instance should emit the packet and forwards the packet to |
| 30 | * that instance. The relevant PacketManager is notified via the |
| 31 | * PacketStoreDelegate that it should emit the packet. |
| 32 | * |
| 33 | * @param networkId a virtual network identifier |
| 34 | * @param packet the packet to emit |
| 35 | */ |
| 36 | void emit(NetworkId networkId, OutboundPacket packet); |
| 37 | |
| 38 | /** |
| 39 | * Requests intercept of packets that match the given selector. |
| 40 | * |
| 41 | * @param networkId a virtual network identifier |
| 42 | * @param request a packet request |
| 43 | */ |
| 44 | void requestPackets(NetworkId networkId, PacketRequest request); |
| 45 | |
| 46 | /** |
| 47 | * Cancels intercept of packets that match the given selector. |
| 48 | * |
| 49 | * @param networkId a virtual network identifier |
| 50 | * @param request a packet request |
| 51 | */ |
| 52 | void cancelPackets(NetworkId networkId, PacketRequest request); |
| 53 | |
| 54 | /** |
| 55 | * Obtains all existing requests in the system. |
| 56 | * |
| 57 | * @param networkId a virtual network identifier |
| 58 | * @return list of packet requests in order of priority |
| 59 | */ |
| 60 | List<PacketRequest> existingRequests(NetworkId networkId); |
| 61 | } |