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);
}