System.Net.NetworkInformation.SystemUnicastIPAddressInformation.SystemUnicastIPAddressInformation C# (CSharp) Method

SystemUnicastIPAddressInformation() private method

private SystemUnicastIPAddressInformation ( System.Net.Interop adapterAddress ) : System.Diagnostics
adapterAddress System.Net.Interop
return System.Diagnostics
        internal SystemUnicastIPAddressInformation(Interop.IpHlpApi.IpAdapterUnicastAddress adapterAddress)
        {
            IPAddress ipAddress = adapterAddress.address.MarshalIPAddress();
            _innerInfo = new SystemIPAddressInformation(ipAddress, adapterAddress.flags);
            _prefixOrigin = adapterAddress.prefixOrigin;
            _suffixOrigin = adapterAddress.suffixOrigin;
            _dadState = adapterAddress.dadState;
            _validLifetime = adapterAddress.validLifetime;
            _preferredLifetime = adapterAddress.preferredLifetime;
            _dhcpLeaseLifetime = adapterAddress.leaseLifetime;

            _prefixLength = adapterAddress.prefixLength;

            // IPv6 returns 0.0.0.0 for consistency with down-level platforms.
            if (ipAddress.AddressFamily == AddressFamily.InterNetwork)
            {
                _ipv4Mask = PrefixLengthToSubnetMask(_prefixLength, ipAddress.AddressFamily);
            }
        }