/** * Callback from the ExpireTimerTask started when the lease was granted. * NOT CURRENTLY USED * * @param iaPrefix the ia prefix */ public void ExpireIaPrefix(IaPrefix iaPrefix) { try { if (DhcpServerPolicies.GlobalPolicyAsBoolean( Property.BINDING_MANAGER_DELETE_OLD_BINDINGS)) { log.Debug("Deleting expired prefix: " + iaPrefix.GetIpAddress()); iaMgr.DeleteIaPrefix(iaPrefix); // free the prefix only if it is deleted from the db, // otherwise, we will get a unique constraint violation // if another client obtains this released prefix FreeAddress(iaPrefix.GetIpAddress()); } else { iaPrefix.SetStartTime(DateTime.Now); iaPrefix.SetPreferredEndTime(DateTime.Now); iaPrefix.SetValidEndTime(DateTime.Now); iaPrefix.SetState(IaPrefix.EXPIRED); log.Debug("Updating expired prefix: " + iaPrefix.GetIpAddress()); iaMgr.UpdateIaPrefix(iaPrefix); } } catch (Exception ex) { log.Error("Failed to expire address"); } }
public void DeclineIaPrefix(IaPrefix iaPrefix) { try { iaPrefix.SetStartTime(DateTime.Now); iaPrefix.SetPreferredEndTime(DateTime.Now); iaPrefix.SetValidEndTime(DateTime.Now); iaPrefix.SetState(IaPrefix.DECLINED); iaMgr.UpdateIaPrefix(iaPrefix); } catch (Exception ex) { log.Error("Failed to decline address"); } }