blob: 2d0b3a42cbdb0f406044160315b79951f90dedaf [file] [log] [blame]
Jonathan Hart3cfce8e2015-01-14 16:43:27 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Jonathan Hart3cfce8e2015-01-14 16:43:27 -08003 *
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 */
16package org.onosproject.net.packet;
17
18/**
19 * Priorities available to applications for requests for packets from the data
20 * plane.
21 */
22public enum PacketPriority {
23 /**
24 * High priority for control traffic. This will result in all traffic
25 * matching the selector being sent to the controller.
26 */
27 CONTROL(40000),
28
29 /**
30 * Low priority for reactive applications. Packets are only sent to the
31 * controller if they fail to match any of the rules installed in the switch.
32 */
33 REACTIVE(5);
34
35 private final int priorityValue;
36
Sho SHIMIZUe2952e42015-09-11 17:11:21 -070037 PacketPriority(int priorityValue) {
Jonathan Hart3cfce8e2015-01-14 16:43:27 -080038 this.priorityValue = priorityValue;
39 }
40
41 /**
42 * Returns the integer value of the priority level.
43 *
44 * @return priority value
45 */
46 public int priorityValue() {
47 return priorityValue;
48 }
alshabib42947782015-03-31 14:59:06 -070049
50 public String toString() {
51 return String.valueOf(priorityValue);
52 }
Sho SHIMIZUe2952e42015-09-11 17:11:21 -070053}