alshabib | ca5706c | 2014-10-04 20:29:41 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
| 3 | |
| 4 | /** |
| 5 | * Represents a generalized match & action pair to be applied to |
| 6 | * an infrastucture device. |
| 7 | */ |
| 8 | public interface FlowEntry extends FlowRule { |
| 9 | |
| 10 | |
| 11 | public enum FlowEntryState { |
| 12 | |
| 13 | /** |
| 14 | * Indicates that this rule has been submitted for addition. |
| 15 | * Not necessarily in the flow table. |
| 16 | */ |
| 17 | PENDING_ADD, |
| 18 | |
| 19 | /** |
| 20 | * Rule has been added which means it is in the flow table. |
| 21 | */ |
| 22 | ADDED, |
| 23 | |
| 24 | /** |
| 25 | * Flow has been marked for removal, might still be in flow table. |
| 26 | */ |
| 27 | PENDING_REMOVE, |
| 28 | |
| 29 | /** |
| 30 | * Flow has been removed from flow table and can be purged. |
| 31 | */ |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 32 | REMOVED, |
| 33 | |
| 34 | /** |
| 35 | * Indicates that the installation of this flow has failed. |
| 36 | */ |
| 37 | FAILED |
alshabib | ca5706c | 2014-10-04 20:29:41 -0700 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Returns the flow entry state. |
| 42 | * |
| 43 | * @return flow entry state |
| 44 | */ |
| 45 | FlowEntryState state(); |
| 46 | |
| 47 | /** |
| 48 | * Returns the number of milliseconds this flow rule has been applied. |
| 49 | * |
| 50 | * @return number of millis |
| 51 | */ |
| 52 | long life(); |
| 53 | |
| 54 | /** |
| 55 | * Returns the number of packets this flow rule has matched. |
| 56 | * |
| 57 | * @return number of packets |
| 58 | */ |
| 59 | long packets(); |
| 60 | |
| 61 | /** |
| 62 | * Returns the number of bytes this flow rule has matched. |
| 63 | * |
| 64 | * @return number of bytes |
| 65 | */ |
| 66 | long bytes(); |
| 67 | |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame^] | 68 | // TODO: consider removing this attribute |
alshabib | ca5706c | 2014-10-04 20:29:41 -0700 | [diff] [blame] | 69 | /** |
| 70 | * When this flow entry was last deemed active. |
| 71 | * @return epoch time of last activity |
| 72 | */ |
| 73 | long lastSeen(); |
| 74 | |
| 75 | /** |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 76 | * Indicates the error type. |
| 77 | * @return an integer value of the error |
| 78 | */ |
| 79 | int errType(); |
| 80 | |
| 81 | /** |
| 82 | * Indicates the error code. |
| 83 | * @return an integer value of the error |
| 84 | */ |
| 85 | int errCode(); |
| 86 | |
alshabib | ca5706c | 2014-10-04 20:29:41 -0700 | [diff] [blame] | 87 | } |