예제 #1
0
        private void LoadManagers()
        {
            Debug.Assert(CheckIPIsUsed != null, "DhcpServer --LoadManagers-- CheckIPIsUsed = null");
            log.Info("Loading managers from context...");

            V6NaAddrBindingManager v6NaAddrBindingMgr = new V6NaAddrBindingManagerImpl();

            v6NaAddrBindingMgr.CheckIPIsUsed = CheckIPIsUsed;
            try
            {
                log.Info("Initializing V6 NA Address Binding Manager");
                v6NaAddrBindingMgr.Init();
                _dhcpServerConfig.SetNaAddrBindingMgr(v6NaAddrBindingMgr);
            }
            catch (Exception ex)
            {
                log.Error("Failed initialize V6 NA Address Binding Manager");
                throw ex;
            }

            V6TaAddrBindingManager v6TaAddrBindingMgr = new V6TaAddrBindingManagerImpl();

            v6TaAddrBindingMgr.CheckIPIsUsed = CheckIPIsUsed;
            try
            {
                log.Info("Initializing V6 TA Address Binding Manager");
                v6TaAddrBindingMgr.Init();
                _dhcpServerConfig.SetTaAddrBindingMgr(v6TaAddrBindingMgr);
            }
            catch (Exception ex)
            {
                log.Error("Failed initialize V6 TA Address Binding Manager");
                throw ex;
            }

            V6PrefixBindingManager v6PrefixBindingMgr = new V6PrefixBindingManagerImpl();

            v6PrefixBindingMgr.CheckIPIsUsed = CheckIPIsUsed;
            try
            {
                log.Info("Initializing V6 Prefix Binding Manager");
                v6PrefixBindingMgr.Init();
                _dhcpServerConfig.SetPrefixBindingMgr(v6PrefixBindingMgr);
            }
            catch (Exception ex)
            {
                log.Error("Failed initialize V6 Prefix Binding Manager");
                throw ex;
            }

            V4AddrBindingManager v4AddrBindingMgr = new V4AddrBindingManagerImpl();

            v4AddrBindingMgr.CheckIPIsUsed = CheckIPIsUsed;
            try
            {
                log.Info("Initializing V4 Address Binding Manager");
                v4AddrBindingMgr.Init();
                _dhcpServerConfig.SetV4AddrBindingMgr(v4AddrBindingMgr);
            }
            catch (Exception ex)
            {
                log.Error("Failed initialize V4 Address Binding Manager");
                throw ex;
            }

            IaManager iaMgr = new LeaseManager();

            _dhcpServerConfig.SetIaMgr(iaMgr);

            log.Info("Managers loaded.");
        }