Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 19 | package org.onlab.onos.net.flow.instructions; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * Abstraction of a single traffic treatment step. |
| 23 | */ |
alshabib | 030111e | 2014-09-15 15:56:42 -0700 | [diff] [blame] | 24 | public interface Instruction { |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Represents the type of traffic treatment. |
| 28 | */ |
| 29 | public enum Type { |
| 30 | /** |
| 31 | * Signifies that the traffic should be dropped. |
| 32 | */ |
| 33 | DROP, |
| 34 | |
| 35 | /** |
| 36 | * Signifies that the traffic should be output to a port. |
| 37 | */ |
| 38 | OUTPUT, |
| 39 | |
| 40 | /** |
| 41 | * Signifies that.... (do we need this?) |
| 42 | */ |
| 43 | GROUP, |
| 44 | |
| 45 | /** |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 46 | * Signifies that the traffic should be modified in L0 way. |
| 47 | */ |
| 48 | L0MODIFICATION, |
| 49 | |
| 50 | /** |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 51 | * Signifies that the traffic should be modified in L2 way. |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 52 | */ |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 53 | L2MODIFICATION, |
| 54 | |
| 55 | /** |
| 56 | * Signifies that the traffic should be modified in L3 way. |
| 57 | */ |
| 58 | L3MODIFICATION |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | // TODO: Create factory class 'Instructions' that will have various factory |
| 62 | // to create specific instructions. |
| 63 | |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 64 | /** |
alshabib | 89e43ef | 2014-09-16 10:36:34 -0700 | [diff] [blame] | 65 | * Returns the type of instruction. |
alshabib | 1d4cace | 2014-09-13 19:16:26 -0700 | [diff] [blame] | 66 | * @return type of instruction |
| 67 | */ |
| 68 | public Type type(); |
| 69 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 70 | } |