alshabib

some interface changes to flow and packet

...@@ -20,6 +20,18 @@ public final class Criteria { ...@@ -20,6 +20,18 @@ public final class Criteria {
20 return null; 20 return null;
21 } 21 }
22 22
23 + /**
24 + * Creates a match on ETH_DST field using the specified value. This value
25 + * may be a wildcard mask.
26 + *
27 + * @param macValue MAC address value or wildcard mask
28 + * @return match criterion
29 + */
30 + public static Criterion matchEthDst(MACValue macValue) {
31 + return null;
32 + }
33 +
34 +
23 // Dummy to illustrate the concept for now; delete ASAP 35 // Dummy to illustrate the concept for now; delete ASAP
24 private static class MACValue { } 36 private static class MACValue { }
25 } 37 }
......
...@@ -2,14 +2,14 @@ package org.onlab.onos.net.flow; ...@@ -2,14 +2,14 @@ package org.onlab.onos.net.flow;
2 2
3 import org.onlab.onos.net.DeviceId; 3 import org.onlab.onos.net.DeviceId;
4 4
5 -import java.util.List;
6 -
7 /** 5 /**
8 * Represents a generalized match & action pair to be applied to 6 * Represents a generalized match & action pair to be applied to
9 * an infrastucture device. 7 * an infrastucture device.
10 */ 8 */
11 public interface FlowRule { 9 public interface FlowRule {
12 10
11 + //TODO: build cookie value
12 +
13 /** 13 /**
14 * Returns the flow rule priority given in natural order; higher numbers 14 * Returns the flow rule priority given in natural order; higher numbers
15 * mean higher priorities. 15 * mean higher priorities.
...@@ -38,6 +38,6 @@ public interface FlowRule { ...@@ -38,6 +38,6 @@ public interface FlowRule {
38 * 38 *
39 * @return traffic treatment 39 * @return traffic treatment
40 */ 40 */
41 - List<Treatment> treatments(); 41 + TrafficTreatment treatment();
42 42
43 } 43 }
......
...@@ -22,4 +22,11 @@ public interface FlowRuleProviderService extends ProviderService<FlowRuleProvide ...@@ -22,4 +22,11 @@ public interface FlowRuleProviderService extends ProviderService<FlowRuleProvide
22 */ 22 */
23 void flowMissing(FlowRule flowRule); 23 void flowMissing(FlowRule flowRule);
24 24
25 + /**
26 + * Signals that a flow rule was indeed added.
27 + *
28 + * @param flowRule the added flow rule
29 + */
30 + void flowAdded(FlowRule flowRule);
31 +
25 } 32 }
......
...@@ -26,6 +26,15 @@ public interface FlowRuleService { ...@@ -26,6 +26,15 @@ public interface FlowRuleService {
26 void applyFlowRules(FlowRule... flowRules); 26 void applyFlowRules(FlowRule... flowRules);
27 27
28 /** 28 /**
29 + * Removes the specified flow rules from their respective devices.
30 + *
31 + * @param flowRules one or more flow rules
32 + * throws SomeKindOfException that indicates which ones were removed and
33 + * which ones failed
34 + */
35 + void removeFlowRules(FlowRule... flowRules);
36 +
37 + /**
29 * Adds the specified flow rule listener. 38 * Adds the specified flow rule listener.
30 * 39 *
31 * @param listener flow rule listener 40 * @param listener flow rule listener
......
...@@ -24,8 +24,9 @@ public interface TrafficSelector { ...@@ -24,8 +24,9 @@ public interface TrafficSelector {
24 * already been added, it will be replaced by this one. 24 * already been added, it will be replaced by this one.
25 * 25 *
26 * @param criterion new criterion 26 * @param criterion new criterion
27 + * @return self
27 */ 28 */
28 - void add(Criterion criterion); 29 + Builder add(Criterion criterion);
29 30
30 /** 31 /**
31 * Builds an immutable traffic selector. 32 * Builds an immutable traffic selector.
......
...@@ -25,7 +25,7 @@ public interface TrafficTreatment { ...@@ -25,7 +25,7 @@ public interface TrafficTreatment {
25 * 25 *
26 * @param instruction new instruction 26 * @param instruction new instruction
27 */ 27 */
28 - void add(Instruction instruction); 28 + Builder add(Instruction instruction);
29 29
30 /** 30 /**
31 * Builds an immutable traffic treatment descriptor. 31 * Builds an immutable traffic treatment descriptor.
......
1 package org.onlab.onos.net.packet; 1 package org.onlab.onos.net.packet;
2 2
3 +
3 /** 4 /**
4 * Abstraction of an inbound packet processor. 5 * Abstraction of an inbound packet processor.
5 */ 6 */
6 public interface PacketProcessor { 7 public interface PacketProcessor {
7 8
9 + public static final int ADVISOR_MAX = Integer.MAX_VALUE / 3;
10 + public static final int DIRECTOR_MAX = (Integer.MAX_VALUE / 3) * 2;
11 + public static final int OBSERVER_MAX = Integer.MAX_VALUE;
12 +
8 /** 13 /**
9 * Processes the inbound packet as specified in the given context. 14 * Processes the inbound packet as specified in the given context.
10 * 15 *
......
1 package org.onlab.onos.net.packet; 1 package org.onlab.onos.net.packet;
2 2
3 +import org.onlab.onos.net.provider.Provider;
4 +
3 /** 5 /**
4 * Abstraction of a packet provider capable of emitting packets. 6 * Abstraction of a packet provider capable of emitting packets.
5 */ 7 */
6 -public interface PacketProvider { 8 +public interface PacketProvider extends Provider{
7 9
8 /** 10 /**
9 * Emits the specified outbound packet onto the network. 11 * Emits the specified outbound packet onto the network.
......
1 +package org.onlab.onos.net.packet;
2 +
3 +import org.onlab.onos.net.provider.ProviderRegistry;
4 +
5 +/**
6 + * Abstraction of an infrastructure packet provider registry.
7 + */
8 +public interface PacketProviderRegistry
9 +extends ProviderRegistry<PacketProvider, PacketProviderService> {
10 +}
1 package org.onlab.onos.net.packet; 1 package org.onlab.onos.net.packet;
2 2
3 +import org.onlab.onos.net.provider.ProviderService;
4 +
3 /** 5 /**
4 * Entity capable of processing inbound packets. 6 * Entity capable of processing inbound packets.
5 */ 7 */
6 -public interface PacketProviderService { 8 +public interface PacketProviderService extends ProviderService<PacketProvider>{
7 9
8 /** 10 /**
9 * Submits inbound packet context for processing. This processing will be 11 * Submits inbound packet context for processing. This processing will be
......
...@@ -18,7 +18,7 @@ public interface PacketService { ...@@ -18,7 +18,7 @@ public interface PacketService {
18 * @throws java.lang.IllegalArgumentException if a processor with the 18 * @throws java.lang.IllegalArgumentException if a processor with the
19 * given priority already exists 19 * given priority already exists
20 */ 20 */
21 - void addProcessor(PacketProcessor processor, long priority); 21 + void addProcessor(PacketProcessor processor, int priority);
22 22
23 /** 23 /**
24 * Removes the specified processor from the processing pipeline. 24 * Removes the specified processor from the processing pipeline.
......