Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.flow.instructions; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 17 | |
| 18 | /** |
| 19 | * Abstraction of a single traffic treatment step. |
| 20 | */ |
alshabib | 030111e | 2014-09-15 15:56:42 -0700 | [diff] [blame] | 21 | public interface Instruction { |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Represents the type of traffic treatment. |
| 25 | */ |
Sho SHIMIZU | d150620 | 2015-05-05 10:43:08 -0700 | [diff] [blame] | 26 | enum Type { |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 27 | /** |
Charles Chan | 7efabeb | 2015-09-28 15:12:19 -0700 | [diff] [blame] | 28 | * Signifies that the traffic requires no action. |
| 29 | * |
| 30 | * In OF10, the behavior of NOACTION is DROP. |
| 31 | * In OF13, the behavior depends on current Action Set. |
| 32 | */ |
| 33 | NOACTION, |
| 34 | |
| 35 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 36 | * Signifies that the traffic should be output to a port. |
| 37 | */ |
| 38 | OUTPUT, |
| 39 | |
| 40 | /** |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 41 | * Signifies that traffic should be sent out of a group. |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 42 | */ |
| 43 | GROUP, |
| 44 | |
| 45 | /** |
Steffen Gebert | bbfdaaa | 2015-09-29 11:01:46 +0200 | [diff] [blame] | 46 | * Signifies that the traffic should be enqueued to an already-configured |
| 47 | queue on a port. |
| 48 | */ |
| 49 | QUEUE, |
| 50 | |
| 51 | /** |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 52 | * Signifies that traffic should be metered according to a meter. |
| 53 | */ |
| 54 | METER, |
| 55 | |
| 56 | /** |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 57 | * Signifies that the traffic should be modified in L0 way. |
| 58 | */ |
| 59 | L0MODIFICATION, |
| 60 | |
| 61 | /** |
Yafit Hadar | 52d8155 | 2015-10-07 12:26:52 +0300 | [diff] [blame] | 62 | * Signifies that the traffic should be modified in L1 way. |
| 63 | */ |
| 64 | L1MODIFICATION, |
| 65 | |
| 66 | /** |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 67 | * Signifies that the traffic should be modified in L2 way. |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 68 | */ |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 69 | L2MODIFICATION, |
| 70 | |
| 71 | /** |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 72 | * Signifies that the traffic should be passed to another table. |
| 73 | */ |
| 74 | TABLE, |
| 75 | |
| 76 | /** |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 77 | * Signifies that the traffic should be modified in L3 way. |
| 78 | */ |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 79 | L3MODIFICATION, |
| 80 | |
| 81 | /** |
| 82 | * Signifies that metadata be attached to traffic. |
| 83 | */ |
Hyunsun Moon | 9fed528 | 2015-07-16 17:55:22 -0700 | [diff] [blame] | 84 | METADATA, |
| 85 | |
| 86 | /** |
| 87 | * Signifies that the traffic should be modified in L4 way. |
| 88 | */ |
Jonathan Hart | 3c25916 | 2015-10-21 21:31:19 -0700 | [diff] [blame] | 89 | L4MODIFICATION, |
| 90 | |
| 91 | /** |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 92 | * Signifies that a protocol-independent instruction will be used. |
| 93 | */ |
| 94 | PROTOCOL_INDEPENDENT, |
| 95 | |
| 96 | /** |
Jonathan Hart | 3c25916 | 2015-10-21 21:31:19 -0700 | [diff] [blame] | 97 | * Signifies that an extension instruction will be used. |
| 98 | */ |
Cem Türker | 3baff67 | 2017-10-12 15:09:01 +0300 | [diff] [blame] | 99 | EXTENSION, |
| 100 | |
| 101 | /** |
| 102 | * Signifies that statistics will be triggered. |
| 103 | */ |
| 104 | STAT_TRIGGER |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 105 | } |
| 106 | |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 107 | /** |
alshabib | 89e43ef | 2014-09-16 10:36:34 -0700 | [diff] [blame] | 108 | * Returns the type of instruction. |
Yafit Hadar | 52d8155 | 2015-10-07 12:26:52 +0300 | [diff] [blame] | 109 | * |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 110 | * @return type of instruction |
| 111 | */ |
Sho SHIMIZU | d150620 | 2015-05-05 10:43:08 -0700 | [diff] [blame] | 112 | Type type(); |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 113 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 114 | } |