Exemple #1
0
        // Token: 0x060016C9 RID: 5833 RVA: 0x0005D090 File Offset: 0x0005B290
        public ClusterNetwork(AmClusterNetwork clusNet)
        {
            this.SubnetId     = ExchangeSubnet.ExtractSubnetId(clusNet);
            this.ClusterState = clusNet.GetState(false);
            if (this.SubnetId == null)
            {
                ExTraceGlobals.NetworkManagerTracer.TraceError <string>(0L, "ClusterNetwork.Subnet is null for network {0}", clusNet.Name);
                throw new ClusterNetworkNullSubnetException(clusNet.Name);
            }
            IEnumerable <AmClusterNetInterface> enumerable = clusNet.EnumerateNetworkInterfaces();

            try
            {
                foreach (AmClusterNetInterface clusNic in enumerable)
                {
                    ClusterNic item = new ClusterNic(clusNic, this);
                    this.m_nics.Add(item);
                }
            }
            finally
            {
                foreach (AmClusterNetInterface amClusterNetInterface in enumerable)
                {
                    using (amClusterNetInterface)
                    {
                    }
                }
            }
        }
Exemple #2
0
        // Token: 0x06001783 RID: 6019 RVA: 0x000616CC File Offset: 0x0005F8CC
        private ExchangeSubnet AddSubnetToMap(DatabaseAvailabilityGroupSubnetId subnetId, ExchangeNetwork owningNetwork)
        {
            ExchangeSubnet exchangeSubnet = new ExchangeSubnet(subnetId);

            exchangeSubnet.Network = owningNetwork;
            owningNetwork.Subnets.Add(exchangeSubnet);
            this.m_subnets.Add(exchangeSubnet.SubnetId, exchangeSubnet);
            return(exchangeSubnet);
        }
Exemple #3
0
        // Token: 0x06001784 RID: 6020 RVA: 0x00061708 File Offset: 0x0005F908
        private ExchangeSubnet FindSubnet(DatabaseAvailabilityGroupSubnetId subnetId)
        {
            ExchangeSubnet result = null;

            if (!this.m_subnets.TryGetValue(subnetId, out result))
            {
                return(null);
            }
            return(result);
        }
Exemple #4
0
        // Token: 0x0600177A RID: 6010 RVA: 0x00060C0C File Offset: 0x0005EE0C
        internal void Load(NetworkDiscovery netConfig)
        {
            this.m_preferredNets = new List <ExchangeNetwork>();
            this.m_regularNets   = new List <ExchangeNetwork>();
            foreach (ClusterNode clusterNode in netConfig.Nodes)
            {
                ExchangeNetworkNode exchangeNetworkNode = new ExchangeNetworkNode(clusterNode.Name.NetbiosName);
                exchangeNetworkNode.ClusterState = clusterNode.ClusterState;
                this.m_nodes.Add(exchangeNetworkNode.Name, exchangeNetworkNode);
            }
            string machineName     = Environment.MachineName;
            int    sourceNodeIndex = this.Nodes.IndexOfKey(machineName);

            this.SourceNodeIndex = sourceNodeIndex;
            foreach (LogicalNetwork logicalNetwork in netConfig.LogicalNetworks)
            {
                ExchangeNetwork exchangeNetwork = new ExchangeNetwork(logicalNetwork.Name, this);
                exchangeNetwork.Description        = logicalNetwork.Description;
                exchangeNetwork.ReplicationEnabled = logicalNetwork.ReplicationEnabled;
                exchangeNetwork.IgnoreNetwork      = logicalNetwork.IgnoreNetwork;
                exchangeNetwork.MapiAccessEnabled  = logicalNetwork.HasDnsNic();
                this.m_networks.Add(exchangeNetwork.Name, exchangeNetwork);
                foreach (Subnet subnet in logicalNetwork.Subnets)
                {
                    if (this.m_subnets.ContainsKey(subnet.SubnetId))
                    {
                        exchangeNetwork.IsMisconfigured = true;
                        string errorText = string.Format("Ignoring subnet {0}. It was mapped to multiple nets.", subnet.SubnetId);
                        this.RecordInconsistency(errorText);
                    }
                    else
                    {
                        ExchangeSubnet exchangeSubnet = this.AddSubnetToMap(subnet.SubnetId, exchangeNetwork);
                        ClusterNetwork clusterNetwork = subnet.ClusterNetwork;
                        if (clusterNetwork == null)
                        {
                            exchangeNetwork.IsMisconfigured = true;
                            string errorText2 = string.Format("Subnet {0} configured but no cluster network matched.", subnet.SubnetId);
                            this.RecordInconsistency(errorText2);
                        }
                        else
                        {
                            exchangeSubnet.SubnetAndState.State = ExchangeSubnet.MapSubnetState(clusterNetwork.ClusterState);
                            foreach (ClusterNic clusterNic in clusterNetwork.Nics)
                            {
                                int num = this.Nodes.IndexOfKey(clusterNic.NodeName);
                                if (num < 0)
                                {
                                    string errorText3 = string.Format("Nic {0} has unknown Node {1}.", clusterNic.IPAddress, clusterNic.NodeName);
                                    this.RecordInconsistency(errorText3);
                                }
                                else
                                {
                                    NetworkEndPoint networkEndPoint = new NetworkEndPoint(clusterNic.IPAddress, clusterNic.NodeName, exchangeSubnet);
                                    exchangeSubnet.Network.AddEndPoint(networkEndPoint, num);
                                    networkEndPoint.CopyClusterNicState(clusterNic.ClusterState);
                                }
                            }
                        }
                    }
                }
                if (!exchangeNetwork.IgnoreNetwork && exchangeNetwork.Subnets.Count != 0 && exchangeNetwork.ReplicationEnabled)
                {
                    if (exchangeNetwork.MapiAccessEnabled)
                    {
                        this.m_regularNets.Add(exchangeNetwork);
                    }
                    else
                    {
                        this.m_preferredNets.Add(exchangeNetwork);
                    }
                }
            }
        }
