blob: c6c4f79cfbcd5bab08f71fcbb30baf731c152097 [file] [log] [blame]
Jonathan Hart4f60f982014-10-27 08:11:17 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Jonathan Hart4f60f982014-10-27 08:11:17 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.packet;
Jonathan Hart4f60f982014-10-27 08:11:17 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.store.Store;
Jonathan Hart4f60f982014-10-27 08:11:17 -070019
Thomas Vachuska7f171b22015-08-21 12:49:08 -070020import java.util.List;
alshabib42947782015-03-31 14:59:06 -070021
Jonathan Hart4f60f982014-10-27 08:11:17 -070022/**
23 * Manages routing of outbound packets.
24 */
25public interface PacketStore extends Store<PacketEvent, PacketStoreDelegate> {
26
27 /**
28 * Decides which instance should emit the packet and forwards the packet to
29 * that instance. The relevant PacketManager is notified via the
30 * PacketStoreDelegate that it should emit the packet.
31 *
32 * @param packet the packet to emit
33 */
34 void emit(OutboundPacket packet);
35
alshabib42947782015-03-31 14:59:06 -070036 /**
Thomas Vachuska27bee092015-06-23 19:03:10 -070037 * Requests intercept of packets that match the given selector.
alshabib42947782015-03-31 14:59:06 -070038 *
39 * @param request a packet request
alshabib42947782015-03-31 14:59:06 -070040 */
Brian O'Connor21b028e2015-10-08 22:50:02 -070041 void requestPackets(PacketRequest request);
alshabib42947782015-03-31 14:59:06 -070042
43 /**
Thomas Vachuska27bee092015-06-23 19:03:10 -070044 * Cancels intercept of packets that match the given selector.
45 *
46 * @param request a packet request
Thomas Vachuska27bee092015-06-23 19:03:10 -070047 */
Brian O'Connor21b028e2015-10-08 22:50:02 -070048 void cancelPackets(PacketRequest request);
Thomas Vachuska27bee092015-06-23 19:03:10 -070049
50 /**
alshabib42947782015-03-31 14:59:06 -070051 * Obtains all existing requests in the system.
52 *
Thomas Vachuska7f171b22015-08-21 12:49:08 -070053 * @return list of packet requests in order of priority
alshabib42947782015-03-31 14:59:06 -070054 */
Thomas Vachuska7f171b22015-08-21 12:49:08 -070055 List<PacketRequest> existingRequests();
alshabib42947782015-03-31 14:59:06 -070056
Jonathan Hart4f60f982014-10-27 08:11:17 -070057}