blob: 5debf1ba936e9e5ca6113e9c9cc0dd06228187ec [file] [log] [blame]
tom613d8142014-09-11 15:09:37 -07001package org.onlab.onos.net.packet;
2
3/**
4 * Service for intercepting data plane packets and for emitting synthetic
5 * outbound packets.
6 */
7public 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 */
21 void addProcessor(PacketProcessor processor, long priority);
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}