alshabib

some interface changes to flow and packet

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