blob: 3ac277d2fed3a2ddd96979ee753523191dd5fcf1 [file] [log] [blame]
tom8bb16062014-09-12 14:47:46 -07001package org.onlab.onos.net.flow;
2
3import org.onlab.onos.net.DeviceId;
alshabib902d41b2014-10-07 16:52:05 -07004import org.onlab.onos.net.intent.BatchOperationTarget;
tom8bb16062014-09-12 14:47:46 -07005
tom8bb16062014-09-12 14:47:46 -07006/**
7 * Represents a generalized match & action pair to be applied to
8 * an infrastucture device.
9 */
alshabib902d41b2014-10-07 16:52:05 -070010public interface FlowRule extends BatchOperationTarget {
tom8bb16062014-09-12 14:47:46 -070011
alshabibba5ac482014-10-02 17:15:20 -070012 static final int MAX_TIMEOUT = 60;
alshabiba0e04982014-10-03 13:03:19 -070013 static final int MIN_PRIORITY = 0;
alshabiba7f7ca82014-09-22 11:41:23 -070014
alshabib369d2942014-09-12 17:59:35 -070015 //TODO: build cookie value
Ayaka Koshibed4e53e12014-09-18 14:24:55 -070016 /**
17 * Returns the ID of this flow.
18 *
19 * @return the flow ID
20 */
21 FlowId id();
alshabib369d2942014-09-12 17:59:35 -070022
tom8bb16062014-09-12 14:47:46 -070023 /**
alshabiba68eb962014-09-24 20:34:13 -070024 * Returns the application id of this flow.
25 *
26 * @return an applicationId
27 */
alshabib92c65ad2014-10-08 21:56:05 -070028 short appId();
alshabiba68eb962014-09-24 20:34:13 -070029
30 /**
tom8bb16062014-09-12 14:47:46 -070031 * 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 */
alshabib369d2942014-09-12 17:59:35 -070058 TrafficTreatment treatment();
tom8bb16062014-09-12 14:47:46 -070059
Ayaka Koshibed4e53e12014-09-18 14:24:55 -070060 /**
alshabibba5ac482014-10-02 17:15:20 -070061 * Returns the timeout for this flow requested by an application.
Jonathan Hartbc4a7932014-10-21 11:46:00 -070062 *
alshabibba5ac482014-10-02 17:15:20 -070063 * @return integer value of the timeout
alshabib6eb438a2014-10-01 16:39:37 -070064 */
alshabibba5ac482014-10-02 17:15:20 -070065 int timeout();
alshabib6eb438a2014-10-01 16:39:37 -070066
Jonathan Hartbc4a7932014-10-21 11:46:00 -070067 /**
68 * Returns whether the flow is permanent i.e. does not time out.
69 *
70 * @return true if the flow is permanent, otherwise false
71 */
72 boolean isPermanent();
73
tom8bb16062014-09-12 14:47:46 -070074}