libluna: Add a few more network-related errno codes

This commit is contained in:
apio 2023-07-28 17:30:35 +02:00
parent be5903c0c8
commit ec5b83ff01
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 70 additions and 57 deletions

View File

@ -51,9 +51,12 @@
#define EOPNOTSUPP 95 // Operation not supported
#define EAFNOSUPPORT 97 // Address family not supported by protocol
#define EADDRINUSE 98 // Address already in use
#define EADDRNOTAVAIL 99 // Cannot assign requested address
#define ENETRESET 102 // Network dropped connection on reset
#define ECONNRESET 104 // Connection reset by peer
#define EISCONN 106 // Transport endpoint is already connected
#define ENOTCONN 107 // Transport endpoint is not connected
#define ETIMEDOUT 110 // Connection timed out
#define ECONNREFUSED 111 // Connection refused
#define EALREADY 114 // Operation already in progress
#define EINPROGRESS 115 // Operation now in progress

View File

@ -60,6 +60,9 @@ const char* error_string(int error)
case EPROTOTYPE: return "Protocol wrong type for socket";
case EAFNOSUPPORT: return "Address family not supported by protocol";
case ENOTCONN: return "Transport endpoint is not connected";
case EADDRNOTAVAIL: return "Cannot assign requested address";
case ECONNREFUSED: return "Connection refused";
case EINPROGRESS: return "Operation now in progress";
default: return "Unknown error";
}
}
@ -122,6 +125,13 @@ const char* error_name(int error)
ERROR(EISCONN);
ERROR(ETIMEDOUT);
ERROR(EALREADY);
ERROR(EDESTADDRREQ);
ERROR(EPROTOTYPE);
ERROR(EAFNOSUPPORT);
ERROR(ENOTCONN);
ERROR(EADDRNOTAVAIL);
ERROR(ECONNREFUSED);
ERROR(EINPROGRESS);
default: return nullptr;
}