blob: f2bc1a04d0c58fea13c22489df06025e28fd4c81 [file] [log] [blame]
tom8bb16062014-09-12 14:47:46 -07001package org.onlab.onos.net.flow;
2
3import org.onlab.onos.net.DeviceId;
4
tom8bb16062014-09-12 14:47:46 -07005/**
6 * Represents a generalized match & action pair to be applied to
7 * an infrastucture device.
8 */
9public interface FlowRule {
10
alshabib369d2942014-09-12 17:59:35 -070011 //TODO: build cookie value
Ayaka Koshibed4e53e12014-09-18 14:24:55 -070012 /**
13 * Returns the ID of this flow.
14 *
15 * @return the flow ID
16 */
17 FlowId id();
alshabib369d2942014-09-12 17:59:35 -070018
tom8bb16062014-09-12 14:47:46 -070019 /**
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 */
alshabib369d2942014-09-12 17:59:35 -070047 TrafficTreatment treatment();
tom8bb16062014-09-12 14:47:46 -070048
Ayaka Koshibed4e53e12014-09-18 14:24:55 -070049 /**
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
tom8bb16062014-09-12 14:47:46 -070077}