mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-22 11:15:15 +00:00
b3b49bd547
Enable the full keyboard to enter non-numbers and increase max length from 15 to 50 for longer hostnames. I know FQDNs can be longer than 50 characters, but that's less common (and painful to type on the Switch).
50 lines
1,017 B
C++
50 lines
1,017 B
C++
#pragma once
|
|
|
|
#include "../types.h"
|
|
|
|
|
|
struct in_addr
|
|
{
|
|
u32 data; // 0
|
|
};
|
|
|
|
struct sockaddr
|
|
{
|
|
u8 _0; // 0
|
|
u8 family; // 1
|
|
u16 port; // 2
|
|
in_addr address; // 4
|
|
u8 _8[8]; // 8
|
|
};
|
|
|
|
struct hostent
|
|
{
|
|
char* h_name;
|
|
char** h_aliases;
|
|
int h_addrtype;
|
|
int h_length;
|
|
char** h_addr_list;
|
|
};
|
|
|
|
|
|
namespace nn { namespace socket {
|
|
|
|
Result Initialize(void* pool, ulong poolSize, ulong allocPoolSize, int concurLimit);
|
|
|
|
s32 SetSockOpt(s32 socket, s32 socketLevel, s32 option, void const*, u32 len);
|
|
|
|
s32 Socket(s32 domain, s32 type, s32 protocol);
|
|
s32 Connect(s32 socket, const sockaddr* address, u32 addressLen);
|
|
Result Close(s32 socket);
|
|
|
|
s32 Send(s32 socket, const void* data, ulong dataLen, s32 flags);
|
|
s32 Recv(s32 socket, void* out, ulong outLen, s32 flags);
|
|
|
|
u16 InetHtons(u16 val);
|
|
s32 InetAton(const char* addressStr, in_addr* addressOut);
|
|
|
|
struct hostent* GetHostByName(const char* name);
|
|
|
|
u32 GetLastErrno();
|
|
|
|
} }
|