-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate error code constants for all platforms
- Loading branch information
Showing
11 changed files
with
311 additions
and
5 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "MsQuic.Win32.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "winerror.h" | ||
#define QUIC_TLS_ALERT_HRESULT_PREFIX _HRESULT_TYPEDEF_(0x80410100L) | ||
|
||
typedef enum { | ||
QUIC_STATUS_SUCCESS = 0x0, // S_OK | ||
QUIC_STATUS_PENDING = 0x703e5, // SUCCESS_HRESULT_FROM_WIN32(ERROR_IO_PENDING) | ||
QUIC_STATUS_CONTINUE = 0x704de, // SUCCESS_HRESULT_FROM_WIN32(ERROR_CONTINUE) | ||
QUIC_STATUS_OUT_OF_MEMORY = 0x8007000e, // E_OUTOFMEMORY | ||
QUIC_STATUS_INVALID_PARAMETER = 0x80070057, // E_INVALIDARG | ||
QUIC_STATUS_INVALID_STATE = 0x8007139f, // E_NOT_VALID_STATE | ||
QUIC_STATUS_NOT_SUPPORTED = 0x80004002, // E_NOINTERFACE | ||
QUIC_STATUS_NOT_FOUND = 0x80070490, // HRESULT_FROM_WIN32(ERROR_NOT_FOUND) | ||
QUIC_STATUS_BUFFER_TOO_SMALL = 0x8007007a, // E_NOT_SUFFICIENT_BUFFER | ||
QUIC_STATUS_HANDSHAKE_FAILURE = 0x80410000, // ERROR_QUIC_HANDSHAKE_FAILURE | ||
QUIC_STATUS_ABORTED = 0x80004004, // E_ABORT | ||
QUIC_STATUS_ADDRESS_IN_USE = 0x80072740, // HRESULT_FROM_WIN32(WSAEADDRINUSE) | ||
QUIC_STATUS_INVALID_ADDRESS = 0x80072741, // HRESULT_FROM_WIN32(WSAEADDRNOTAVAIL) | ||
QUIC_STATUS_CONNECTION_TIMEOUT = 0x80410006, // ERROR_QUIC_CONNECTION_TIMEOUT | ||
QUIC_STATUS_CONNECTION_IDLE = 0x80410005, // ERROR_QUIC_CONNECTION_IDLE | ||
QUIC_STATUS_UNREACHABLE = 0x800704d0, // HRESULT_FROM_WIN32(ERROR_HOST_UNREACHABLE) | ||
QUIC_STATUS_INTERNAL_ERROR = 0x80410003, // ERROR_QUIC_INTERNAL_ERROR | ||
QUIC_STATUS_CONNECTION_REFUSED = 0x800704c9, // HRESULT_FROM_WIN32(ERROR_CONNECTION_REFUSED) | ||
QUIC_STATUS_PROTOCOL_ERROR = 0x80410004, // ERROR_QUIC_PROTOCOL_VIOLATION | ||
QUIC_STATUS_VER_NEG_ERROR = 0x80410001, // ERROR_QUIC_VER_NEG_FAILURE | ||
QUIC_STATUS_TLS_ERROR = 0x80072b18, // HRESULT_FROM_WIN32(WSA_SECURE_HOST_NOT_FOUND) | ||
QUIC_STATUS_USER_CANCELED = 0x80410002, // ERROR_QUIC_USER_CANCELED | ||
QUIC_STATUS_ALPN_NEG_FAILURE = 0x80410007, // ERROR_QUIC_ALPN_NEG_FAILURE | ||
QUIC_STATUS_STREAM_LIMIT_REACHED = 0x80410008, // ERROR_QUIC_STREAM_LIMIT_REACHED | ||
QUIC_STATUS_ALPN_IN_USE = 0x80410009, // ERROR_QUIC_ALPN_IN_USE | ||
|
||
QUIC_STATUS_CLOSE_NOTIFY = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 0), // QUIC_STATUS_TLS_ALERT(0) - Close notify | ||
QUIC_STATUS_BAD_CERTIFICATE = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 42), // QUIC_STATUS_TLS_ALERT(42) - Bad Certificate | ||
QUIC_STATUS_UNSUPPORTED_CERTIFICATE = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 43), // QUIC_STATUS_TLS_ALERT(43) - Unsupported Certificate | ||
QUIC_STATUS_REVOKED_CERTIFICATE = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 44), // QUIC_STATUS_TLS_ALERT(44) - Revoked Certificate | ||
QUIC_STATUS_EXPIRED_CERTIFICATE = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 45), // QUIC_STATUS_TLS_ALERT(45) - Expired Certificate | ||
QUIC_STATUS_UNKNOWN_CERTIFICATE = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 46), // QUIC_STATUS_TLS_ALERT(46) - Unknown Certificate | ||
QUIC_STATUS_REQUIRED_CERTIFICATE = QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & 116), // QUIC_STATUS_TLS_ALERT(116) - Required Certificate | ||
|
||
QUIC_STATUS_CERT_EXPIRED = 0xBEBC401, // CERT_E_EXPIRED | ||
QUIC_STATUS_CERT_UNTRUSTED_ROOT = 0xBEBC402, // CERT_E_UNTRUSTEDROOT | ||
QUIC_STATUS_CERT_NO_CERT = 0xBEBC403 // SEC_E_NO_CREDENTIALS | ||
} QUIC_STATUS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "MsQuic.Linux.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#define ERROR_BASE 200000000 // 0xBEBC200 | ||
#define TLS_ERROR_BASE 256 + ERROR_BASE // 0xBEBC300 | ||
#define CERT_ERROR_BASE 512 + ERROR_BASE // 0xBEBC400 | ||
|
||
typedef enum { | ||
QUIC_STATUS_SUCCESS = 0, // 0 | ||
QUIC_STATUS_PENDING = -2, // -2 | ||
QUIC_STATUS_CONTINUE = -1, // -1 | ||
QUIC_STATUS_OUT_OF_MEMORY = 12, // 12 | ||
QUIC_STATUS_INVALID_PARAMETER = 22, // 22 | ||
QUIC_STATUS_INVALID_STATE = 1, // 1 | ||
QUIC_STATUS_NOT_SUPPORTED = 95, // 95 (102 on macOS) | ||
QUIC_STATUS_NOT_FOUND = 2, // 2 | ||
QUIC_STATUS_BUFFER_TOO_SMALL = 75, // 75 (84 on macOS) | ||
QUIC_STATUS_HANDSHAKE_FAILURE = 103, // 103 (53 on macOS) | ||
QUIC_STATUS_ABORTED = 125, // 125 (89 on macOS) | ||
QUIC_STATUS_ADDRESS_IN_USE = 98, // 98 (48 on macOS) | ||
QUIC_STATUS_INVALID_ADDRESS = 97, // 97 (47 on macOS) | ||
QUIC_STATUS_CONNECTION_TIMEOUT = 110, // 110 (60 on macOS) | ||
QUIC_STATUS_CONNECTION_IDLE = 62, // 62 (101 on macOS) | ||
QUIC_STATUS_INTERNAL_ERROR = 5, // 5 | ||
QUIC_STATUS_CONNECTION_REFUSED = 111, // 111 (61 on macOS) | ||
QUIC_STATUS_PROTOCOL_ERROR = 71, // 71 (100 on macOS) | ||
QUIC_STATUS_VER_NEG_ERROR = 93, // 93 (43 on macOS) | ||
QUIC_STATUS_UNREACHABLE = 113, // 113 (65 on macOS) | ||
QUIC_STATUS_TLS_ERROR = 126, // 126 | ||
QUIC_STATUS_USER_CANCELED = 130, // 130 (105 on macOS) | ||
QUIC_STATUS_ALPN_NEG_FAILURE = 92, // 92 (42 on macOS) | ||
QUIC_STATUS_STREAM_LIMIT_REACHED = 86, // 86 | ||
QUIC_STATUS_ALPN_IN_USE = 91, // 91 (41 on macOS) | ||
QUIC_STATUS_ADDRESS_NOT_AVAILABLE = 99, // 99 (47 on macOS) | ||
|
||
QUIC_STATUS_CLOSE_NOTIFY = (0xff & 0) + TLS_ERROR_BASE, // 0xBEBC300 - Close notify | ||
QUIC_STATUS_BAD_CERTIFICATE = (0xff & 42) + TLS_ERROR_BASE, // 0xBEBC32A - Bad Certificate | ||
QUIC_STATUS_UNSUPPORTED_CERTIFICATE = (0xff & 43) + TLS_ERROR_BASE, // 0xBEBC32B - Unsupported Certificate | ||
QUIC_STATUS_REVOKED_CERTIFICATE = (0xff & 44) + TLS_ERROR_BASE, // 0xBEBC32C - Revoked Certificate | ||
QUIC_STATUS_EXPIRED_CERTIFICATE = (0xff & 45) + TLS_ERROR_BASE, // 0xBEBC32D - Expired Certificate | ||
QUIC_STATUS_UNKNOWN_CERTIFICATE = (0xff & 46) + TLS_ERROR_BASE, // 0xBEBC32E - Unknown Certificate | ||
QUIC_STATUS_REQUIRED_CERTIFICATE = (0xff & 116) + TLS_ERROR_BASE, // 0xBEBC374 - Required Certificate | ||
|
||
QUIC_STATUS_CERT_EXPIRED = 1 + CERT_ERROR_BASE, // 0xBEBC401 | ||
QUIC_STATUS_CERT_UNTRUSTED_ROOT = 2 + CERT_ERROR_BASE, // 0xBEBC402 | ||
QUIC_STATUS_CERT_NO_CERT = 3 + CERT_ERROR_BASE, // 0xBEBC403 | ||
} QUIC_STATUS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "MsQuic.MacOs.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#define ERROR_BASE 200000000 // 0xBEBC200 | ||
#define TLS_ERROR_BASE 256 + ERROR_BASE // 0xBEBC300 | ||
#define CERT_ERROR_BASE 512 + ERROR_BASE // 0xBEBC400 | ||
|
||
typedef enum { | ||
QUIC_STATUS_SUCCESS = 0, // 0 | ||
QUIC_STATUS_PENDING = -2, // -2 | ||
QUIC_STATUS_CONTINUE = -1, // -1 | ||
QUIC_STATUS_OUT_OF_MEMORY = 12, // 12 | ||
QUIC_STATUS_INVALID_PARAMETER = 22, // 22 | ||
QUIC_STATUS_INVALID_STATE = 1, // 1 | ||
QUIC_STATUS_NOT_SUPPORTED = 102, // 102 (95 on Linux) | ||
QUIC_STATUS_NOT_FOUND = 2, // 2 | ||
QUIC_STATUS_BUFFER_TOO_SMALL = 84, // 84 (75 on Linux) | ||
QUIC_STATUS_HANDSHAKE_FAILURE = 53, // 53 (103 on Linux) | ||
QUIC_STATUS_ABORTED = 89, // 89 (125 on Linux) | ||
QUIC_STATUS_ADDRESS_IN_USE = 48, // 48 (98 on Linux) | ||
QUIC_STATUS_INVALID_ADDRESS = 47, // 47 (97 on Linux) | ||
QUIC_STATUS_CONNECTION_TIMEOUT = 60, // 60 (110 on Linux) | ||
QUIC_STATUS_CONNECTION_IDLE = 101, // 101 (62 on Linux) | ||
QUIC_STATUS_INTERNAL_ERROR = 5, // 5 | ||
QUIC_STATUS_CONNECTION_REFUSED = 61, // 61 (111 on Linux) | ||
QUIC_STATUS_PROTOCOL_ERROR = 100, // 100 (71 on Linux) | ||
QUIC_STATUS_VER_NEG_ERROR = 43, // 43 (93 on Linux) | ||
QUIC_STATUS_UNREACHABLE = 65, // 65 (113 on Linux) | ||
QUIC_STATUS_TLS_ERROR = 126, // 126 | ||
QUIC_STATUS_USER_CANCELED = 105, // 105 (130 on Linux) | ||
QUIC_STATUS_ALPN_NEG_FAILURE = 42, // 42 (92 on Linux) | ||
QUIC_STATUS_STREAM_LIMIT_REACHED = 86, // 86 | ||
QUIC_STATUS_ALPN_IN_USE = 41, // 41 (91 on Linux) | ||
QUIC_STATUS_ADDRESS_NOT_AVAILABLE = 47, // 47 (99 on Linux) | ||
|
||
QUIC_STATUS_CLOSE_NOTIFY = (0xff & 0) + TLS_ERROR_BASE, // 0xBEBC300 - Close notify | ||
QUIC_STATUS_BAD_CERTIFICATE = (0xff & 42) + TLS_ERROR_BASE, // 0xBEBC32A - Bad Certificate | ||
QUIC_STATUS_UNSUPPORTED_CERTIFICATE = (0xff & 43) + TLS_ERROR_BASE, // 0xBEBC32B - Unsupported Certificate | ||
QUIC_STATUS_REVOKED_CERTIFICATE = (0xff & 44) + TLS_ERROR_BASE, // 0xBEBC32C - Revoked Certificate | ||
QUIC_STATUS_EXPIRED_CERTIFICATE = (0xff & 45) + TLS_ERROR_BASE, // 0xBEBC32D - Expired Certificate | ||
QUIC_STATUS_UNKNOWN_CERTIFICATE = (0xff & 46) + TLS_ERROR_BASE, // 0xBEBC32E - Unknown Certificate | ||
QUIC_STATUS_REQUIRED_CERTIFICATE = (0xff & 116) + TLS_ERROR_BASE, // 0xBEBC374 - Required Certificate | ||
|
||
QUIC_STATUS_CERT_EXPIRED = 1 + CERT_ERROR_BASE, // 0xBEBC401 | ||
QUIC_STATUS_CERT_UNTRUSTED_ROOT = 2 + CERT_ERROR_BASE, // 0xBEBC402 | ||
QUIC_STATUS_CERT_NO_CERT = 3 + CERT_ERROR_BASE, // 0xBEBC403 | ||
} QUIC_STATUS; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.