Exemple #5
0
        // Token: 0x06001779 RID: 6009 RVA: 0x00060A2C File Offset: 0x0005EC2C
        internal void SynchronizeClusterNetworkRoles(IAmCluster cluster)
        {
            IEnumerable <AmClusterNetwork> enumerable = cluster.EnumerateNetworks();

            try
            {
                foreach (AmClusterNetwork amClusterNetwork in enumerable)
                {
                    DatabaseAvailabilityGroupSubnetId databaseAvailabilityGroupSubnetId = ExchangeSubnet.ExtractSubnetId(amClusterNetwork);
                    if (databaseAvailabilityGroupSubnetId != null)
                    {
                        ExchangeSubnet exchangeSubnet = this.FindSubnet(databaseAvailabilityGroupSubnetId);
                        if (exchangeSubnet != null)
                        {
                            AmNetworkRole nativeClusterNetworkRole = exchangeSubnet.Network.GetNativeClusterNetworkRole();
                            AmNetworkRole nativeRole = amClusterNetwork.GetNativeRole();
                            if (nativeRole != nativeClusterNetworkRole)
                            {
                                NetworkManager.TraceDebug("Changing network role for subnet {0} from {1} to {2}", new object[]
                                {
                                    databaseAvailabilityGroupSubnetId,
                                    nativeRole,
                                    nativeClusterNetworkRole
                                });
                                bool flag = false;
                                try
                                {
                                    amClusterNetwork.SetNativeRole(nativeClusterNetworkRole);
                                    flag = true;
                                }
                                finally
                                {
                                    if (!flag)
                                    {
                                        if (nativeClusterNetworkRole == AmNetworkRole.ClusterNetworkRoleNone)
                                        {
                                            exchangeSubnet.Network.IgnoreNetwork = false;
                                            this.ConfigUpdated = true;
                                        }
                                    }
                                    else
                                    {
                                        ReplayEventLogConstants.Tuple_NetworkRoleChanged.LogEvent(null, new object[]
                                        {
                                            amClusterNetwork.Name,
                                            databaseAvailabilityGroupSubnetId.ToString(),
                                            nativeRole.ToString(),
                                            nativeClusterNetworkRole.ToString()
                                        });
                                    }
                                }
                            }
                        }
                    }
                }
            }
            finally
            {
                foreach (AmClusterNetwork amClusterNetwork2 in enumerable)
                {
                    using (amClusterNetwork2)
                    {
                    }
                }
            }
        }
Exemple #6
0
 public NetworkEndPoint(IPAddress ipAddr, string nodeName, ExchangeSubnet subnet)
 {
     this.m_ipAddress = ipAddr;
     this.m_nodeName  = nodeName;
     this.m_subnet    = subnet;
 }