blob: d2db536138b6cf0d6a3c6380accad727b5523904 [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 */
alshabib369d2942014-09-12 17:59:35 -070021 void addProcessor(PacketProcessor processor, int priority);
tom613d8142014-09-11 15:09:37 -070022
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}