Refresh both AGENTS guides and clarify module purpose, usage, ownership, threading, return values and wire formats in headers. Remove the unused timeout_heap freed_count field and unimplemented getter.
25 lines
843 B
C
25 lines
843 B
C
/* Обеспечивает идентичность X25519/node_id в INI-файле: проверяет поля и сохраняет исправленные ключи.
|
|
* config_ensure_keys_and_node_id меняет файл на диске; bytes_to_hex только форматирует буфер вызывающего. */
|
|
#ifndef CONFIG_UPDATER_H
|
|
#define CONFIG_UPDATER_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Ensures config file has valid my_private_key, my_public_key, and my_node_id
|
|
// If any are missing or invalid, generates and updates them
|
|
// Returns 0 on success, -1 on error
|
|
int config_ensure_keys_and_node_id(const char *filename);
|
|
|
|
void bytes_to_hex(const uint8_t *bytes, size_t len, char *hex_str, size_t hex_len);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // CONFIG_UPDATER_H
|