mirror of
https://github.com/zeldaret/botw
synced 2026-06-10 04:53:37 -04:00
18c60323a9
git subrepo clone https://github.com/open-ead/sead lib/sead subrepo: subdir: "lib/sead" merged: "1b66e825d" upstream: origin: "https://github.com/open-ead/sead" branch: "master" commit: "1b66e825d" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone (merge) https://github.com/open-ead/nnheaders lib/NintendoSDK subrepo: subdir: "lib/NintendoSDK" merged: "9ee21399f" upstream: origin: "https://github.com/open-ead/nnheaders" branch: "master" commit: "9ee21399f" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone https://github.com/open-ead/agl lib/agl subrepo: subdir: "lib/agl" merged: "7c063271b" upstream: origin: "https://github.com/open-ead/agl" branch: "master" commit: "7c063271b" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone https://github.com/open-ead/EventFlow lib/EventFlow subrepo: subdir: "lib/EventFlow" merged: "c35d21b34" upstream: origin: "https://github.com/open-ead/EventFlow" branch: "master" commit: "c35d21b34" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596"
73 lines
2.0 KiB
C++
73 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <arpa/inet.h> //FIXME requires proper musl-setup
|
|
#include <sys/socket.h>
|
|
#include "RootObject.h"
|
|
|
|
namespace nn {
|
|
namespace nex {
|
|
class TransportProtocol {
|
|
public:
|
|
enum Type {
|
|
Sock_Default = 0,
|
|
Sock_Stream = SOCK_STREAM,
|
|
Sock_DGram = SOCK_DGRAM,
|
|
Sock_Raw = SOCK_RAW,
|
|
Sock_SeqPacket = SOCK_SEQPACKET,
|
|
Sock_NonBlock = SOCK_NONBLOCK
|
|
};
|
|
};
|
|
|
|
class SocketDriver : nn::nex::RootObject {
|
|
public:
|
|
typedef in_addr_t InetAddress;
|
|
|
|
enum _SocketFlag : int32_t {
|
|
Msg_None = 0,
|
|
Msg_Oob = MSG_OOB,
|
|
Msg_Peek = MSG_PEEK,
|
|
Msg_DontRoute = MSG_DONTROUTE,
|
|
Msg_Eor = MSG_EOR,
|
|
Msg_Trunc = MSG_TRUNC,
|
|
Msg_CTrunc = MSG_CTRUNC,
|
|
Msg_WaitAll = MSG_WAITALL,
|
|
Msg_DontWait = MSG_DONTWAIT,
|
|
Msg_Eof = MSG_EOF,
|
|
Msg_Notification = MSG_NOTIFICATION,
|
|
Msg_Nbio = MSG_NBIO,
|
|
Msg_Compat = MSG_COMPAT,
|
|
// Msg_SoCallbck = MSG_SOCALLBCK,
|
|
// Msg_NoSignal = MSG_NOSIGNAL,
|
|
Msg_CMsg_CloExec = MSG_CMSG_CLOEXEC
|
|
};
|
|
|
|
class Socket {
|
|
virtual void Open(nn::nex::TransportProtocol::Type);
|
|
virtual void Close();
|
|
virtual void Bind(ushort&);
|
|
virtual void RecvFrom(uchar*, ulong, InetAddress*, ulong*,
|
|
nn::nex::SocketDriver::_SocketFlag);
|
|
virtual void SendTo(uchar const*, ulong, nn::nex::SocketDriver::InetAddress const&, ulong*);
|
|
};
|
|
|
|
class PollInfo {};
|
|
|
|
virtual Socket* Create();
|
|
virtual void Delete(Socket*);
|
|
virtual int Poll(PollInfo*, uint, uint);
|
|
virtual bool CanUseGetAllReceivableSockets();
|
|
virtual void GetAllReceivableSockets(Socket**, ulong, uint);
|
|
};
|
|
|
|
class BerkelySocket : public SocketDriver::Socket {};
|
|
|
|
class BerkeleySocketDriver
|
|
: SocketDriver { // inherits SocketDriver and RootObject but not documented
|
|
virtual ~BerkeleySocketDriver();
|
|
};
|
|
|
|
class ClientWebSocketDriver : SocketDriver {
|
|
class ClientWebSocket : Socket {};
|
|
};
|
|
}; // namespace nex
|
|
}; // namespace nn
|