コード例 #1
0
 /**
  * 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());
     }
 }
コード例 #2
0
        /**
         * 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);
        }
コード例 #3
0
        /**
         * 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);
        }
コード例 #4
0
 /**
  * Delete dhcp lease.
  *
  * @param lease the lease
  */
 protected void DeleteDhcpLease(DhcpLease lease)
 {
     _DhcpLeaseData.RemoveAll(d => d.GetIpAddress().ToString() == lease.GetIpAddress().ToString());
 }