Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/HLE/NetInetConstants.h
3186 views
1
#pragma once
2
3
#include <string>
4
#include <cstdint>
5
6
enum {
7
// net common errors
8
ERROR_NET_NO_SPACE = 0x80410001,
9
ERROR_NET_INTERNAL = 0x80410002,
10
ERROR_NET_INVALID_ARG = 0x80410003,
11
ERROR_NET_NO_ENTRY = 0x80410004,
12
13
// pspnet_core
14
ERROR_NET_CORE_NOT_TERMINATED = 0x80410101,
15
ERROR_NET_CORE_INTERFACE_BUSY = 0x80410102,
16
ERROR_NET_CORE_INVALID_ARG = 0x80410103,
17
ERROR_NET_CORE_THREAD_NOT_FOUND = 0x80410104,
18
ERROR_NET_CORE_THREAD_BUSY = 0x80410105,
19
ERROR_NET_CORE_80211_NO_BSS = 0x80410106,
20
ERROR_NET_CORE_80211_NO_AVAIL_BSS = 0x80410107,
21
22
// pspnet_poeclient
23
ERROR_NET_POECLIENT_INIT = 0x80410301,
24
ERROR_NET_POECLIENT_NO_PADO = 0x80410302,
25
ERROR_NET_POECLIENT_NO_PADS = 0x80410303,
26
ERROR_NET_POECLIENT_GET_PADT = 0x80410304,
27
ERROR_NET_POECLIENT_SERVICE_NAME = 0x80410305,
28
ERROR_NET_POECLIENT_AC_SYSTEM = 0x80410306,
29
ERROR_NET_POECLIENT_GENERIC = 0x80410307,
30
ERROR_NET_POECLIENT_AUTH = 0x80410308,
31
ERROR_NET_POECLIENT_NETWORK = 0x80410309,
32
ERROR_NET_POECLIENT_TERMINATE = 0x8041030a,
33
ERROR_NET_POECLIENT_NOT_STARTED = 0x8041030b,
34
35
// pspnet_dhcp
36
ERROR_NET_DHCP_INVALID_PACKET = 0x80410501,
37
ERROR_NET_DHCP_NO_SERVER = 0x80410502,
38
ERROR_NET_DHCP_SENT_DECLINE = 0x80410503,
39
ERROR_NET_DHCP_LEASE_TIME = 0x80410504,
40
ERROR_NET_DHCP_GET_NAK = 0x80410505,
41
42
// wlan errors
43
ERROR_NET_WLAN_ALREADY_JOINED = 0x80410d01,
44
ERROR_NET_WLAN_TRY_JOIN = 0x80410d02,
45
ERROR_NET_WLAN_SCANNING = 0x80410d03,
46
ERROR_NET_WLAN_INVALID_PARAMETER = 0x80410d04,
47
ERROR_NET_WLAN_NOT_SUPPORTED = 0x80410d05,
48
ERROR_NET_WLAN_NOT_JOIN_BSS = 0x80410d06,
49
ERROR_NET_WLAN_ASSOC_TIMEOUT = 0x80410d07,
50
ERROR_NET_WLAN_ASSOC_REFUSED = 0x80410d08,
51
ERROR_NET_WLAN_ASSOC_FAIL = 0x80410d09,
52
ERROR_NET_WLAN_DISASSOC_FAIL = 0x80410d0a,
53
ERROR_NET_WLAN_JOIN_FAIL = 0x80410d0b,
54
ERROR_NET_WLAN_POWER_OFF = 0x80410d0c,
55
ERROR_NET_WLAN_INTERNAL_FAIL = 0x80410d0d,
56
ERROR_NET_WLAN_DEVICE_NOT_READY = 0x80410d0e,
57
ERROR_NET_WLAN_ALREADY_ATTACHED = 0x80410d0f,
58
ERROR_NET_WLAN_NOT_SET_WEP = 0x80410d10,
59
ERROR_NET_WLAN_TIMEOUT = 0x80410d11,
60
ERROR_NET_WLAN_NO_SPACE = 0x80410d12,
61
ERROR_NET_WLAN_INVALID_ARG = 0x80410D13,
62
ERROR_NET_WLAN_NOT_IN_GAMEMODE = 0x80410d14,
63
ERROR_NET_WLAN_LEAVE_FAIL = 0x80410d15,
64
ERROR_NET_WLAN_SUSPENDED = 0x80410d16,
65
};
66
67
// Socket Types (based on https://github.com/justincormack/netbsd-src/blob/master/src/sys/sys/socket.h )
68
#define PSP_NET_INET_SOCK_STREAM 1 // stream socket
69
#define PSP_NET_INET_SOCK_DGRAM 2 // datagram socket
70
#define PSP_NET_INET_SOCK_RAW 3 // raw-protocol interface // SOCK_RAW is similar to but not compatible with the obsolete AF_INET / SOCK_PACKET // SOCK_RAW have some restrictions on newer Windows https://docs.microsoft.com/en-us/windows/win32/winsock/tcp-ip-raw-sockets-2
71
#define PSP_NET_INET_SOCK_RDM 4 // reliably-delivered message
72
#define PSP_NET_INET_SOCK_SEQPACKET 5 // sequenced packet stream
73
#define PSP_NET_INET_SOCK_CONN_DGRAM 6 // connection-orientated datagram
74
#define PSP_NET_INET_SOCK_DCCP PSP_NET_INET_SOCK_CONN_DGRAM // Datagram Congestion Control Protocol
75
#define PSP_NET_INET_SOCK_PACKET 10 // Linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level // SOCK_PACKET is an obsolete socket type to receive raw packets directly from the device driver
76
#define PSP_NET_INET_SOCK_TYPE_MASK 0x000F // mask that covers the above
77
// Flags to be ORed into the type parameter of socket and socketpair and used for the flags parameter of paccept.
78
#define PSP_NET_INET_SOCK_CLOEXEC 0x10000000 // set close on exec on socket
79
#define PSP_NET_INET_SOCK_NONBLOCK 0x20000000 // set non blocking i/o socket
80
#define PSP_NET_INET_SOCK_NOSIGPIPE 0x40000000 // don't send sigpipe
81
#define PSP_NET_INET_SOCK_FLAGS_MASK 0xf0000000 // flags mask
82
83
// Option flags per-socket (based on SOL_SOCKET value on PSP (0xffff) seems to be different with linux/android's auto-generated socket.h (1), but similar to posix/gnu/BSD <sys/socket.h> like this https://github.com/eblot/newlib/blob/master/newlib/libc/sys/linux/sys/socket.h ?)
84
#define PSP_NET_INET_SO_DEBUG 0x0001 // turn on debugging info recording
85
#define PSP_NET_INET_SO_ACCEPTCONN 0x0002 // socket has had listen()
86
#define PSP_NET_INET_SO_REUSEADDR 0x0004 // allow local address reuse
87
#define PSP_NET_INET_SO_KEEPALIVE 0x0008 // keep connections alive
88
#define PSP_NET_INET_SO_DONTROUTE 0x0010 // just use interface addresses
89
#define PSP_NET_INET_SO_BROADCAST 0x0020 // permit sending of broadcast msgs
90
#define PSP_NET_INET_SO_USELOOPBACK 0x0040 // bypass hardware when possible
91
#define PSP_NET_INET_SO_LINGER 0x0080 // linger on close if data present
92
#define PSP_NET_INET_SO_OOBINLINE 0x0100 // leave received OOB data in line
93
#define PSP_NET_INET_SO_REUSEPORT 0x0200 // allow local address & port reuse
94
#define PSP_NET_INET_SO_TIMESTAMP 0x0400 // timestamp received dgram traffic
95
#define PSP_NET_INET_SO_ONESBCAST 0x0800 // permit sending to 255.255.255.255
96
97
// Additional options (not kept in so_options)
98
#define PSP_NET_INET_SO_SNDBUF 0x1001 // send buffer size (default value = 16384 bytes)
99
#define PSP_NET_INET_SO_RCVBUF 0x1002 // receive buffer size (default value = 16384 bytes for TCP/IP, 41600 bytes for UDP/IP)
100
#define PSP_NET_INET_SO_SNDLOWAT 0x1003 // send low-water mark
101
#define PSP_NET_INET_SO_RCVLOWAT 0x1004 // receive low-water mark
102
#define PSP_NET_INET_SO_SNDTIMEO 0x1005 // send timeout
103
#define PSP_NET_INET_SO_RCVTIMEO 0x1006 // receive timeout
104
#define PSP_NET_INET_SO_ERROR 0x1007 // get error status and clear
105
#define PSP_NET_INET_SO_TYPE 0x1008 // get socket type
106
#define PSP_NET_INET_SO_NBIO 0x1009 // SO_NONBLOCK ? // set to non-blocking I/O mode (on true, returning 0x80 when retrieved using getsockopt?). Unclear if correct.
107
#define PSP_NET_INET_SO_BIO 0x100a // set to blocking I/O mode (not using the optval just like SO_NBIO?)
108
//#define PSP_NET_INET_SO_NONBLOCK 0x100b // set to blocking or non-blocking I/O mode (using the optval)
109
#define PSP_NET_INET_SO_NOSIGPIPE 0x1022 // WARNING: SPECULATION
110
111
// User-settable options (used with setsockopt)
112
#define PSP_NET_INET_TCP_NODELAY 0x01 // don't delay send to coalesce packets
113
#define PSP_NET_INET_TCP_MAXSEG 0x02 // set maximum segment size
114
115
// Options for use with [get/set]sockopt at the IP level
116
#define PSP_NET_INET_IP_OPTIONS 1 // (buf/ip_opts) set/get IP options
117
#define PSP_NET_INET_IP_HDRINCL 2 // (int) header is included with data
118
#define PSP_NET_INET_IP_TOS 3 // (int) IP type of service and preced.
119
#define PSP_NET_INET_IP_TTL 4 // (int) IP time to live
120
#define PSP_NET_INET_IP_RECVOPTS 5 // (bool) receive all IP opts w/dgram
121
#define PSP_NET_INET_IP_RECVRETOPTS 6 // (bool) receive IP opts for response
122
#define PSP_NET_INET_IP_RECVDSTADDR 7 // (bool) receive IP dst addr w/dgram
123
#define PSP_NET_INET_IP_RETOPTS 8 // (ip_opts) set/get IP options
124
#define PSP_NET_INET_IP_MULTICAST_IF 9 // (in_addr) set/get IP multicast i/f
125
#define PSP_NET_INET_IP_MULTICAST_TTL 10 // (u_char) set/get IP multicast ttl
126
#define PSP_NET_INET_IP_MULTICAST_LOOP 11 // (u_char) set/get IP multicast loopback
127
#define PSP_NET_INET_IP_ADD_MEMBERSHIP 12 // (ip_mreq) add an IP group membership
128
#define PSP_NET_INET_IP_DROP_MEMBERSHIP 13 // (ip_mreq) drop an IP group membership
129
#define PSP_NET_INET_IP_PORTRANGE 19 // (int) range to use for ephemeral port
130
#define PSP_NET_INET_IP_RECVIF 20 // (bool) receive reception if w/dgram
131
#define PSP_NET_INET_IP_ERRORMTU 21 // (int) get MTU of last xmit = EMSGSIZE
132
133
#define PSP_NET_INET_IP_IPSEC_POLICY 22 // (struct) get/set security policy
134
135
// Level number for [get/set]sockopt to apply to socket itself
136
#define PSP_NET_INET_SOL_SOCKET 0xffff // options for socket level
137
138
// "Socket"-level control message types:
139
#define PSP_NET_INET_SCM_RIGHTS 0x01 // access rights (array of int)
140
#define PSP_NET_INET_SCM_CREDS 0x04 // credentials (struct sockcred)
141
#define PSP_NET_INET_SCM_TIMESTAMP 0x08 // timestamp (struct timeval)
142
143
// Protocols
144
#define PSP_NET_INET_IPPROTO_IP 0 // dummy for IP
145
#define PSP_NET_INET_IPPROTO_HOPOPTS 0 // IP6 hop-by-hop options
146
#define PSP_NET_INET_IPPROTO_UNSPEC 0 // 0 will defaulted to the only existing protocol for that particular domain/family and type
147
#define PSP_NET_INET_IPPROTO_ICMP 1 // control message protocol
148
#define PSP_NET_INET_IPPROTO_IGMP 2 // group mgmt protocol
149
#define PSP_NET_INET_IPPROTO_GGP 3 // gateway^2 (deprecated)
150
#define PSP_NET_INET_IPPROTO_IPV4 4 // IP header
151
#define PSP_NET_INET_IPPROTO_IPIP 4 // IP inside IP
152
#define PSP_NET_INET_IPPROTO_TCP 6 // tcp
153
#define PSP_NET_INET_IPPROTO_EGP 8 // exterior gateway protocol
154
#define PSP_NET_INET_IPPROTO_PUP 12 // pup
155
#define PSP_NET_INET_IPPROTO_UDP 17 // user datagram protocol
156
#define PSP_NET_INET_IPPROTO_IDP 22 // xns idp
157
#define PSP_NET_INET_IPPROTO_TP 29 // tp-4 w/ class negotiation
158
#define PSP_NET_INET_IPPROTO_IPV6 41 // IP6 header
159
#define PSP_NET_INET_IPPROTO_ROUTING 43 // IP6 routing header
160
#define PSP_NET_INET_IPPROTO_FRAGMENT 44 // IP6 fragmentation header
161
#define PSP_NET_INET_IPPROTO_RSVP 46 // resource reservation
162
#define PSP_NET_INET_IPPROTO_GRE 47 // GRE encaps RFC 1701
163
#define PSP_NET_INET_IPPROTO_ESP 50 // encap. security payload
164
#define PSP_NET_INET_IPPROTO_AH 51 // authentication header
165
#define PSP_NET_INET_IPPROTO_MOBILE 55 // IP Mobility RFC 2004
166
#define PSP_NET_INET_IPPROTO_IPV6_ICMP 58 // IPv6 ICMP
167
#define PSP_NET_INET_IPPROTO_ICMPV6 58 // ICMP6
168
#define PSP_NET_INET_IPPROTO_NONE 59 // IP6 no next header
169
#define PSP_NET_INET_IPPROTO_DSTOPTS 60 // IP6 destination option
170
#define PSP_NET_INET_IPPROTO_EON 80 // ISO cnlp
171
#define PSP_NET_INET_IPPROTO_ENCAP 98 // encapsulation header
172
#define PSP_NET_INET_IPPROTO_PIM 103 // Protocol indep. multicast
173
#define PSP_NET_INET_IPPROTO_IPCOMP 108 // IP Payload Comp. Protocol
174
175
#define PSP_NET_INET_IPPROTO_RAW 255 // raw IP packet
176
#define PSP_NET_INET_IPPROTO_MAX 256
177
178
#define PSP_NET_INET_IPPROTO_DONE 257 // all job for this packet are done
179
180
// Address families
181
#define PSP_NET_INET_AF_UNSPEC 0 // unspecified
182
#define PSP_NET_INET_AF_LOCAL 1 // local to host (pipes, portals)
183
#define PSP_NET_INET_AF_UNIX PSP_NET_INET_AF_LOCAL // backward compatibility
184
#define PSP_NET_INET_AF_INET 2 // internetwork: UDP, TCP, etc.
185
#define PSP_NET_INET_AF_IMPLINK 3 // arpanet imp addresses
186
#define PSP_NET_INET_AF_PUP 4 // pup protocols: e.g. BSP
187
#define PSP_NET_INET_AF_CHAOS 5 // mit CHAOS protocols
188
#define PSP_NET_INET_AF_NS 6 // XEROX NS protocols
189
#define PSP_NET_INET_AF_ISO 7 // ISO protocols
190
#define PSP_NET_INET_AF_OSI PSP_NET_INET_AF_ISO
191
#define PSP_NET_INET_AF_ECMA 8 // european computer manufacturers
192
#define PSP_NET_INET_AF_DATAKIT 9 // datakit protocols
193
#define PSP_NET_INET_AF_CCITT 10 // CCITT protocols, X.25 etc
194
#define PSP_NET_INET_AF_SNA 11 // IBM SNA
195
#define PSP_NET_INET_AF_DECnet 12 // DECnet
196
#define PSP_NET_INET_AF_DLI 13 // DEC Direct data link interface
197
#define PSP_NET_INET_AF_LAT 14 // LAT
198
#define PSP_NET_INET_AF_HYLINK 15 // NSC Hyperchannel
199
#define PSP_NET_INET_AF_APPLETALK 16 // Apple Talk
200
#define PSP_NET_INET_AF_ROUTE 17 // Internal Routing Protocol
201
#define PSP_NET_INET_AF_LINK 18 // Link layer interface
202
203
#define PSP_NET_INET_AF_COIP 20 // connection-oriented IP, aka ST II
204
#define PSP_NET_INET_AF_CNT 21 // Computer Network Technology
205
206
#define PSP_NET_INET_AF_IPX 23 // Novell Internet Protocol
207
#define PSP_NET_INET_AF_INET6 24 // IP version 6
208
209
#define PSP_NET_INET_AF_ISDN 26 // Integrated Services Digital Network
210
#define PSP_NET_INET_AF_E164 PSP_NET_INET_AF_ISDN // CCITT E.164 recommendation
211
#define PSP_NET_INET_AF_NATM 27 // native ATM access
212
#define PSP_NET_INET_AF_ARP 28 // (rev.) addr. res. prot. (RFC 826)
213
214
#define PSP_NET_INET_AF_MAX 31
215
216
// Infrastructure ERRNO Values (similar to this https://github.com/eblot/newlib/blob/master/newlib/libc/include/sys/errno.h ?)
217
#define ERROR_INET_EINTR 4 // Interrupted system call
218
#define ERROR_INET_EBADF 9 //0x09 // Or was it 0x80010009 (SCE_ERROR_ERRNO_EBADF/SCE_KERNEL_ERROR_ERRNO_INVALID_FILE_DESCRIPTOR) ?
219
#define ERROR_INET_EAGAIN 11 //0x0B // Or was it 0x8001000B (SCE_ERROR_ERRNO_EAGAIN) ?
220
#define ERROR_INET_EWOULDBLOCK ERROR_INET_EAGAIN // Operation would block
221
#define ERROR_INET_EACCES 13 // Permission denied
222
#define ERROR_INET_EFAULT 14 // Bad address
223
#define ERROR_INET_EINVAL 22 // Invalid argument
224
#define ERROR_INET_ENOSPC 28 // No space left on device
225
#define ERROR_INET_EPIPE 32 // Broken pipe
226
#define ERROR_INET_ENOMSG 35 // No message of desired type
227
#define ERROR_INET_ENOLINK 67 // The link has been severed
228
#define ERROR_INET_EPROTO 71 // Protocol error
229
#define ERROR_INET_EBADMSG 77 // Trying to read unreadable message
230
#define ERROR_INET_EOPNOTSUPP 95 // Operation not supported on transport endpoint
231
#define ERROR_INET_EPFNOSUPPORT 96 // Protocol family not supported
232
#define ERROR_INET_ECONNRESET 104 // Connection reset by peer
233
#define ERROR_INET_ENOBUFS 105 // No buffer space available
234
#define ERROR_INET_EAFNOSUPPORT 106 // EISCONN ? // Address family not supported by protocol family
235
#define ERROR_INET_EPROTOTYPE 107 // Protocol wrong type for socket
236
#define ERROR_INET_ENOTSOCK 108 // Socket operation on non-socket
237
#define ERROR_INET_ENOPROTOOPT 109 // Protocol not available
238
#define ERROR_INET_ESHUTDOWN 110 // Can't send after socket shutdown
239
#define ERROR_INET_ECONNREFUSED 111 // Connection refused
240
#define ERROR_INET_EADDRINUSE 112 // Address already in use
241
#define ERROR_INET_ECONNABORTED 113 // Connection aborted
242
#define ERROR_INET_ENETUNREACH 114 // Network is unreachable
243
#define ERROR_INET_ENETDOWN 115 // Network interface is not configured
244
#define ERROR_INET_ETIMEDOUT 116 // Connection timed out
245
#define ERROR_INET_EHOSTDOWN 117 // Host is down
246
#define ERROR_INET_EHOSTUNREACH 118 // Host is unreachable
247
#define ERROR_INET_EINPROGRESS 119 // Connection already in progress
248
#define ERROR_INET_EALREADY 120 // Socket already connected
249
#define ERROR_INET_EDESTADDRREQ 121 // Destination address required
250
#define ERROR_INET_EMSGSIZE 122 // Message too long
251
#define ERROR_INET_EPROTONOSUPPORT 123 // Unknown protocol
252
#define ERROR_INET_ESOCKTNOSUPPORT 124 // Socket type not supported (linux?)
253
#define ERROR_INET_EADDRNOTAVAIL 125 // Address not available
254
#define ERROR_INET_ENETRESET 126
255
#define ERROR_INET_EISCONN 127 // Socket is already connected
256
#define ERROR_INET_ENOTCONN 128 // Socket is not connected
257
#define ERROR_INET_ETOOMANYREFS 129
258
#define ERROR_INET_ENOTSUP 134 // Not supported
259
260
// Maximum queue length specifiable by listen(2)
261
#define PSP_NET_INET_SOMAXCONN 128
262
263
// On-Demand Flags
264
#define PSP_NET_INET_MSG_OOB 0x1 // process out-of-band data
265
#define PSP_NET_INET_MSG_PEEK 0x2 // peek at incoming message
266
#define PSP_NET_INET_MSG_DONTROUTE 0x4 // send without using routing tables
267
#define PSP_NET_INET_MSG_EOR 0x8 // data completes record
268
#define PSP_NET_INET_MSG_TRUNC 0x10 // data discarded before delivery
269
#define PSP_NET_INET_MSG_CTRUNC 0x20 // control data lost before delivery
270
#define PSP_NET_INET_MSG_WAITALL 0x40 // wait for full request or error
271
#define PSP_NET_INET_MSG_DONTWAIT 0x80 // this message should be nonblocking
272
#define PSP_NET_INET_MSG_BCAST 0x100 // this message was rcvd using link-level brdcst
273
#define PSP_NET_INET_MSG_MCAST 0x200 // this message was rcvd using link-level mcast
274
275
// Poll Event Flags (used on events)
276
#define INET_POLLIN 0x001 // There is data to read.
277
#define INET_POLLPRI 0x002 // There is urgent data to read.
278
#define INET_POLLOUT 0x004 // Writing now will not block.
279
280
#define INET_POLLRDNORM 0x040 // Equivalent to POLLIN ? just like _XOPEN_SOURCE? (mapped to read fds_set)
281
#define INET_POLLWRNORM 0x100 //0x0004 ? // Equivalent to POLLOUT ? just like _XOPEN_SOURCE? (mapped to write fds_set)
282
283
#define INET_POLLRDBAND 0x080 // Priority data may be read. (mapped to exception fds_set)
284
#define INET_POLLWRBAND 0x200 // Priority data may be written. (mapped to write fds_set?)
285
286
#define INET_POLLERR 0x008 // Error condition. (can appear on revents regardless of events?)
287
#define INET_POLLHUP 0x010 // Hung up. (can appear on revents regardless of events?)
288
#define INET_POLLNVAL 0x020 // Invalid polling request. (can appear on revents regardless of events?)
289
290
// Types of socket shutdown(2)
291
#define PSP_NET_INET_SHUT_RD 0 // Disallow further receives.
292
#define PSP_NET_INET_SHUT_WR 1 // Disallow further sends.
293
#define PSP_NET_INET_SHUT_RDWR 2 // Disallow further sends/receives.
294
295
#ifndef SHUT_RD
296
#define SHUT_RD SD_RECEIVE //0x00
297
#endif
298
#ifndef SHUT_WR
299
#define SHUT_WR SD_SEND //0x01
300
#endif
301
#ifndef SHUT_RDWR
302
#define SHUT_RDWR SD_BOTH //0x02
303
#endif
304
305
enum {
306
// from pspsdk's pspnet.h which is similar to https://docs.vitasdk.org/net_2net_8h_source.html
307
SCE_NET_ERROR_EPERM = 0x80410101,
308
SCE_NET_ERROR_ENOENT = 0x80410102,
309
SCE_NET_ERROR_ESRCH = 0x80410103,
310
SCE_NET_ERROR_EINTR = 0x80410104,
311
SCE_NET_ERROR_EIO = 0x80410105,
312
SCE_NET_ERROR_ENXIO = 0x80410106,
313
SCE_NET_ERROR_E2BIG = 0x80410107,
314
315
SCE_NET_ERROR_ENOEXEC = 0x80410108,
316
SCE_NET_ERROR_EBADF = 0x80410109,
317
SCE_NET_ERROR_ECHILD = 0x8041010A,
318
SCE_NET_ERROR_EDEADLK = 0x8041010B,
319
SCE_NET_ERROR_ENOMEM = 0x8041010C,
320
SCE_NET_ERROR_EACCES = 0x8041010D,
321
SCE_NET_ERROR_EFAULT = 0x8041010E,
322
SCE_NET_ERROR_ENOTBLK = 0x8041010F,
323
SCE_NET_ERROR_EBUSY = 0x80410110,
324
SCE_NET_ERROR_EEXIST = 0x80410111,
325
SCE_NET_ERROR_EXDEV = 0x80410112,
326
SCE_NET_ERROR_ENODEV = 0x80410113,
327
SCE_NET_ERROR_ENOTDIR = 0x80410114,
328
SCE_NET_ERROR_EISDIR = 0x80410115,
329
SCE_NET_ERROR_EINVAL = 0x80410116,
330
SCE_NET_ERROR_ENFILE = 0x80410117,
331
SCE_NET_ERROR_EMFILE = 0x80410118,
332
SCE_NET_ERROR_ENOTTY = 0x80410119,
333
SCE_NET_ERROR_ETXTBSY = 0x8041011A,
334
SCE_NET_ERROR_EFBIG = 0x8041011B,
335
SCE_NET_ERROR_ENOSPC = 0x8041011C,
336
SCE_NET_ERROR_ESPIPE = 0x8041011D,
337
SCE_NET_ERROR_EROFS = 0x8041011E,
338
SCE_NET_ERROR_EMLINK = 0x8041011F,
339
SCE_NET_ERROR_EPIPE = 0x80410120,
340
SCE_NET_ERROR_EDOM = 0x80410121,
341
SCE_NET_ERROR_ERANGE = 0x80410122,
342
SCE_NET_ERROR_EAGAIN = 0x80410123,
343
SCE_NET_ERROR_EWOULDBLOCK = 0x80410123,
344
SCE_NET_ERROR_EINPROGRESS = 0x80410124,
345
SCE_NET_ERROR_EALREADY = 0x80410125,
346
SCE_NET_ERROR_ENOTSOCK = 0x80410126,
347
SCE_NET_ERROR_EDESTADDRREQ = 0x80410127,
348
SCE_NET_ERROR_EMSGSIZE = 0x80410128,
349
SCE_NET_ERROR_EPROTOTYPE = 0x80410129,
350
SCE_NET_ERROR_ENOPROTOOPT = 0x8041012A,
351
SCE_NET_ERROR_EPROTONOSUPPORT = 0x8041012B,
352
SCE_NET_ERROR_ESOCKTNOSUPPORT = 0x8041012C,
353
SCE_NET_ERROR_EOPNOTSUPP = 0x8041012D,
354
SCE_NET_ERROR_EPFNOSUPPORT = 0x8041012E,
355
SCE_NET_ERROR_EAFNOSUPPORT = 0x8041012F,
356
SCE_NET_ERROR_EADDRINUSE = 0x80410130,
357
SCE_NET_ERROR_EADDRNOTAVAIL = 0x80410131,
358
SCE_NET_ERROR_ENETDOWN = 0x80410132,
359
SCE_NET_ERROR_ENETUNREACH = 0x80410133,
360
SCE_NET_ERROR_ENETRESET = 0x80410134,
361
SCE_NET_ERROR_ECONNABORTED = 0x80410135,
362
SCE_NET_ERROR_ECONNRESET = 0x80410136,
363
SCE_NET_ERROR_ENOBUFS = 0x80410137,
364
SCE_NET_ERROR_EISCONN = 0x80410138,
365
SCE_NET_ERROR_ENOTCONN = 0x80410139,
366
SCE_NET_ERROR_ESHUTDOWN = 0x8041013A,
367
SCE_NET_ERROR_ETOOMANYREFS = 0x8041013B,
368
SCE_NET_ERROR_ETIMEDOUT = 0x8041013C,
369
SCE_NET_ERROR_ECONNREFUSED = 0x8041013D,
370
SCE_NET_ERROR_ELOOP = 0x8041013E,
371
SCE_NET_ERROR_ENAMETOOLONG = 0x8041013F,
372
SCE_NET_ERROR_EHOSTDOWN = 0x80410140,
373
SCE_NET_ERROR_EHOSTUNREACH = 0x80410141,
374
SCE_NET_ERROR_ENOTEMPTY = 0x80410142,
375
SCE_NET_ERROR_EPROCLIM = 0x80410143,
376
SCE_NET_ERROR_EUSERS = 0x80410144,
377
SCE_NET_ERROR_EDQUOT = 0x80410145,
378
SCE_NET_ERROR_ESTALE = 0x80410146,
379
SCE_NET_ERROR_EREMOTE = 0x80410147,
380
SCE_NET_ERROR_EBADRPC = 0x80410148,
381
SCE_NET_ERROR_ERPCMISMATCH = 0x80410149,
382
SCE_NET_ERROR_EPROGUNAVAIL = 0x8041014A,
383
SCE_NET_ERROR_EPROGMISMATCH = 0x8041014B,
384
SCE_NET_ERROR_EPROCUNAVAIL = 0x8041014C,
385
SCE_NET_ERROR_ENOLCK = 0x8041014D,
386
SCE_NET_ERROR_ENOSYS = 0x8041014E,
387
SCE_NET_ERROR_EFTYPE = 0x8041014F,
388
SCE_NET_ERROR_EAUTH = 0x80410150,
389
SCE_NET_ERROR_ENEEDAUTH = 0x80410151,
390
SCE_NET_ERROR_EIDRM = 0x80410152,
391
SCE_NET_ERROR_ENOMS = 0x80410153,
392
SCE_NET_ERROR_EOVERFLOW = 0x80410154,
393
SCE_NET_ERROR_EILSEQ = 0x80410155,
394
SCE_NET_ERROR_ENOTSUP = 0x80410156,
395
SCE_NET_ERROR_ECANCELED = 0x80410157,
396
SCE_NET_ERROR_EBADMSG = 0x80410158,
397
SCE_NET_ERROR_ENODATA = 0x80410159,
398
SCE_NET_ERROR_ENOSR = 0x8041015A,
399
SCE_NET_ERROR_ENOSTR = 0x8041015B,
400
SCE_NET_ERROR_ETIME = 0x8041015C,
401
402
SCE_NET_ERROR_EADHOC = 0x804101A0,
403
SCE_NET_ERROR_EDISABLEDIF = 0x804101A1,
404
SCE_NET_ERROR_ERESUME = 0x804101A2,
405
406
SCE_NET_ERROR_ENOTINIT = 0x804101C8,
407
SCE_NET_ERROR_ENOLIBMEM = 0x804101C9,
408
SCE_NET_ERROR_ERESERVED202 = 0x804101CA,
409
SCE_NET_ERROR_ECALLBACK = 0x804101CB,
410
SCE_NET_ERROR_EINTERNAL = 0x804101CC,
411
SCE_NET_ERROR_ERETURN = 0x804101CD,
412
413
SCE_NET_ERROR_RESOLVER_EINTERNAL = 0x804101DC,
414
SCE_NET_ERROR_RESOLVER_EBUSY = 0x804101DD,
415
SCE_NET_ERROR_RESOLVER_ENOSPACE = 0x804101DE,
416
SCE_NET_ERROR_RESOLVER_EPACKET = 0x804101DF,
417
SCE_NET_ERROR_RESOLVER_ERESERVED22 = 0x804101E0,
418
SCE_NET_ERROR_RESOLVER_ENODNS = 0x804101E1,
419
SCE_NET_ERROR_RESOLVER_ETIMEDOUT = 0x804101E2,
420
SCE_NET_ERROR_RESOLVER_ENOSUPPORT = 0x804101E3,
421
SCE_NET_ERROR_RESOLVER_EFORMAT = 0x804101E4,
422
SCE_NET_ERROR_RESOLVER_ESERVERFAILURE = 0x804101E5,
423
SCE_NET_ERROR_RESOLVER_ENOHOST = 0x804101E6,
424
SCE_NET_ERROR_RESOLVER_ENOTIMPLEMENTED = 0x804101E7,
425
SCE_NET_ERROR_RESOLVER_ESERVERREFUSED = 0x804101E8,
426
SCE_NET_ERROR_RESOLVER_ENORECORD = 0x804101E9,
427
SCE_NET_ERROR_RESOLVER_EALIGNMENT = 0x804101EA,
428
429
// pspnet_inet
430
ERROR_NET_INET_ALREADY_INITIALIZED = 0x80410201,
431
ERROR_NET_INET_SOCKET_BUSY = 0x80410202,
432
ERROR_NET_INET_CONFIG_INVALID_ARG = 0x80410203,
433
ERROR_NET_INET_GET_IFADDR = 0x80410204,
434
ERROR_NET_INET_SET_IFADDR = 0x80410205,
435
ERROR_NET_INET_DEL_IFADDR = 0x80410206,
436
ERROR_NET_INET_NO_DEFAULT_ROUTE = 0x80410207,
437
ERROR_NET_INET_GET_ROUTE = 0x80410208,
438
ERROR_NET_INET_SET_ROUTE = 0x80410209,
439
ERROR_NET_INET_FLUSH_ROUTE = 0x8041020a,
440
ERROR_NET_INET_INVALID_ARG = 0x8041020b,
441
};
442
443
int convertMsgFlagPSP2Host(int flag);
444
int convertMsgFlagHost2PSP(int flag);
445
int convertMSGFlagsPSP2Host(int flags);
446
int convertMSGFlagsHost2PSP(int flags);
447
int convertSocketDomainPSP2Host(int domain);
448
int convertSocketDomainHost2PSP(int domain);
449
std::string inetSocketDomain2str(int domain);
450
int convertSocketTypePSP2Host(int type);
451
int convertSocketTypeHost2PSP(int type);
452
std::string inetSocketType2str(int type);
453
int convertSocketProtoPSP2Host(int protocol);
454
int convertSocketProtoHost2PSP(int protocol);
455
std::string inetSocketProto2str(int protocol);
456
int convertCMsgTypePSP2Host(int type, int level);
457
int convertCMsgTypeHost2PSP(int type, int level);
458
int convertSockoptLevelPSP2Host(int level);
459
int convertSockoptLevelHost2PSP(int level);
460
std::string inetSockoptLevel2str(int level);
461
int convertSockoptNamePSP2Host(int optname, int level);
462
int convertSockoptNameHost2PSP(int optname, int level);
463
std::string inetSockoptName2str(int optname, int level);
464
int convertInetErrnoHost2PSP(int error);
465
int convertInetErrno2PSPError(int error);
466
const char *convertInetErrno2str(int error);
467
std::string convertNetError2str(uint32_t errorCode);
468
469