0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfo4.cs

29 lines
763 B
C#
Raw Normal View History

using Ryujinx.Common.Memory;
using System;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types
{
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
struct AddrInfo4
{
public byte Length;
public byte Family;
public short Port;
public Array4<byte> Address;
public AddrInfo4(IPAddress address, short port)
{
Length = 0;
Family = (byte)AddressFamily.InterNetwork;
Port = port;
Address = default;
address.GetAddressBytes().AsSpan().CopyTo(Address.ToSpan());
Address.ToSpan().Reverse();
}
}
}