blob: 410aed4783a057a01dcc31ccf4780e444206e9bc [file] [log] [blame]
tom8bb16062014-09-12 14:47:46 -07001package org.onlab.onos.net.flow;
2
alshabiba68eb962014-09-24 20:34:13 -07003import org.onlab.onos.ApplicationId;
tom8bb16062014-09-12 14:47:46 -07004import org.onlab.onos.net.DeviceId;
alshabib902d41b2014-10-07 16:52:05 -07005import org.onlab.onos.net.intent.BatchOperationTarget;
tom8bb16062014-09-12 14:47:46 -07006
tom8bb16062014-09-12 14:47:46 -07007/**
8 * Represents a generalized match & action pair to be applied to
9 * an infrastucture device.
10 */
alshabib902d41b2014-10-07 16:52:05 -070011public interface FlowRule extends BatchOperationTarget {
tom8bb16062014-09-12 14:47:46 -070012
alshabibba5ac482014-10-02 17:15:20 -070013 static final int MAX_TIMEOUT = 60;
alshabiba0e04982014-10-03 13:03:19 -070014 static final int MIN_PRIORITY = 0;
alshabiba7f7ca82014-09-22 11:41:23 -070015
alshabib369d2942014-09-12 17:59:35 -070016 //TODO: build cookie value
Ayaka Koshibed4e53e12014-09-18 14:24:55 -070017 /**
18 * Returns the ID of this flow.
19 *
20 * @return the flow ID
21 */
22 FlowId id();
alshabib369d2942014-09-12 17:59:35 -070023
tom8bb16062014-09-12 14:47:46 -070024 /**
alshabiba68eb962014-09-24 20:34:13 -070025 * Returns the application id of this flow.
26 *
27 * @return an applicationId
28 */
29 ApplicationId appId();
30
31 /**
tom8bb16062014-09-12 14:47:46 -070032 * Returns the flow rule priority given in natural order; higher numbers
33 * mean higher priorities.
34 *
35 * @return flow rule priority
36 */
37 int priority();
38
39 /**
40 * Returns the identity of the device where this rule applies.
41 *
42 * @return device identifier
43 */
44 DeviceId deviceId();
45
46 /**
47 * Returns the traffic selector that identifies what traffic this
48 * rule should apply to.
49 *
50 * @return traffic selector
51 */
52 TrafficSelector selector();
53
54 /**
55 * Returns the traffic treatment that applies to selected traffic.
56 *
57 * @return traffic treatment
58 */
alshabib369d2942014-09-12 17:59:35 -070059 TrafficTreatment treatment();
tom8bb16062014-09-12 14:47:46 -070060
Ayaka Koshibed4e53e12014-09-18 14:24:55 -070061 /**
alshabibba5ac482014-10-02 17:15:20 -070062 * Returns the timeout for this flow requested by an application.
63 * @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
tom8bb16062014-09-12 14:47:46 -070067}