5 #define IP(a, b, c, d) (((a) << 0) + ((b) << 8) + ((c) << 16) + ((d) << 24))
6 #define htons(a) __builtin_bswap16(a)
20 unsigned short sin_len
;
22 unsigned short sin_port
;
23 struct in_addr sin_addr
;
28 unsigned short sa_family
;
32 extern int (*sceNetSocket
)(const char *, int, int, int);
33 extern int (*sceNetSocketClose
)(int);
34 extern int (*sceNetConnect
)(int, struct sockaddr
*, int);
35 extern int (*sceNetSend
)(int, const void *, size_t, int);
36 extern int (*sceNetBind
)(int, struct sockaddr
*, int);
37 extern int (*sceNetListen
)(int, int);
38 extern int (*sceNetAccept
)(int, struct sockaddr
*, unsigned int *);
39 extern int (*sceNetRecv
)(int, void *, size_t, int);
41 extern int (*sceNetGetsockname
)(int, struct sockaddr
*, unsigned int *);
43 extern const char (*sceNetInetNtop
)(int af
, const void *src
, char *dst
, int size
);
44 extern int (*sceNetInetPton
)(int af
, const char *src
, void *dst
);
46 extern uint64_t (*sceNetHtonll
)(uint64_t host64
);
47 extern uint32_t (*sceNetHtonl
)(uint32_t host32
);
48 extern uint16_t (*sceNetHtons
)(uint16_t host16
);
49 extern uint64_t (*sceNetNtohll
)(uint64_t net64
);
50 extern uint32_t (*sceNetNtohl
)(uint32_t net32
);
51 extern uint16_t (*sceNetNtohs
)(uint16_t net16
);
54 void initNetwork(void);