/** * Update dhcp lease. * * @param lease the lease */ protected void UpdateDhcpLease(DhcpLease lease) { foreach (var item in _DhcpLeaseData.Where(p => p.GetIpAddress() == lease.GetIpAddress())) { item.SetState(lease.GetState()); item.SetStartTime(lease.GetStartTime()); item.SetPreferredEndTime(lease.GetPreferredEndTime()); item.SetValidEndTime(lease.GetValidEndTime()); item.SetIaDhcpOptions(lease.GetIaDhcpOptions()); item.SetIaAddrDhcpOptions(lease.GetIaAddrDhcpOptions()); } }
/** * To ia address. * * @param lease the lease * @return the ia address */ protected IaAddress ToIaAddress(DhcpLease lease) { IaAddress iaAddr = new IaAddress(); iaAddr.SetIpAddress(lease.GetIpAddress()); iaAddr.SetState(lease.GetState()); iaAddr.SetStartTime(lease.GetStartTime()); iaAddr.SetPreferredEndTime(lease.GetPreferredEndTime()); iaAddr.SetValidEndTime(lease.GetValidEndTime()); iaAddr.SetDhcpOptions(lease.GetIaAddrDhcpOptions()); return(iaAddr); }
/** * To ia prefix. * * @param lease the lease * @return the ia prefix */ protected IaPrefix ToIaPrefix(DhcpLease lease) { IaPrefix iaPrefix = new IaPrefix(); iaPrefix.SetIpAddress(lease.GetIpAddress()); iaPrefix.SetPrefixLength(lease.GetPrefixLength()); iaPrefix.SetState(lease.GetState()); iaPrefix.SetStartTime(lease.GetStartTime()); iaPrefix.SetPreferredEndTime(lease.GetPreferredEndTime()); iaPrefix.SetValidEndTime(lease.GetValidEndTime()); iaPrefix.SetDhcpOptions(lease.GetIaAddrDhcpOptions()); return(iaPrefix); }