tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 3 | import org.onlab.onos.ApplicationId; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 4 | import org.onlab.onos.net.DeviceId; |
| 5 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 6 | /** |
| 7 | * Represents a generalized match & action pair to be applied to |
| 8 | * an infrastucture device. |
| 9 | */ |
| 10 | public interface FlowRule { |
| 11 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 12 | static final int MAX_TIMEOUT = 60; |
alshabib | a0e0498 | 2014-10-03 13:03:19 -0700 | [diff] [blame] | 13 | static final int MIN_PRIORITY = 0; |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 14 | |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 15 | //TODO: build cookie value |
Ayaka Koshibe | d4e53e1 | 2014-09-18 14:24:55 -0700 | [diff] [blame] | 16 | /** |
| 17 | * Returns the ID of this flow. |
| 18 | * |
| 19 | * @return the flow ID |
| 20 | */ |
| 21 | FlowId id(); |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 22 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 23 | /** |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 24 | * Returns the application id of this flow. |
| 25 | * |
| 26 | * @return an applicationId |
| 27 | */ |
| 28 | ApplicationId appId(); |
| 29 | |
| 30 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 31 | * Returns the flow rule priority given in natural order; higher numbers |
| 32 | * mean higher priorities. |
| 33 | * |
| 34 | * @return flow rule priority |
| 35 | */ |
| 36 | int priority(); |
| 37 | |
| 38 | /** |
| 39 | * Returns the identity of the device where this rule applies. |
| 40 | * |
| 41 | * @return device identifier |
| 42 | */ |
| 43 | DeviceId deviceId(); |
| 44 | |
| 45 | /** |
| 46 | * Returns the traffic selector that identifies what traffic this |
| 47 | * rule should apply to. |
| 48 | * |
| 49 | * @return traffic selector |
| 50 | */ |
| 51 | TrafficSelector selector(); |
| 52 | |
| 53 | /** |
| 54 | * Returns the traffic treatment that applies to selected traffic. |
| 55 | * |
| 56 | * @return traffic treatment |
| 57 | */ |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 58 | TrafficTreatment treatment(); |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 59 | |
Ayaka Koshibe | d4e53e1 | 2014-09-18 14:24:55 -0700 | [diff] [blame] | 60 | /** |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 61 | * Returns the timeout for this flow requested by an application. |
| 62 | * @return integer value of the timeout |
alshabib | 6eb438a | 2014-10-01 16:39:37 -0700 | [diff] [blame] | 63 | */ |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 64 | int timeout(); |
alshabib | 6eb438a | 2014-10-01 16:39:37 -0700 | [diff] [blame] | 65 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 66 | } |