Jonathan Hart | 3cfce8e | 2015-01-14 16:43:27 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Jonathan Hart | 3cfce8e | 2015-01-14 16:43:27 -0800 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.net.packet; |
| 17 | |
| 18 | /** |
| 19 | * Priorities available to applications for requests for packets from the data |
| 20 | * plane. |
| 21 | */ |
| 22 | public 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 Das | a432cf8 | 2018-10-11 15:29:24 -0700 | [diff] [blame] | 33 | 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 Hart | 3cfce8e | 2015-01-14 16:43:27 -0800 | [diff] [blame] | 47 | |
| 48 | private final int priorityValue; |
| 49 | |
Sho SHIMIZU | e2952e4 | 2015-09-11 17:11:21 -0700 | [diff] [blame] | 50 | PacketPriority(int priorityValue) { |
Jonathan Hart | 3cfce8e | 2015-01-14 16:43:27 -0800 | [diff] [blame] | 51 | 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 | } |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 62 | |
Saurav Das | a432cf8 | 2018-10-11 15:29:24 -0700 | [diff] [blame] | 63 | @Override |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 64 | public String toString() { |
| 65 | return String.valueOf(priorityValue); |
| 66 | } |
Sho SHIMIZU | e2952e4 | 2015-09-11 17:11:21 -0700 | [diff] [blame] | 67 | } |