blob: 721cb46dab3ffd35d81488054c1e74d471e03c60 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
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 */
tom613d8142014-09-11 15:09:37 -070016package org.onlab.onos.net.packet;
17
18/**
19 * Service for intercepting data plane packets and for emitting synthetic
20 * outbound packets.
21 */
22public interface PacketService {
23
24 // TODO: ponder better ordering scheme that does not require absolute numbers
25
26 /**
27 * Adds the specified processor to the list of packet processors.
28 * It will be added into the list in the order of priority. The higher
29 * numbers will be processing the packets after the lower numbers.
30 *
31 * @param processor processor to be added
32 * @param priority priority in the reverse natural order
33 * @throws java.lang.IllegalArgumentException if a processor with the
34 * given priority already exists
35 */
alshabib369d2942014-09-12 17:59:35 -070036 void addProcessor(PacketProcessor processor, int priority);
tom613d8142014-09-11 15:09:37 -070037
38 /**
39 * Removes the specified processor from the processing pipeline.
40 *
41 * @param processor packet processor
42 */
43 void removeProcessor(PacketProcessor processor);
44
45 /**
46 * Emits the specified outbound packet onto the network.
47 *
48 * @param packet outbound packet
49 */
50 void emit(OutboundPacket packet);
51
52}