Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.packet; |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.store.Store; |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 19 | |
Thomas Vachuska | 7f171b2 | 2015-08-21 12:49:08 -0700 | [diff] [blame] | 20 | import java.util.List; |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 21 | |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 22 | /** |
| 23 | * Manages routing of outbound packets. |
| 24 | */ |
| 25 | public 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 | |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 36 | /** |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 37 | * Requests intercept of packets that match the given selector. |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 38 | * |
| 39 | * @param request a packet request |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 40 | */ |
Brian O'Connor | 21b028e | 2015-10-08 22:50:02 -0700 | [diff] [blame] | 41 | void requestPackets(PacketRequest request); |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 44 | * Cancels intercept of packets that match the given selector. |
| 45 | * |
| 46 | * @param request a packet request |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 47 | */ |
Brian O'Connor | 21b028e | 2015-10-08 22:50:02 -0700 | [diff] [blame] | 48 | void cancelPackets(PacketRequest request); |
Thomas Vachuska | 27bee09 | 2015-06-23 19:03:10 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 51 | * Obtains all existing requests in the system. |
| 52 | * |
Thomas Vachuska | 7f171b2 | 2015-08-21 12:49:08 -0700 | [diff] [blame] | 53 | * @return list of packet requests in order of priority |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 54 | */ |
Thomas Vachuska | 7f171b2 | 2015-08-21 12:49:08 -0700 | [diff] [blame] | 55 | List<PacketRequest> existingRequests(); |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 56 | |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 57 | } |