blob: cdccaa95e1f23ab0e14f9c871f899ac1c286063a [file] [log] [blame]
alshabibca5706c2014-10-04 20:29:41 -07001package org.onlab.onos.net.flow;
2
3
4/**
5 * Represents a generalized match & action pair to be applied to
6 * an infrastucture device.
7 */
8public 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 */
alshabib193525b2014-10-08 18:58:03 -070032 REMOVED,
33
34 /**
35 * Indicates that the installation of this flow has failed.
36 */
37 FAILED
alshabibca5706c2014-10-04 20:29:41 -070038 }
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 HIGUCHIf6f50a62014-10-19 15:58:49 -070068 // TODO: consider removing this attribute
alshabibca5706c2014-10-04 20:29:41 -070069 /**
70 * When this flow entry was last deemed active.
71 * @return epoch time of last activity
72 */
73 long lastSeen();
74
75 /**
alshabib193525b2014-10-08 18:58:03 -070076 * 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
alshabibca5706c2014-10-04 20:29:41 -070087}