Couple of changes for the BGP Router project:
1. Link Discovery can be turned off completely via configuration
2. PacketService allows applications to hint at table_type when registering for packets
Change-Id: I89f0bbf84dce1b449db5af19868f83503c44f750
diff --git a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
index 6e97c8f..1bc918c 100644
--- a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
+++ b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
@@ -88,12 +88,14 @@
private final TrafficSelector selector;
private final PacketPriority priority;
private final ApplicationId appId;
+ private final FlowRule.Type tableType;
public PacketRequest(TrafficSelector selector, PacketPriority priority,
- ApplicationId appId) {
+ ApplicationId appId, FlowRule.Type tableType) {
this.selector = selector;
this.priority = priority;
this.appId = appId;
+ this.tableType = tableType;
}
public TrafficSelector selector() {
@@ -108,6 +110,10 @@
return appId;
}
+ public FlowRule.Type tableType() {
+ return tableType;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -170,7 +176,22 @@
checkNotNull(appId, "Application ID cannot be null");
PacketRequest request =
- new PacketRequest(selector, priority, appId);
+ new PacketRequest(selector, priority, appId, FlowRule.Type.DEFAULT);
+
+ packetRequests.add(request);
+ pushToAllDevices(request);
+ }
+
+ @Override
+ public void requestPackets(TrafficSelector selector, PacketPriority priority,
+ ApplicationId appId, FlowRule.Type tableType) {
+ checkNotNull(selector, "Selector cannot be null");
+ checkNotNull(appId, "Application ID cannot be null");
+ checkNotNull(tableType, "Table Type cannot be null. For requesting packets +"
+ + "without table hints, use other methods in the packetService API");
+
+ PacketRequest request =
+ new PacketRequest(selector, priority, appId, tableType);
packetRequests.add(request);
pushToAllDevices(request);
@@ -204,7 +225,7 @@
treatment,
request.priority().priorityValue(),
request.appId(),
- 0, true);
+ 0, true, request.tableType());
flowService.applyFlowRules(flow);
}
diff --git a/core/net/src/test/java/org/onosproject/net/host/impl/HostMonitorTest.java b/core/net/src/test/java/org/onosproject/net/host/impl/HostMonitorTest.java
index 7152ad9..03276941 100644
--- a/core/net/src/test/java/org/onosproject/net/host/impl/HostMonitorTest.java
+++ b/core/net/src/test/java/org/onosproject/net/host/impl/HostMonitorTest.java
@@ -47,6 +47,7 @@
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceListener;
import org.onosproject.net.device.DeviceServiceAdapter;
+import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions.OutputInstruction;
@@ -266,6 +267,12 @@
public void requestPackets(TrafficSelector selector,
PacketPriority priority, ApplicationId appId) {
}
+
+ @Override
+ public void requestPackets(TrafficSelector selector,
+ PacketPriority priority, ApplicationId appId,
+ FlowRule.Type tableType) {
+ }
}
class TestDeviceService extends DeviceServiceAdapter {
diff --git a/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java b/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java
index ca218c6..6d90971 100644
--- a/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java
@@ -51,6 +51,7 @@
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceListener;
import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions.OutputInstruction;
@@ -592,5 +593,11 @@
public void requestPackets(TrafficSelector selector,
PacketPriority priority, ApplicationId appId) {
}
+
+ @Override
+ public void requestPackets(TrafficSelector selector,
+ PacketPriority priority, ApplicationId appId,
+ FlowRule.Type tableType) {
+ }
}
}