Endian fix
[ps4-sdk.git] / include / network.h
blobf1797fce08058a10b031a9fc1fe5363cca34d87a
1 #pragma once
3 #include <stdlib.h>
5 #define IP(a, b, c, d) (((a) << 0) + ((b) << 8) + ((c) << 16) + ((d) << 24))
6 #define htons(a) __builtin_bswap16(a)
8 #define SCENET 0xe
10 #define AF_INET 0x0200
11 #define SOCK_STREAM 1
12 #define SOCK_DGRAM 2
14 struct in_addr {
15 unsigned long s_addr;
18 struct sockaddr_in {
19 short sin_family;
20 unsigned short sin_port;
21 struct in_addr sin_addr;
22 char sin_zero[8];
25 extern int (*sceNetSocket)(const char *, int, int, int);
26 extern int (*sceNetConnect)(int, struct sockaddr_in *, int);
27 extern int (*sceNetSend)(int, const void *, size_t, int);
28 extern int (*sceNetClose)(int);
30 void initNetwork(void);