tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
| 3 | import org.onlab.onos.net.DeviceId; |
| 4 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 5 | /** |
| 6 | * Represents a generalized match & action pair to be applied to |
| 7 | * an infrastucture device. |
| 8 | */ |
| 9 | public interface FlowRule { |
| 10 | |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 11 | //TODO: build cookie value |
Ayaka Koshibe | d4e53e1 | 2014-09-18 14:24:55 -0700 | [diff] [blame] | 12 | /** |
| 13 | * Returns the ID of this flow. |
| 14 | * |
| 15 | * @return the flow ID |
| 16 | */ |
| 17 | FlowId id(); |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 18 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 19 | /** |
| 20 | * Returns the flow rule priority given in natural order; higher numbers |
| 21 | * mean higher priorities. |
| 22 | * |
| 23 | * @return flow rule priority |
| 24 | */ |
| 25 | int priority(); |
| 26 | |
| 27 | /** |
| 28 | * Returns the identity of the device where this rule applies. |
| 29 | * |
| 30 | * @return device identifier |
| 31 | */ |
| 32 | DeviceId deviceId(); |
| 33 | |
| 34 | /** |
| 35 | * Returns the traffic selector that identifies what traffic this |
| 36 | * rule should apply to. |
| 37 | * |
| 38 | * @return traffic selector |
| 39 | */ |
| 40 | TrafficSelector selector(); |
| 41 | |
| 42 | /** |
| 43 | * Returns the traffic treatment that applies to selected traffic. |
| 44 | * |
| 45 | * @return traffic treatment |
| 46 | */ |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 47 | TrafficTreatment treatment(); |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 48 | |
Ayaka Koshibe | d4e53e1 | 2014-09-18 14:24:55 -0700 | [diff] [blame] | 49 | /** |
| 50 | * Returns the number of milliseconds this flow rule has been applied. |
| 51 | * |
| 52 | * @return number of millis |
| 53 | */ |
| 54 | long lifeMillis(); |
| 55 | |
| 56 | /** |
| 57 | * Returns the number of milliseconds this flow rule has been idle. |
| 58 | * |
| 59 | * @return number of millis |
| 60 | */ |
| 61 | long idleMillis(); |
| 62 | |
| 63 | /** |
| 64 | * Returns the number of packets this flow rule has matched. |
| 65 | * |
| 66 | * @return number of packets |
| 67 | */ |
| 68 | long packets(); |
| 69 | |
| 70 | /** |
| 71 | * Returns the number of bytes this flow rule has matched. |
| 72 | * |
| 73 | * @return number of bytes |
| 74 | */ |
| 75 | long bytes(); |
| 76 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 77 | } |