Ejemplo n.º 1
0
        /**
         * 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);
        }
Ejemplo n.º 2
0
 protected void SetDhcpOption(IaAddress iaAddr, DhcpOption option)
 {
     iaAddr.SetDhcpOption(option);
     UpdateIpAddrOptions(iaAddr.GetIpAddress(), iaAddr.GetDhcpOptions());
 }