blob: 8c41a0490335ae53a356f2271d2fdea45bb78290 [file] [log] [blame]
alshabib55a55d92014-09-16 11:59:31 -07001package org.onlab.onos.net.flow.instructions;
tom8bb16062014-09-12 14:47:46 -07002
3/**
4 * Abstraction of a single traffic treatment step.
5 */
alshabib030111e2014-09-15 15:56:42 -07006public interface Instruction {
tom8bb16062014-09-12 14:47:46 -07007
alshabib498052f2014-09-16 13:54:38 -07008 interface SubType { }
alshabib7410fea2014-09-16 13:48:39 -07009
10 public enum NoneSubType implements SubType {
11 NONE;
12 }
13
tom8bb16062014-09-12 14:47:46 -070014 /**
15 * Represents the type of traffic treatment.
16 */
17 public enum Type {
18 /**
19 * Signifies that the traffic should be dropped.
20 */
21 DROP,
22
23 /**
24 * Signifies that the traffic should be output to a port.
25 */
26 OUTPUT,
27
28 /**
29 * Signifies that.... (do we need this?)
30 */
31 GROUP,
32
33 /**
34 * Signifies that the traffic should be modified in some way.
35 */
36 MODIFICATION
37 }
38
39 // TODO: Create factory class 'Instructions' that will have various factory
40 // to create specific instructions.
41
alshabib1d4cace2014-09-13 19:16:26 -070042 /**
alshabib89e43ef2014-09-16 10:36:34 -070043 * Returns the type of instruction.
alshabib1d4cace2014-09-13 19:16:26 -070044 * @return type of instruction
45 */
46 public Type type();
47
alshabib7410fea2014-09-16 13:48:39 -070048 /**
49 * Returns the subtype of the modification instruction.
50 * @return type of instruction
51 */
52 public SubType subtype();
53
tom8bb16062014-09-12 14:47:46 -070054}