Fix #2378, refactor SB to support additional use cases
Checklist (Please check before submitting)
- [x] I reviewed the Contributing Guide.
- [x] I signed and emailed the appropriate Contributor License Agreement to [email protected] and copied [email protected].
Describe the contribution Cleans up the internal SB implementation so it can better support future enhancements such as message integrity, additional header fields and timestamping.
Fixes #2378
Testing performed Full suite of tests on SB implementation
Expected behavior changes API behavior is preserved, fully backward compatible
System(s) tested on Debian
Additional context Replaces #2367 based on code review and discussion. This PR represents the refactoring change, along with some other refinements. The routing change will be a separate PR.
Contributor Info - All information REQUIRED for consideration of pull request Joseph Hickey, Vantage Systems, Inc.
Rebased this PR to current main branch
The unused variable static analysis warning is fixed, but code coverage is now complaining.
The "missed branches" that it is reporting are mostly due to the fact that the switch statements in the code only have cases for the values that actually occur, and thus it is impossible to reach the switch with a value that doesn't have a case for it. While this would normally be a good thing, gcov/lcov flags it as an uncovered branch. I will look into this tomorrow to see if I can resolve it somehow.
Most "switch" cases now fixed (code coverage-wise) by adding a default case that does nothing, and always going through it. Looking at other modules there are still some code coverage lines that could potentially be fixed up before merging.
CCB 2 May 2024: Approved pending BVT run.