blob: 320424b64eb933d22f54a36e672d9555adf3cba4 [file] [log] [blame]
yoonseon322c9c32016-12-07 16:47:02 -08001/*
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.incubator.net.virtual;
18
19import org.onosproject.net.packet.OutboundPacket;
20import org.onosproject.net.packet.PacketEvent;
21import org.onosproject.net.packet.PacketRequest;
22import org.onosproject.net.packet.PacketStoreDelegate;
23
24import java.util.List;
25
26public 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}