|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Private bounded-allocation seam for the portable media service. More...
Go to the source code of this file.
Functions | |
| bool | priv_c6link_mdl_decode_allocation_fits (size_t used, size_t len, size_t capacity) |
| Decide whether one aligned protobuf allocation fits an arena. | |
| bool | ra8_mdl_service_field_valid_test (const char *text, size_t cap) |
| Judge one decoded request header exactly as dispatch does. | |
| bool | ra8_mdl_service_response_valid_test (const ra8_mdl_http_response_t *response) |
| Judge one backend terminal response exactly as dispatch does. | |
| ra8_err_t | ra8_mdl_service_check_size_test (size_t len, size_t response_cap) |
| Judge one packed-response length exactly as dispatch does. | |
Private bounded-allocation seam for the portable media service.
Exposes the pure allocation-fit predicate and the three pure validators to focused host tests; production allocation, dispatch, and ownership remain in ra8_c6link_mdl_service.c.
Definition in file ra8_c6link_mdl_service_internal.h.
| bool priv_c6link_mdl_decode_allocation_fits | ( | size_t | used, |
| size_t | len, | ||
| size_t | capacity ) |
Decide whether one aligned protobuf allocation fits an arena.
Rejects pre-alignment overflow before proving both total and remaining capacity for the fixed eight-byte protobuf alignment.
| [in] | used | Bytes already consumed from the arena. |
| [in] | len | Requested allocation length before alignment. |
| [in] | capacity | Total arena byte capacity. |
| true | Alignment and remaining-capacity checks both succeed. |
| false | Length arithmetic overflows or the request exceeds capacity. |
Definition at line 101 of file ra8_c6link_mdl_service.c.
References k_mdl_decode_align_mask, and RA8_PRIV.
Referenced by internal_mdl_decode_alloc().
| ra8_err_t ra8_mdl_service_check_size_test | ( | size_t | len, |
| size_t | response_cap ) |
Judge one packed-response length exactly as dispatch does.
Forwards unchanged to the module-private capacity predicate every pack path consults before it writes a byte into caller storage.
| [in] | len | Packed length the generated codec reported. |
| [in] | response_cap | Capacity of the caller's response buffer. |
| k_ra8_ok | The packed response fits and is non-empty. |
| k_ra8_err_invalid_size | The length is zero or exceeds capacity. |
response_cap is the actual writable response capacity. len bytes is in bounds. Definition at line 700 of file ra8_c6link_mdl_service.c.
References internal_mdl_check_response_size(), and RA8_TEST_HELPER.
| bool ra8_mdl_service_field_valid_test | ( | const char * | text, |
| size_t | cap ) |
Judge one decoded request header exactly as dispatch does.
Forwards unchanged to the module-private predicate, so a focused test drives the shipped bound and line-discipline logic rather than a copy.
| [in] | text | Candidate decoded protobuf string, or null. |
| [in] | cap | Maximum extent including the terminating NUL. |
| true | Text terminates before cap and contains no CR or LF. |
| false | Pointer, bound, termination, or line discipline is invalid. |
cap is nonzero. text is readable for at least cap bytes. Definition at line 690 of file ra8_c6link_mdl_service.c.
References internal_mdl_request_field_valid(), and RA8_TEST_HELPER.
| bool ra8_mdl_service_response_valid_test | ( | const ra8_mdl_http_response_t * | response | ) |
Judge one backend terminal response exactly as dispatch does.
Forwards unchanged to the module-private predicate that gates every COMPLETE response before its headers reach the generated packer.
| [in] | response | Candidate status and selected headers. |
| true | Status is HTTP-shaped and every header is bounded single-line. |
| false | Status or a selected header violates the protocol contract. |
response is non-null and fully initialized. Definition at line 695 of file ra8_c6link_mdl_service.c.
References internal_mdl_response_valid(), and RA8_TEST_HELPER.