Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
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 | /** |
| 28 | * Signifies that the traffic should be dropped. |
| 29 | */ |
| 30 | DROP, |
| 31 | |
| 32 | /** |
| 33 | * Signifies that the traffic should be output to a port. |
| 34 | */ |
| 35 | OUTPUT, |
| 36 | |
| 37 | /** |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 38 | * Signifies that traffic should be sent out of a group. |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 39 | */ |
| 40 | GROUP, |
| 41 | |
| 42 | /** |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame^] | 43 | * Signifies that traffic should be metered according to a meter. |
| 44 | */ |
| 45 | METER, |
| 46 | |
| 47 | /** |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 48 | * Signifies that the traffic should be modified in L0 way. |
| 49 | */ |
| 50 | L0MODIFICATION, |
| 51 | |
| 52 | /** |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 53 | * Signifies that the traffic should be modified in L2 way. |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 54 | */ |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 55 | L2MODIFICATION, |
| 56 | |
| 57 | /** |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 58 | * Signifies that the traffic should be passed to another table. |
| 59 | */ |
| 60 | TABLE, |
| 61 | |
| 62 | /** |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 63 | * Signifies that the traffic should be modified in L3 way. |
| 64 | */ |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 65 | L3MODIFICATION, |
| 66 | |
| 67 | /** |
| 68 | * Signifies that metadata be attached to traffic. |
| 69 | */ |
Hyunsun Moon | 9fed528 | 2015-07-16 17:55:22 -0700 | [diff] [blame] | 70 | METADATA, |
| 71 | |
| 72 | /** |
| 73 | * Signifies that the traffic should be modified in L4 way. |
| 74 | */ |
| 75 | L4MODIFICATION |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 76 | } |
| 77 | |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 78 | /** |
alshabib | 89e43ef | 2014-09-16 10:36:34 -0700 | [diff] [blame] | 79 | * Returns the type of instruction. |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 80 | * @return type of instruction |
| 81 | */ |
Sho SHIMIZU | d150620 | 2015-05-05 10:43:08 -0700 | [diff] [blame] | 82 | Type type(); |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 83 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 84 | } |