Complete rewrite of bsd IClient (#460)

This should provide accurate behaviours.
This implementation has been tested with ftpd and libtransistor bsd tests.

This implementation lacks OOB support.
This commit is contained in:
Thomas Guillemard 2018-10-21 00:08:58 +02:00 committed by Ac_K
parent 2cb8541462
commit b5f7d8106b
8 changed files with 1304 additions and 302 deletions

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Bsd
{
//bsd_errno == (SocketException.ErrorCode - 10000)
enum BsdError
{
Timeout = 60
}
}

View file

@ -0,0 +1,7 @@
namespace Ryujinx.HLE.HOS.Services.Bsd
{
enum BsdIoctl
{
AtMark = 0x40047307,
}
}

View file

@ -1,4 +1,3 @@
using System.Net;
using System.Net.Sockets;
namespace Ryujinx.HLE.HOS.Services.Bsd
@ -9,10 +8,6 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
public int Type;
public int Protocol;
public IPAddress IpAddress;
public IPEndPoint RemoteEP;
public Socket Handle;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,28 @@
namespace Ryujinx.HLE.HOS.Services.Bsd
{
class PollEvent
{
public enum EventTypeMask
{
Input = 1,
UrgentInput = 2,
Output = 4,
Error = 8,
Disconnected = 0x10,
Invalid = 0x20,
}
public int SocketFd { get; private set; }
public BsdSocket Socket { get; private set; }
public EventTypeMask InputEvents { get; private set; }
public EventTypeMask OutputEvents { get; private set; }
public PollEvent(int SocketFd, BsdSocket Socket, EventTypeMask InputEvents, EventTypeMask OutputEvents)
{
this.SocketFd = SocketFd;
this.Socket = Socket;
this.InputEvents = InputEvents;
this.OutputEvents = OutputEvents;
}
}
}

View file

@ -72,10 +72,10 @@ namespace Ryujinx.HLE.HOS.Services
return new Bcat.IServiceCreator();
case "bsd:s":
return new IClient();
return new IClient(true);
case "bsd:u":
return new IClient();
return new IClient(false);
case "caps:a":
return new IAlbumAccessorService();