MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / runtime_hello_response_encode

Function runtime_hello_response_encode

src/daemon/runtime.c:891–921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889}
890
891static bool runtime_hello_response_encode(uint8_t out[CBM_DAEMON_RENDEZVOUS_RESPONSE_SIZE],
892 const cbm_daemon_runtime_connect_result_t *result) {
893 if (!out || !result) {
894 return false;
895 }
896 memset(out, 0, CBM_DAEMON_RENDEZVOUS_RESPONSE_SIZE);
897 runtime_put_u32(out + RENDEZVOUS_RESPONSE_CONNECT_STATUS_OFFSET, (uint32_t)result->status);
898 runtime_put_u32(out + RENDEZVOUS_RESPONSE_HELLO_STATUS_OFFSET, (uint32_t)result->hello_status);
899 runtime_put_u64(out + RENDEZVOUS_RESPONSE_CLIENT_ID_OFFSET, result->client_id);
900 runtime_put_u64(out + RENDEZVOUS_RESPONSE_PROCESS_ID_OFFSET, result->authenticated_process_id);
901 runtime_put_u32(out + RENDEZVOUS_RESPONSE_CONFLICT_STATUS_OFFSET,
902 (uint32_t)result->conflict.status);
903
904 if (!runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_ACTIVE_VERSION_OFFSET,
905 CBM_DAEMON_RENDEZVOUS_VERSION_TEXT_CAP,
906 result->conflict.active_version, true) ||
907 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_ACTIVE_BUILD_OFFSET,
908 CBM_DAEMON_RENDEZVOUS_BUILD_FINGERPRINT_CAP,
909 result->conflict.active_build_fingerprint, true) ||
910 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_REQUESTED_VERSION_OFFSET,
911 CBM_DAEMON_RENDEZVOUS_VERSION_TEXT_CAP,
912 result->conflict.requested_version, true) ||
913 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_REQUESTED_BUILD_OFFSET,
914 CBM_DAEMON_RENDEZVOUS_BUILD_FINGERPRINT_CAP,
915 result->conflict.requested_build_fingerprint, true) ||
916 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_MESSAGE_OFFSET,
917 CBM_DAEMON_RENDEZVOUS_MESSAGE_CAP, result->message, true)) {
918 return false;
919 }
920 return true;
921}
922
923static bool runtime_hello_response_decode(
924 const uint8_t payload[CBM_DAEMON_RENDEZVOUS_RESPONSE_SIZE],

Callers 1

Calls 3

runtime_put_u32Function · 0.85
runtime_put_u64Function · 0.85

Tested by

no test coverage detected