public void UpdateIaAddr(IaAddress iaAddr) { _DhcpLeaseData.Where(d => d.GetIpAddress() == iaAddr.GetIpAddress()).ToList().ForEach(d => { d.SetStartTime(iaAddr.GetStartTime()); d.SetPreferredEndTime(iaAddr.GetPreferredEndTime()); d.SetValidEndTime(iaAddr.GetValidEndTime()); }); //(_DhcpLeaseData.Where(d => d.GetIpAddress().ToString() == iaAddr.GetIpAddress().ToString()).First()); }
/** * To dhcp lease. * * @param ia the ia * @param iaAddr the ia addr * @return the dhcp lease */ protected DhcpLease ToDhcpLease(IdentityAssoc ia, IaAddress iaAddr) { DhcpLease lease = new DhcpLease(); lease.SetDuid(ia.GetDuid()); lease.SetIaid(ia.GetIaid()); lease.SetIatype(ia.GetIatype()); lease.SetIpAddress(iaAddr.GetIpAddress()); if (iaAddr is IaPrefix) { lease.SetPrefixLength(((IaPrefix)iaAddr).GetPrefixLength()); } lease.SetState(iaAddr.GetState()); lease.SetStartTime(iaAddr.GetStartTime()); lease.SetPreferredEndTime(iaAddr.GetPreferredEndTime()); lease.SetValidEndTime(iaAddr.GetValidEndTime()); lease.SetIaAddrDhcpOptions(iaAddr.GetDhcpOptions()); lease.SetIaDhcpOptions(ia.GetDhcpOptions()); return(lease); }