Implement DHCPv4 Lease Query
Change-Id: Ic24b2825bbb359e4044d59e0eaaa1097d0d5351c
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java
index 029c2fc..51d8f98 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java
@@ -41,6 +41,9 @@
private final MacAddress macAddress;
private final VlanId vlanId;
private MacAddress nextHop;
+ // this will hold the potential next hop change in case
+ // of successfull LQ from another NH for a certain IP
+ private MacAddress nextHopTemp;
private Ip4Address ip4Address;
private DHCP.MsgType ip4Status;
@@ -256,6 +259,26 @@
}
/**
+ * Gets temporary nextHop mac address.
+ *
+ * @return the IPv4 nextHop mac address; empty if not exists
+ */
+ public Optional<MacAddress> nextHopTemp() {
+ return Optional.ofNullable(nextHopTemp);
+ }
+
+ /**
+ * Sets temporary nextHop mac address.
+ *
+ * @param nextHop the IPv4 nextHop mac address
+ * @return the DHCP record
+ */
+ public DhcpRecord nextHopTemp(MacAddress nextHop) {
+ this.nextHopTemp = nextHop;
+ return this;
+ }
+
+ /**
* Clone this DHCP record.
*
* @return the DHCP record which cloned