-
Notifications
You must be signed in to change notification settings - Fork 0
feat: S12.25 portable category axis + event-struct error boundary #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
abe0f2f
spike: S12.25 error event + category axis (enum variant)
DavidCozens c0ef283
spike: S12.25 switch category axis to macros (BASE+n, embedded cast)
DavidCozens 60ce19a
feat: S12.25 portable category axis + event-struct error boundary
DavidCozens cc66b58
fix: S12.25 cast category base macros to uint16_t (clang-tidy macro-t…
DavidCozens 7774f09
fix: S12.25 report HMAC verify failures as OPEN_FAILED, not SEAL_FAILED
DavidCozens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
| #ifndef SOLIDSYSLOGBUFFERCATEGORIES_H | ||
| #define SOLIDSYSLOGBUFFERCATEGORIES_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include "SolidSyslogErrorCategory.h" | ||
|
|
||
| /* | ||
| * Portable Buffer-role error categories. Any Buffer implementation reuses | ||
| * these; a portable handler switch on event->Category reacts to a buffer | ||
| * backend failure identically regardless of the underlying mechanism | ||
| * (POSIX message queue, ring, ...). | ||
| */ | ||
| #define SOLIDSYSLOG_CAT_BUFFER_BACKEND_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_BUFFER_BASE + 1U)) | ||
|
|
||
| #endif /* SOLIDSYSLOGBUFFERCATEGORIES_H */ |
This file contains hidden or 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 hidden or 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,38 @@ | ||
| #ifndef SOLIDSYSLOGERRORCATEGORY_H | ||
| #define SOLIDSYSLOGERRORCATEGORY_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| /* | ||
| * Portable error-category axis. Categories are library-owned constants | ||
| * organised errno-domain style: a low universal-lifecycle range, then one | ||
| * base per role family (declared beside that role's *Definition.h, off the | ||
| * bases below as BASE + n), then a reserved integrator range. 0xC000 and | ||
| * above is reserved for integrator-defined roles so custom backends never | ||
| * collide. | ||
| * | ||
| * The category constants carry their own (uint16_t) cast so emit sites stay | ||
| * clean — SolidSyslog_Error's category parameter is uint16_t (not an enum | ||
| * type), which is what lets integrator classes supply their own categories | ||
| * in the reserved range without being boxed into a library enum. | ||
| */ | ||
|
|
||
| /* Universal lifecycle categories, available to every source. */ | ||
| #define SOLIDSYSLOG_CAT_BAD_CONFIG ((uint16_t) 0x0001U) | ||
| #define SOLIDSYSLOG_CAT_BAD_ARGUMENT ((uint16_t) 0x0002U) | ||
| #define SOLIDSYSLOG_CAT_POOL_EXHAUSTED ((uint16_t) 0x0003U) | ||
| #define SOLIDSYSLOG_CAT_UNKNOWN_DESTROY ((uint16_t) 0x0004U) | ||
|
|
||
| /* | ||
| * Per-role base ranges. A role occupies [BASE, BASE + 0xFF]. A base is listed | ||
| * here only once a role family carries a role-specific category; roles that | ||
| * emit only the universal categories above need none. (0x0100 Sender and | ||
| * 0x0300 Stream are intentionally unallocated — those roles emit only | ||
| * universal categories today.) | ||
| */ | ||
| #define SOLIDSYSLOG_CAT_RESOLVER_BASE ((uint16_t) 0x0200U) | ||
| #define SOLIDSYSLOG_CAT_TLSSTREAM_BASE ((uint16_t) 0x0400U) | ||
| #define SOLIDSYSLOG_CAT_SECURITYPOLICY_BASE ((uint16_t) 0x0500U) | ||
| #define SOLIDSYSLOG_CAT_BUFFER_BASE ((uint16_t) 0x0600U) | ||
|
|
||
| #endif /* SOLIDSYSLOGERRORCATEGORY_H */ |
This file contains hidden or 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,15 @@ | ||
| #ifndef SOLIDSYSLOGRESOLVERCATEGORIES_H | ||
| #define SOLIDSYSLOGRESOLVERCATEGORIES_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include "SolidSyslogErrorCategory.h" | ||
|
|
||
| /* | ||
| * Portable Resolver-role error categories. Any Resolver implementation | ||
| * reuses these; a portable handler switch on event->Category works | ||
| * identically across every resolver backend. | ||
| */ | ||
| #define SOLIDSYSLOG_CAT_RESOLVER_RESOLVE_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_RESOLVER_BASE + 1U)) | ||
|
|
||
| #endif /* SOLIDSYSLOGRESOLVERCATEGORIES_H */ |
This file contains hidden or 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,19 @@ | ||
| #ifndef SOLIDSYSLOGSECURITYPOLICYCATEGORIES_H | ||
| #define SOLIDSYSLOGSECURITYPOLICYCATEGORIES_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include "SolidSyslogErrorCategory.h" | ||
|
|
||
| /* | ||
| * Portable SecurityPolicy-role error categories, shared by every integrity / | ||
| * confidentiality policy (HMAC, AES-GCM, OpenSSL, Mbed TLS, ...). Seal (write | ||
| * side) and open (read side) are kept distinct because "a stored record can no | ||
| * longer be read back" is a materially different operational signal from | ||
| * "a record could not be written". | ||
| */ | ||
| #define SOLIDSYSLOG_CAT_SECURITYPOLICY_KEY_UNAVAILABLE ((uint16_t) (SOLIDSYSLOG_CAT_SECURITYPOLICY_BASE + 1U)) | ||
| #define SOLIDSYSLOG_CAT_SECURITYPOLICY_SEAL_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_SECURITYPOLICY_BASE + 2U)) | ||
| #define SOLIDSYSLOG_CAT_SECURITYPOLICY_OPEN_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_SECURITYPOLICY_BASE + 3U)) | ||
|
|
||
| #endif /* SOLIDSYSLOGSECURITYPOLICYCATEGORIES_H */ |
This file contains hidden or 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,17 @@ | ||
| #ifndef SOLIDSYSLOGTLSSTREAMCATEGORIES_H | ||
| #define SOLIDSYSLOGTLSSTREAMCATEGORIES_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include "SolidSyslogErrorCategory.h" | ||
|
|
||
| /* | ||
| * Portable TLS-stream error categories, shared by every TLS backend (OpenSSL, | ||
| * Mbed TLS, or an integrator's own). A portable handler switch on | ||
| * event->Category reacts to a TLS init or handshake failure identically | ||
| * regardless of which TLS library produced it. | ||
| */ | ||
| #define SOLIDSYSLOG_CAT_TLSSTREAM_INIT_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_TLSSTREAM_BASE + 1U)) | ||
| #define SOLIDSYSLOG_CAT_TLSSTREAM_HANDSHAKE_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_TLSSTREAM_BASE + 2U)) | ||
|
|
||
| #endif /* SOLIDSYSLOGTLSSTREAMCATEGORIES_H */ |
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.