tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.packet; |
| 2 | |
| 3 | /** |
| 4 | * Service for intercepting data plane packets and for emitting synthetic |
| 5 | * outbound packets. |
| 6 | */ |
| 7 | public interface PacketService { |
| 8 | |
| 9 | // TODO: ponder better ordering scheme that does not require absolute numbers |
| 10 | |
| 11 | /** |
| 12 | * Adds the specified processor to the list of packet processors. |
| 13 | * It will be added into the list in the order of priority. The higher |
| 14 | * numbers will be processing the packets after the lower numbers. |
| 15 | * |
| 16 | * @param processor processor to be added |
| 17 | * @param priority priority in the reverse natural order |
| 18 | * @throws java.lang.IllegalArgumentException if a processor with the |
| 19 | * given priority already exists |
| 20 | */ |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 21 | void addProcessor(PacketProcessor processor, int priority); |
tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Removes the specified processor from the processing pipeline. |
| 25 | * |
| 26 | * @param processor packet processor |
| 27 | */ |
| 28 | void removeProcessor(PacketProcessor processor); |
| 29 | |
| 30 | /** |
| 31 | * Emits the specified outbound packet onto the network. |
| 32 | * |
| 33 | * @param packet outbound packet |
| 34 | */ |
| 35 | void emit(OutboundPacket packet); |
| 36 | |
| 37 | } |