Skip to content
Snippets Groups Projects
Commit 5a7d928c authored by Vishnu Emmadi's avatar Vishnu Emmadi
Browse files

Reduce flowmod usage by wildcarding parts of external IP addresses BVS-437

o IPV4SubnetTrie Enhancements:
    o Method to get the slices (absent keys) of a given key against the trie
    o Updated shortestNonMatchingPrefixLen to use a /32 key
o VirtualRouting Flow Reconciliation Changes:
    o Support for processing slices and generating OFMatchReconcile objects for each slice
o VirtualRouterManager Changes:
    o Store Src IP CIDRs in routing rules within a trie
    o Store Dst IP CIDRs in routing rules within a trie
    o PacketIn Flow:
        o Prefix is calculated as max of the shortestNonMatchingPrefix against the src/dst routing rule subnets and interface subnets
    o Reconciliation Flow:
        o getSlices against the src/dst routing rule trie of the input src/dst CIDR.
        o If no further slices of the input CIDR are generated by the routing rule trie, getSlices against the interface subnets
parent 336174ef
No related branches found
No related tags found
No related merge requests found
......@@ -100,4 +100,76 @@ public class OFMatchReconcile {
" cookie=" + cookie + " appInstName=" + appInstName + " newAppInstName=" + newAppInstName +
" ReconcileAction=" + rcAction + "outPort=" + outPort + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + action;
result = prime * result
+ ((appInstName == null) ? 0 : appInstName.hashCode());
result = prime * result + (int) (cookie ^ (cookie >>> 32));
result = prime
* result
+ ((newAppInstName == null) ? 0 : newAppInstName.hashCode());
result = prime * result
+ ((ofmWithSwDpid == null) ? 0 : ofmWithSwDpid.hashCode());
result = prime * result + outPort;
result = prime * result + priority;
result = prime * result
+ ((rcAction == null) ? 0 : rcAction.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OFMatchReconcile)) {
return false;
}
OFMatchReconcile other = (OFMatchReconcile) obj;
if (action != other.action) {
return false;
}
if (appInstName == null) {
if (other.appInstName != null) {
return false;
}
} else if (!appInstName.equals(other.appInstName)) {
return false;
}
if (cookie != other.cookie) {
return false;
}
if (newAppInstName == null) {
if (other.newAppInstName != null) {
return false;
}
} else if (!newAppInstName.equals(other.newAppInstName)) {
return false;
}
if (ofmWithSwDpid == null) {
if (other.ofmWithSwDpid != null) {
return false;
}
} else if (!ofmWithSwDpid.equals(other.ofmWithSwDpid)) {
return false;
}
if (outPort != other.outPort) {
return false;
}
if (priority != other.priority) {
return false;
}
if (rcAction != other.rcAction) {
return false;
}
return true;
}
}
\ No newline at end of file
......@@ -47,9 +47,45 @@ public class OFMatchWithSwDpid {
this.switchDataPathId = dpid;
return this;
}
@Override
public String toString() {
return "OFMatchWithSwDpid [" + HexString.toHexString(switchDataPathId) + ofMatch + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((ofMatch == null) ? 0 : ofMatch.hashCode());
result = prime * result
+ (int) (switchDataPathId ^ (switchDataPathId >>> 32));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OFMatchWithSwDpid)) {
return false;
}
OFMatchWithSwDpid other = (OFMatchWithSwDpid) obj;
if (ofMatch == null) {
if (other.ofMatch != null) {
return false;
}
} else if (!ofMatch.equals(other.ofMatch)) {
return false;
}
if (switchDataPathId != other.switchDataPathId) {
return false;
}
return true;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment