Error codes

All the error codes the networking libraries return, with when they were seen on a PSP.

sceNet (0x804101xx)

CodeNameSeen
0x80410001NO_SPACE (out of memory)a 65523-byte PDP send, now and then
0x80410103(invalid argument)sceNetGetMallocStat(NULL)
0x80410104(no such thread)sceNetThreadAbort and sceNetFreeThreadinfo with 0 or a bad ID
0x80410180(no ether address yet)sceNetGetLocalEtherAddr before a scan or group operation

sceNetAdhoc (0x804107xx)

CodeNameSeen
0x80410701INVALID_SOCKET_IDany call with an ID that isn't (or is no longer) a socket of the right kind
0x80410702INVALID_ADDRa MAC that isn't the console's own as the local address; a zero or multicast destination; sockets before the console is in a group
0x80410703INVALID_PORTdestination port 0 or 65535; local port 65535
0x80410704INVALID_BUFLENsceNetAdhocctlGetPeerInfo with a buffer smaller than the struct
0x80410705INVALID_DATALENlength over 65523, negative, or non-zero with NULL data; game mode buffer of size 0
0x80400706NOT_ENOUGH_SPACEPdpRecv with a buffer smaller than the datagram
0x80410707SOCKET_DELETEDa thread blocked on a socket that's deleted
0x80410708SOCKET_ALERTEDa call matching an alert set on the socket
0x80410709WOULD_BLOCKnon-blocking call that can't complete
0x8041070APORT_IN_USEPdpCreate on a port in use
0x8041070BNOT_CONNECTEDPTP send or receive on a listener
0x8041070CDISCONNECTEDPTP send or receive after the peer has gone
0x8040070DNOT_OPENED
0x8040070ENOT_LISTENEDPtpAccept on a socket that isn't listening
0x8041070FSOCKET_ID_NOT_AVAILcreating a 256th socket
0x80410710PORT_NOT_AVAIL
0x80410711INVALID_ARGNULL pointers, bad flags, bad counts
0x80410712NOT_INITIALIZEDbefore sceNetAdhocInit or after Term
0x80410713ALREADY_INITIALIZEDsceNetAdhocInit twice
0x80410714BUSY
0x80410715TIMEOUTa blocking call that ran out of time
0x80410716NO_ENTRYGetPeerInfo/GetNameByAddr for a MAC that isn't a peer, including the console's own
0x80410717EXCEPTION_EVENTPollSocket with a disconnected socket or a poll alert
0x80410718CONNECTION_REFUSEDPTP connect to a port nobody listens on
0x80410719THREAD_ABORTED
0x8041071AALREADY_CREATEDgame mode master or replica created twice
0x8041071BNOT_IN_GAMEMODEgame mode data calls outside game mode
0x8041071CNOT_CREATEDdeleting a game mode master or replica that doesn't exist; a bad replica ID

The three in bold really are 0x8040....

sceNetAdhocAuth (0x804106xx)

CodeNameSeen
0x80410601ALREADY_INITIALIZEDsceNetAdhocctlInit after a failed second Init (see that function)

sceNetAdhocctl (0x80410Bxx)

CodeNameSeen
0x80410B01NOT_LEFT_IBSS
0x80410B02ALREADY_CONNECTEDhandler ERROR event after Create, Connect, Scan or game mode while connected
0x80410B03WLAN_SWITCH_OFF
0x80410B04INVALID_ARGbad group name, NULL ad hoc ID, type above 2, NULL handler, bad game mode arguments
0x80410B05TIMEOUThandler ERROR event when game mode members don't turn up in time
0x80410B06ID_NOT_FOUNDDelHandler with an unknown ID
0x80410B07ALREADY_INITIALIZEDsceNetAdhocctlInit twice
0x80410B08NOT_INITIALIZEDbefore Init or after Term
0x80410B09DISCONNECTEDGetParameter while not in a group
0x80410B0ANO_SCAN_INFO
0x80410B0BINVALID_IBSSExitGameMode while in a normal group
0x80410B0CNOT_ENTER_GAMEMODEGetGameModeInfo outside game mode
0x80410B0DCHANNEL_NOT_AVAILABLE
0x80410B0EWLAN_BEACON_LOST
0x80410B0FWLAN_SUSPENDED
0x80410B10BUSYwhile game mode is waiting forever for members
0x80410B11CHANNEL_NOT_MATCH
0x80410B12TOO_MANY_HANDLERSa fifth handler
0x80410B13STACKSIZE_TOO_SHORTsceNetAdhocctlInit with a stack below 0xC00
0x80410682(none)GetPeerList while not in a group

sceNetAdhocMatching (0x804108xx)

