From 827e90e0daabe32e058e08dd2a253425898a7e7a Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Tue, 17 Feb 2026 19:06:22 +0100 Subject: Replace ClientFindServers with unified Client, use trust store directories Replace the single-purpose ClientFindServers program with a unified Client that supports three operations via CLI: find-servers, get-endpoints, and read-time. This simplifies the architecture by using one client binary with a single config file instead of a monolithic program that did everything in one run. Split the ServerRegister config into separate server and client config files so the LDS-registration credentials are isolated from the server's own settings. The discovery URL moves from config to a CLI argument. Replace repeated trustList config entries with a single trustStore directory path. Each program now points to a directory under certs/trust/ containing .der files, so adding or removing trust is a file-copy operation rather than editing every config file. Add loadTrustStore()/freeTrustStore() to common.c and remove the now-unused configGetAll() from the config parser. Simplify the test matrix from 6 to 4 cases (security and auth are orthogonal, so the full 3x2 matrix is unnecessary). Update run_test.sh to invoke the new Client three times and use port-polling instead of sleep. --- src/config.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 163f601..2165821 100644 --- a/src/config.c +++ b/src/config.c @@ -199,46 +199,6 @@ configRequireInt (const Config *cfg, const char *key, const char *program) return (int)num; } -void -configGetAll (const Config *cfg, const char *key, char ***out, size_t *size) -{ - /* First pass: count matches. */ - size_t count = 0; - for (size_t i = 0; i < cfg->count; i++) - { - if (strcmp (cfg->entries[i].key, key) == 0) - count++; - } - - if (count == 0) - { - *out = NULL; - *size = 0; - return; - } - - /* Second pass: collect pointers. */ - char **arr = malloc (count * sizeof (char *)); - if (!arr) - { - UA_LOG_ERROR (UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, - "Config: out of memory"); - *out = NULL; - *size = 0; - return; - } - - size_t idx = 0; - for (size_t i = 0; i < cfg->count; i++) - { - if (strcmp (cfg->entries[i].key, key) == 0) - arr[idx++] = cfg->entries[i].value; - } - - *out = arr; - *size = count; -} - void configFree (Config *cfg) { -- cgit v1.2.3