AddAddress() private method

private AddAddress ( IPAddress address ) : void
address IPAddress
return void
コード例 #1
0
ファイル: UnixNetworkInterface.cs プロジェクト: addisu/corefx
        protected static unsafe void ProcessIpv6Address(UnixNetworkInterface uni,
                                                        Interop.Sys.IpAddressInfo *addressInfo,
                                                        uint scopeId)
        {
            IPAddress address = IPAddressUtil.GetIPAddressFromNativeInfo(addressInfo);

            uni.AddAddress(address);
            uni._ipv6ScopeId = scopeId;
        }
コード例 #2
0
ファイル: UnixNetworkInterface.cs プロジェクト: addisu/corefx
        protected static unsafe void ProcessIpv4Address(UnixNetworkInterface uni,
                                                        Interop.Sys.IpAddressInfo *addressInfo,
                                                        Interop.Sys.IpAddressInfo *netMask)
        {
            IPAddress ipAddress      = IPAddressUtil.GetIPAddressFromNativeInfo(addressInfo);
            IPAddress netMaskAddress = IPAddressUtil.GetIPAddressFromNativeInfo(netMask);

            uni.AddAddress(ipAddress);
            uni._netMasks[ipAddress] = netMaskAddress;
        }
コード例 #3
0
        protected static unsafe void ProcessIpv6Address(UnixNetworkInterface uni,
                                                        Interop.Sys.IpAddressInfo *addressInfo,
                                                        uint scopeId)
        {
            byte[] ipBytes = new byte[addressInfo->NumAddressBytes];
            fixed(byte *ipArrayPtr = ipBytes)
            {
                Buffer.MemoryCopy(addressInfo->AddressBytes, ipArrayPtr, ipBytes.Length, ipBytes.Length);
            }

            IPAddress address = new IPAddress(ipBytes);

            uni.AddAddress(address);
            uni._ipv6ScopeId = scopeId;
        }
コード例 #4
0
        protected static unsafe void ProcessIpv4Address(UnixNetworkInterface uni,
                                                        Interop.Sys.IpAddressInfo *addressInfo,
                                                        Interop.Sys.IpAddressInfo *netMask)
        {
            byte[] ipBytes = new byte[addressInfo->NumAddressBytes];
            fixed(byte *ipArrayPtr = ipBytes)
            {
                Buffer.MemoryCopy(addressInfo->AddressBytes, ipArrayPtr, ipBytes.Length, ipBytes.Length);
            }

            IPAddress ipAddress = new IPAddress(ipBytes);

            byte[] ipBytes2 = new byte[netMask->NumAddressBytes];
            fixed(byte *ipArrayPtr = ipBytes2)
            {
                Buffer.MemoryCopy(netMask->AddressBytes, ipArrayPtr, ipBytes2.Length, ipBytes2.Length);
            }

            IPAddress netMaskAddress = new IPAddress(ipBytes2);

            uni.AddAddress(ipAddress);
            uni._netMasks[ipAddress] = netMaskAddress;
        }
コード例 #5
0
        protected static unsafe void ProcessIpv6Address(UnixNetworkInterface uni,
                                                        Interop.Sys.IpAddressInfo* addressInfo,
                                                        uint scopeId)
        {
            byte[] ipBytes = new byte[addressInfo->NumAddressBytes];
            fixed (byte* ipArrayPtr = ipBytes)
            {
                Buffer.MemoryCopy(addressInfo->AddressBytes, ipArrayPtr, ipBytes.Length, ipBytes.Length);
            }
            IPAddress address = new IPAddress(ipBytes);

            uni.AddAddress(address);
            uni._ipv6ScopeId = scopeId;
        }
コード例 #6
0
        protected static unsafe void ProcessIpv4Address(UnixNetworkInterface uni,
                                                Interop.Sys.IpAddressInfo* addressInfo,
                                                Interop.Sys.IpAddressInfo* netMask)
        {
            byte[] ipBytes = new byte[addressInfo->NumAddressBytes];
            fixed (byte* ipArrayPtr = ipBytes)
            {
                Buffer.MemoryCopy(addressInfo->AddressBytes, ipArrayPtr, ipBytes.Length, ipBytes.Length);
            }
            IPAddress ipAddress = new IPAddress(ipBytes);

            byte[] ipBytes2 = new byte[netMask->NumAddressBytes];
            fixed (byte* ipArrayPtr = ipBytes2)
            {
                Buffer.MemoryCopy(netMask->AddressBytes, ipArrayPtr, ipBytes2.Length, ipBytes2.Length);
            }
            IPAddress netMaskAddress = new IPAddress(ipBytes2);

            uni.AddAddress(ipAddress);
            uni._netMasks[ipAddress] = netMaskAddress;
        }