blob: 3633231f7c692ee992f0af304362855c6322affc [file] [log] [blame]
Jonathan Hart3cfce8e2015-01-14 16:43:27 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
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 */
Saurav Dasa432cf82018-10-11 15:29:24 -070033 REACTIVE(5),
34
35 /**
36 * Other choices for applications.
37 */
38 MAX(65535),
39 HIGH5(65000),
40 HIGH4(64000),
41 HIGH3(63000),
42 HIGH2(62000),
43 HIGH1(61000),
44 HIGH(60000),
45 MEDIUM(30000),
46 LOWEST(1);
Jonathan Hart3cfce8e2015-01-14 16:43:27 -080047
48 private final int priorityValue;
49
Sho SHIMIZUe2952e42015-09-11 17:11:21 -070050 PacketPriority(int priorityValue) {
Jonathan Hart3cfce8e2015-01-14 16:43:27 -080051 this.priorityValue = priorityValue;
52 }
53
54 /**
55 * Returns the integer value of the priority level.
56 *
57 * @return priority value
58 */
59 public int priorityValue() {
60 return priorityValue;
61 }
alshabib42947782015-03-31 14:59:06 -070062
Saurav Dasa432cf82018-10-11 15:29:24 -070063 @Override
alshabib42947782015-03-31 14:59:06 -070064 public String toString() {
65 return String.valueOf(priorityValue);
66 }
Sho SHIMIZUe2952e42015-09-11 17:11:21 -070067}