CodeNameSeen
0x80410801INVALID_MODEmode other than 1-3
0x80410802INVALID_PORT
0x80410803INVALID_MAXNUMmaxnum outside 2-16
0x80410804RXBUF_TOO_SHORTrxbuflen below 6 * maxnum + 4
0x80410805INVALID_OPTLEN
0x80410806INVALID_ARGzero intervals in host/P2P mode, negative init count, zero rexmt interval, NULL pool stat
0x80410807INVALID_IDunknown context ID
0x80410808ID_NOT_AVAILa 16th context
0x80410809NO_SPACE
0x8041080AIS_RUNNINGStart or Delete on a running context
0x8041080BNOT_RUNNINGtarget, data and hello calls before Start
0x8041080CUNKNOWN_TARGETa MAC that isn't a matching peer
0x8041080DTARGET_NOT_READYSelectTarget on a request the client already cancelled
0x8041080EEXCEED_MAXNUM
0x8041080FREQUEST_IN_PROGRESSSelectTarget twice for the same peer
0x80410810ALREADY_ESTABLISHED
0x80410811BUSY
0x80410812ALREADY_INITIALIZEDInit twice
0x80410813NOT_INITIALIZEDCreate before Init
0x80410814PORT_IN_USEtwo contexts on one port
0x80410815STACKSIZE_TOO_SHORT
0x80410816INVALID_DATALEN
0x80410817NOT_ESTABLISHED
0x80410818DATA_BUSYSendData before the previous send to that peer was acknowledged

sceNetAdhocDiscover (0x804113xx)

CodeSeen
0x80411301InitStart while discover is running
0x80411303RequestSuspend while discovering with nobody around

The Wi-Fi driver (0x80410Dxx)

These only arrive through handler events.

CodeSeen
0x80410D01adhocctl's ERROR event when creating a group while apctl is connected to an access point
0x80410D09apctl's ERROR event when joining an access point fails (on one console, while adhocctl was merely initialized)
0x80410D13sceNetAdhocGameModeCreateReplica for a MAC that isn't a game mode member

sceNetApctl (0x80410Axx)

CodeName
0x80410A01ALREADY_INITIALIZED
0x80410A02INVALID_CODE (seen: GetInfo with code 19)
0x80410A03INVALID_IP
0x80410A04NOT_DISCONNECTED
0x80410A05NOT_IN_BSS
0x80410A06WLAN_SWITCH_OFF
0x80410A07WLAN_BEACON_LOST
0x80410A08WLAN_DISASSOCIATION
0x80410A09INVALID_ID
0x80410A0AWLAN_SUSPENDED
0x80410A0BTIMEOUT
0x80410A0D(seen) apctl not initialized, from GetState
0x80410A0F(seen) too many handlers (the limit is 2)
0x80410A80(seen) busy: Connect or ScanUser while one is in progress
0x80410A82(seen) an ID that was never valid, in DelHandler and GetBSSDescEntryUser
0x80110601(netparam) BAD_NETCONF: sceNetApctlConnect with no profile in that slot, or a slot out of range
0x80110602(netparam, seen) sceNetApctlConnect(-1)

sceNetResolver (0x804104xx)

CodeName
0x80410401NOT_TERMINATED
0x80410402NO_DNS_SERVER
0x80410403INVALID_PTR
0x80410404INVALID_BUFLEN
0x80410405INVALID_ID
0x80410406ID_MAX
0x80410407NO_MEM
0x80410408BAD_ID
0x80410409CTX_BUSY
0x8041040AALREADY_STOPPED
0x8041040BNOT_SUPPORTED
0x8041040CBUF_NO_SPACE
0x8041040DINVALID_PACKET
0x8041040ESTOPPED
0x8041040FSOCKET
0x80410410TIMEOUT
0x80410411NO_RECORD
0x80410412RES_PACKET_FORMAT
0x80410413RES_SERVER_FAILURE
0x80410414INVALID_HOST (seen: a name that doesn't exist)
0x80410418(seen) an empty host name
0x80410419(seen) PollAsync with NULL
0x8041041A(seen) PollAsync/WaitAsync with no lookup pending
0x80000020(seen) sceNetResolverInit twice

sceNetInet errno values

sceNetInet functions return -1 and set an errno (read with sceNetInetGetErrno). The numbers follow newlib, not Linux or BSD:

errnoNameSeen
4EINTRthe call was cut short by sceNetInetSocketAbort
9EBADFinvalid or closed descriptor
11EAGAINnon-blocking call that can't complete; MSG_WAITALL timing out
22EINVALbad lengths; bind twice; listen on an unbound socket; accept on a non-listener; connect after a refusal
24EMFILEa 256th socket
28ENOSPCInetNtop buffer too small
32EPIPEsend after the peer closed, or after shutdown(SHUT_WR)
95EOPNOTSUPPlisten or accept on UDP
104ECONNRESETreceive after the peer reset the connection
105ENOBUFSa socket buffer over 1 MB
106EAFNOSUPPORTInetPton/InetNtop with a family other than AF_INET
109ENOPROTOOPTunknown or read-only socket options
111ECONNREFUSEDconnect to a port nobody listens on; receive on a connected UDP socket after an ICMP port unreachable
112EADDRINUSEbind to an address in use
118EHOSTUNREACHbroadcast with no network interface up
119EINPROGRESSnon-blocking connect
121EDESTADDRREQsend on an unconnected UDP socket
122EMSGSIZEUDP datagram larger than SO_SNDBUF
123EPROTONOSUPPORTbad domain, type or protocol in socket
125EADDRNOTAVAILbind to an address the console doesn't have, or the wrong family
127EISCONNconnect again; sendto another address on connected UDP
128ENOTCONNsend, receive or getpeername on an unconnected socket