System.Net.PhysicalAddressExtensions.GetAddressType C# (CSharp) Метод

GetAddressType() публичный статический Метод

Gets the type (PhysicalAddressAdministrator) of the PhysicalAddress.
is null.
public static GetAddressType ( this address ) : PhysicalAddressType
address this The address.
Результат PhysicalAddressType
        public static PhysicalAddressType GetAddressType(this PhysicalAddress address)
        {
            if (address == null)
                throw new ArgumentNullException(nameof(address));

            var bytes = address.GetAddressBytes();
            if (bytes == null || bytes.Length < 1)
                throw new ArgumentException($"Invalid {nameof(address)}.");
            return (bytes[0] & 0x1) == 0 ? PhysicalAddressType.Unicast : PhysicalAddressType.Multicast;
        }