diff --git a/Bdd/Targets/Common/BddTargetAppName.c b/Bdd/Targets/Common/BddTargetAppName.c index 06ec56c9..d57e30a3 100644 --- a/Bdd/Targets/Common/BddTargetAppName.c +++ b/Bdd/Targets/Common/BddTargetAppName.c @@ -5,7 +5,7 @@ #include #include -/* Length of ".exe" — used to recognise and strip the Windows executable +/* Length of ".exe" - used to recognise and strip the Windows executable extension so the syslog app name omits it regardless of build platform. */ enum { diff --git a/Bdd/Targets/Common/BddTargetCustomSd.c b/Bdd/Targets/Common/BddTargetCustomSd.c index 7ee4120a..4e7ca174 100644 --- a/Bdd/Targets/Common/BddTargetCustomSd.c +++ b/Bdd/Targets/Common/BddTargetCustomSd.c @@ -4,7 +4,7 @@ #include "SolidSyslogSdValue.h" #include "SolidSyslogStructuredDataDefinition.h" -/* IANA-reserved "example" Private Enterprise Number — safe for documentation. */ +/* IANA-reserved "example" Private Enterprise Number - safe for documentation. */ enum { EXAMPLE_ENTERPRISE_NUMBER = 32473U diff --git a/Bdd/Targets/Common/BddTargetCustomSd.h b/Bdd/Targets/Common/BddTargetCustomSd.h index cd291f20..cc71ee90 100644 --- a/Bdd/Targets/Common/BddTargetCustomSd.h +++ b/Bdd/Targets/Common/BddTargetCustomSd.h @@ -9,7 +9,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* The worked custom SD-ELEMENT for the integrator guide * (docs/structured-data.md). Emits [example@32473 detail="Hello World"]. - * Stateless singleton — handed to SolidSyslog_LogWithSd by the + * Stateless singleton - handed to SolidSyslog_LogWithSd by the * `send-custom` interactive command. */ struct SolidSyslogStructuredData* BddTargetCustomSd_Get(void); diff --git a/Bdd/Targets/Common/BddTargetFatFsMount.c b/Bdd/Targets/Common/BddTargetFatFsMount.c index 29cb4b4a..a6143bf8 100644 --- a/Bdd/Targets/Common/BddTargetFatFsMount.c +++ b/Bdd/Targets/Common/BddTargetFatFsMount.c @@ -1,4 +1,4 @@ -/* ChaN-FatFs implementation of the shared pipeline's FS-mount seam — see +/* ChaN-FatFs implementation of the shared pipeline's FS-mount seam - see * BddTargetFatFsMount.h. Extracted from BddTargetFreeRtosPipeline.c in * SolidSyslog S29.05 when the two FreeRTOS targets first diverged on the * filesystem (FatFs on lwIP, FreeRTOS-Plus-FAT on Plus-TCP). The logic here is @@ -9,12 +9,12 @@ #include "SolidSyslogFatFsFile.h" -#include "ff.h" /* f_mount / f_mkfs — eager mount-or-format on the `set store file` rebuild trigger. */ +#include "ff.h" /* f_mount / f_mkfs - eager mount-or-format on the `set store file` rebuild trigger. */ #include /* FATFS object lives in .bss because f_mount stores its address inside the FatFs - * volume registry — the object must outlive every f_open / f_stat / f_unlink. + * volume registry - the object must outlive every f_open / f_stat / f_unlink. * One per volume (FF_VOLUMES = 1). */ static FATFS fatfs; static bool fatfsMounted = false; @@ -25,10 +25,10 @@ bool BddTargetFatFsMount_Mount(void) { return true; } - FRESULT res = f_mount(&fatfs, "", 1); /* opt=1 → mount immediately, surface FR_NO_FILESYSTEM here */ + FRESULT res = f_mount(&fatfs, "", 1); /* opt=1 -> mount immediately, surface FR_NO_FILESYSTEM here */ if (res == FR_NO_FILESYSTEM) { - /* Fresh disk image — lay down a FAT and re-mount. FM_FAT keeps the + /* Fresh disk image - lay down a FAT and re-mount. FM_FAT keeps the * formatter on FAT12/16; at the shared 8 MiB geometry auto cluster * sizing clears the ~4085-cluster boundary, so this lands FAT16 (the * geometry the FreeRTOS-Plus-FAT formatter needs on the sibling @@ -67,6 +67,6 @@ struct SolidSyslogFile* BddTargetFatFsMount_CreateFile(void) void BddTargetFatFsMount_DestroyFile(struct SolidSyslogFile* file) { - /* FatFsFile_Destroy → Close → f_close flushes the underlying FIL's dir entry. */ + /* FatFsFile_Destroy -> Close -> f_close flushes the underlying FIL's dir entry. */ SolidSyslogFatFsFile_Destroy(file); } diff --git a/Bdd/Targets/Common/BddTargetFatFsMount.h b/Bdd/Targets/Common/BddTargetFatFsMount.h index cc117a69..bb19d8de 100644 --- a/Bdd/Targets/Common/BddTargetFatFsMount.h +++ b/Bdd/Targets/Common/BddTargetFatFsMount.h @@ -15,7 +15,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * (BddTargetPlusFatMount). */ /* Mount volume 0, formatting on first use if the disk image has no FAT - * yet. Idempotent — repeated calls short-circuit on the mounted flag. + * yet. Idempotent - repeated calls short-circuit on the mounted flag. * Returns false on an unrecoverable mount/format failure so the caller * can leave the target on its original store. */ bool BddTargetFatFsMount_Mount(void); diff --git a/Bdd/Targets/Common/BddTargetFreeRtosPipeline.c b/Bdd/Targets/Common/BddTargetFreeRtosPipeline.c index 8c2adb80..a7ff6ac8 100644 --- a/Bdd/Targets/Common/BddTargetFreeRtosPipeline.c +++ b/Bdd/Targets/Common/BddTargetFreeRtosPipeline.c @@ -1,4 +1,4 @@ -/* Shared FreeRTOS BDD-target pipeline — see BddTargetFreeRtosPipeline.h. +/* Shared FreeRTOS BDD-target pipeline - see BddTargetFreeRtosPipeline.h. * * Extracted from the two near-identical FreeRTOS target main.c files * (Bdd/Targets/FreeRtos = FreeRTOS-Plus-TCP, Bdd/Targets/FreeRtosLwip = lwIP) @@ -55,7 +55,7 @@ /* Unprivileged mirror of SOLIDSYSLOG_UDP_DEFAULT_PORT (514) for BDD listeners. */ #define BDD_TARGET_UDP_PORT 5514U -/* The injected platform seam — set once via BddTargetFreeRtosPipeline_SetConfig +/* The injected platform seam - set once via BddTargetFreeRtosPipeline_SetConfig * before the tasks run. */ static const struct BddTargetFreeRtosPipelineConfig* g_config = NULL; @@ -99,8 +99,8 @@ static volatile bool solidSyslogTeardown = false; /* File-backed store storage. Lives in .bss so it persists across the `set store * file` rebuild; only populated when that command fires. STORE_PATH_PREFIX is - * "/STORE" — sequence-numbered filenames land at the volume root as - * /STORE00.log, /STORE01.log, … which fit 8.3 short-filename mode. The leading + * "/STORE" - sequence-numbered filenames land at the volume root as + * /STORE00.log, /STORE01.log, ... which fit 8.3 short-filename mode. The leading * slash makes the path absolute: ChaN-FatFs treats it as the default-drive root * (unchanged behaviour), and FreeRTOS-Plus-FAT's ff_stdio requires an absolute * path when ffconfigHAS_CWD is 0 (its prvABSPath is a pass-through). */ @@ -131,11 +131,11 @@ static size_t pendingCapacityThreshold = 0; * DestroyCurrentStore can release it. */ static const char* pendingSecurityPolicy = "crc16"; static struct SolidSyslogSecurityPolicy* currentPolicy = NULL; -/* The policy kind captured when currentPolicy was built — DestroySecurityPolicy +/* The policy kind captured when currentPolicy was built - DestroySecurityPolicy * must dispatch on this, NOT pendingSecurityPolicy, which a later `set * security-policy` can change out from under the installed policy. */ static const char* installedSecurityPolicy = "crc16"; -/* When true, SolidSyslog gets only the meta SD — timeQuality and origin are +/* When true, SolidSyslog gets only the meta SD - timeQuality and origin are * dropped. Mirrors Linux's --no-sd. */ static volatile bool pendingNoSd = false; @@ -224,7 +224,7 @@ static void GetAppName(struct SolidSyslogHeaderField* field, void* context) SolidSyslogHeaderField_PrintUsAscii(field, appName, strlen(appName)); } -/* No RTC and no time-sync on these reference targets — RFC 5424 §6.2.3.1 +/* No RTC and no time-sync on these reference targets - RFC 5424 §6.2.3.1 * mandates NILVALUE TIMESTAMP, and the timeQuality SD reports tzKnown=0, * isSynced=0. SolidSyslogConfig.Clock=NULL drops through to the library's * NilClock. */ @@ -350,7 +350,7 @@ static bool OnSet(const char* name, const char* value) { return false; } - /* String literal storage — target_driver.py emits one of the three + /* String literal storage - target_driver.py emits one of the three * literals so the pointer stays valid (no copy needed). */ pendingDiscardPolicy = (strcmp(value, "newest") == 0) ? "newest" : ((strcmp(value, "halt") == 0) ? "halt" : "oldest"); @@ -363,7 +363,7 @@ static bool OnSet(const char* name, const char* value) { return false; } - /* String literal storage — see discard-policy above. */ + /* String literal storage - see discard-policy above. */ if (strcmp(value, "hmac-sha256") == 0) { pendingSecurityPolicy = "hmac-sha256"; @@ -406,7 +406,7 @@ static bool OnSet(const char* name, const char* value) } if (strcmp(name, "no-sd") == 0) { - /* `set no-sd 1` drops the SD list to only metaSd — mirrors Linux's + /* `set no-sd 1` drops the SD list to only metaSd - mirrors Linux's * --no-sd. Takes effect via SolidSyslog re-Create. */ unsigned long parsed = 0U; if (!TryParseUInt(value, &parsed)) @@ -418,7 +418,7 @@ static bool OnSet(const char* name, const char* value) } if (strcmp(name, "store") == 0) { - /* "null" is the default state — accept it as a no-op so the harness can + /* "null" is the default state - accept it as a no-op so the harness can * pass --store null without special-casing. "file" triggers the rebuild * (one-way for the lifetime of this QEMU instance). */ if (strcmp(value, "null") == 0) @@ -482,7 +482,7 @@ static bool TryParseUInt(const char* value, unsigned long* out) } /* DEMO KEY ONLY. A real integrator supplies key material from a secure element, - * a KDF, or encrypted NVM via their own SolidSyslogKeyFunction — never a + * a KDF, or encrypted NVM via their own SolidSyslogKeyFunction - never a * hard-coded constant. This exists so the BDD scenario can exercise the mbedTLS * HMAC-SHA256 / AES-256-GCM at-rest policies end-to-end with real crypto. */ static bool BddDemoGetKey(void* context, uint8_t* keyOut, size_t capacity, size_t* keyLengthOut) @@ -514,7 +514,7 @@ static struct SolidSyslogSecurityPolicy* CreateSecurityPolicy(void) else if (strcmp(pendingSecurityPolicy, "aes-256-gcm") == 0) { /* Reuse the TLS module's already-seeded CTR-DRBG as the AEAD nonce - * source — see BddTargetTlsSender_GetRng. Not static const: Rng is a + * source - see BddTargetTlsSender_GetRng. Not static const: Rng is a * runtime handle. */ const struct SolidSyslogMbedTlsAesGcmPolicyConfig aesConfig = {BddDemoGetKey, NULL, BddTargetTlsSender_GetRng()}; @@ -534,12 +534,12 @@ static struct SolidSyslogSecurityPolicy* CreateSecurityPolicy(void) /* `set store file` trigger: swap the default NullStore for a file-backed * BlockStore over the platform FS-mount seam. One-way for the lifetime of this * QEMU instance. The lifecycle mutex blocks the Service task across the - * Destroy → re-Create transition. */ + * Destroy -> re-Create transition. */ static bool RebuildWithFileStore(void) { SolidSyslogMutex_Lock(lifecycleMutex); - /* The FS layer does NOT auto-mount on first open — mount (and + /* The FS layer does NOT auto-mount on first open - mount (and * format-on-first-use) via the platform FS-mount seam before tearing down * the existing store so a mount failure leaves the target running on the * original NullStore (zero-disruption); return false so OnSet reports the @@ -575,7 +575,7 @@ static bool RebuildWithFileStore(void) currentStoreIsFile = true; solidSyslogConfig.Store = currentStore; - /* Re-honour `set no-sd 1` if it arrived before this rebuild — target_driver.py + /* Re-honour `set no-sd 1` if it arrived before this rebuild - target_driver.py * sorts `set no-sd` before `set store file`, so the value is final here. */ solidSyslogConfig.SdCount = pendingNoSd ? 1U : (sizeof(sdList) / sizeof(sdList[0])); solidSyslog = SolidSyslog_Create(&solidSyslogConfig); @@ -598,7 +598,7 @@ static void DestroySecurityPolicy(void) { SolidSyslogCrc16Policy_Destroy(); } - /* else "null": the shared NullSecurityPolicy is immutable — nothing to free. */ + /* else "null": the shared NullSecurityPolicy is immutable - nothing to free. */ currentPolicy = NULL; } @@ -614,7 +614,7 @@ static void DestroyCurrentStore(void) DestroySecurityPolicy(); g_config->DestroyStoreFile(storeFile); } - /* else: NullStore is shared and immutable — nothing to destroy. */ + /* else: NullStore is shared and immutable - nothing to destroy. */ } static enum SolidSyslogDiscardPolicy MapDiscardPolicy(const char* policy) @@ -635,7 +635,7 @@ static void OnStoreFull(void* context) (void) context; if (pendingHaltExit) { - /* Semihosting SYS_EXIT — terminates QEMU with status 2 so the BDD + /* Semihosting SYS_EXIT - terminates QEMU with status 2 so the BDD * harness sees the run end deterministically. Mirrors the Linux * example's _exit(2). */ BddTargetFreeRtosPipeline_Exit(2); @@ -656,8 +656,8 @@ static void OnThresholdCrossed(void* context) (void) printf("[THRESHOLD-CROSSED]\r\n"); } -/* Full teardown of every shared resource. Two entry points — `quit` (falls - * through after BddTargetInteractive_Run returns) and `set shutdown 1` — both +/* Full teardown of every shared resource. Two entry points - `quit` (falls + * through after BddTargetInteractive_Run returns) and `set shutdown 1` - both * route through here. The platform UnmountStore hook fires regardless so the * next session's mount finds STORE*.log directory entries up-to-date * (power_cycle_replay relies on this). The lifecycle mutex held across the @@ -682,7 +682,7 @@ static void TeardownAll(void) /* Wait for Service to observe the teardown flag and vTaskDelete itself * before the lifecycle mutex is destroyed under it. Bounded so a Service - * task that never started (xTaskCreate failure → NULL handle) cannot wedge + * task that never started (xTaskCreate failure -> NULL handle) cannot wedge * teardown. */ if (serviceTaskHandle != NULL) { @@ -701,7 +701,7 @@ static void TeardownAll(void) void BddTargetFreeRtosPipeline_Exit(int status) { - /* SYS_EXIT_EXTENDED (0x20) — the only ARM Semihosting exit form on AArch32 + /* SYS_EXIT_EXTENDED (0x20) - the only ARM Semihosting exit form on AArch32 * that propagates a non-zero status: R1 points to a { reason, subcode } * block. QEMU terminates the VM; the for(;;) is defensive. */ const struct @@ -742,7 +742,7 @@ void BddTargetFreeRtosPipeline_InteractiveTask(void* argument) * very first iteration without a NULL check. */ lifecycleMutex = SolidSyslogFreeRtosMutex_Create(); - /* Default store is NullStore — flipped to the file-backed BlockStore by + /* Default store is NullStore - flipped to the file-backed BlockStore by * `set store file` via RebuildWithFileStore(). */ currentStore = SolidSyslogNullStore_Get(); currentStoreIsFile = false; @@ -773,7 +773,7 @@ void BddTargetFreeRtosPipeline_InteractiveTask(void* argument) .Clock = NULL, .GetHostname = g_config->GetHostname, .GetAppName = GetAppName, - /* PROCID — RFC 5424 §6.2.6 NILVALUE: no process model on these targets. */ + /* PROCID - RFC 5424 §6.2.6 NILVALUE: no process model on these targets. */ .GetProcessId = NULL, .Store = currentStore, .Sd = sdList, @@ -809,7 +809,7 @@ void BddTargetFreeRtosPipeline_ServiceTask(void* argument) /* Wait until the interactive task has finished initial Setup and created the * lifecycle mutex / SolidSyslog. After that the mutex is the source of - * truth — Setup, RebuildWithFileStore, and Teardown all hold it across their + * truth - Setup, RebuildWithFileStore, and Teardown all hold it across their * Destroy/Create transitions. */ while ((lifecycleMutex == NULL) || !solidSyslogReady) { diff --git a/Bdd/Targets/Common/BddTargetFreeRtosPipeline.h b/Bdd/Targets/Common/BddTargetFreeRtosPipeline.h index 149902ed..fd57182f 100644 --- a/Bdd/Targets/Common/BddTargetFreeRtosPipeline.h +++ b/Bdd/Targets/Common/BddTargetFreeRtosPipeline.h @@ -16,19 +16,19 @@ * the CircularBuffer + Service drain task, and the console glue. Both FreeRTOS * BDD targets (Bdd/Targets/FreeRtos = FreeRTOS-Plus-TCP, Bdd/Targets/FreeRtosLwip * = lwIP) drive this; their main.c files keep only the network backend and the - * FS-mount seam behind the config below — the network adapter wiring (PlusTcp vs + * FS-mount seam behind the config below - the network adapter wiring (PlusTcp vs * LwipRaw), the IP-stack bring-up, and the filesystem vendor (FreeRTOS-Plus-FAT * vs ChaN-FatFs) that genuinely differ. See SolidSyslog S29.03 (network seam) * and S29.05 (FS-mount seam). */ -/* Forward declaration — the FS-mount seam traffics in SolidSyslogFile handles +/* Forward declaration - the FS-mount seam traffics in SolidSyslogFile handles * without the pipeline header pulling SolidSyslogFile.h. */ struct SolidSyslogFile; /* The platform seam each target injects via BddTargetFreeRtosPipeline_SetConfig. */ struct BddTargetFreeRtosPipelineConfig { - /* Default destination host before any `set host` — numeric for the no-DNS + /* Default destination host before any `set host` - numeric for the no-DNS * PlusTcp target ("10.0.2.2"); the DNS alias for lwIP ("syslog-ng"). */ const char* DefaultHost; /* Bring up the platform network and build the (Switching) sender, with the @@ -42,7 +42,7 @@ struct BddTargetFreeRtosPipelineConfig * after the shared pipeline teardown (SolidSyslog / SD / store / buffer). */ void (*TeardownNetwork)(void); - /* FS-mount seam — the FS-vendor-specific half of the file-backed store. + /* FS-mount seam - the FS-vendor-specific half of the file-backed store. * The Plus-TCP target wires the FreeRTOS-Plus-FAT shim (BddTargetPlusFatMount); * the lwIP target wires the ChaN-FatFs shim (BddTargetFatFsMount). The * pipeline drives the store machinery (BlockStore / FileBlockDevice / @@ -60,7 +60,7 @@ struct BddTargetFreeRtosPipelineConfig /* Install the platform seam. Call once from main() before the tasks run. */ void BddTargetFreeRtosPipeline_SetConfig(const struct BddTargetFreeRtosPipelineConfig* config); -/* Endpoint callbacks (SolidSyslogEndpointFunction / …VersionFunction shaped), +/* Endpoint callbacks (SolidSyslogEndpointFunction / ...VersionFunction shaped), * reading the shared host/port that `set host` / `set port` rewrite. A target's * BuildSender wires these into its UdpSender / StreamSender configs. */ void BddTargetFreeRtosPipeline_GetEndpoint(struct SolidSyslogEndpoint* endpoint, void* context); @@ -74,14 +74,14 @@ void BddTargetFreeRtosPipeline_InitConsole(uint32_t uartBaseAddress); * the CMSDK UART yield. */ void BddTargetFreeRtosPipeline_Sleep(int milliseconds); -/* ARM Semihosting SYS_EXIT — terminates QEMU with the given status. Used +/* ARM Semihosting SYS_EXIT - terminates QEMU with the given status. Used * internally by the `shutdown` / halt paths; exposed so a target's main() can * bail out on an unrecoverable bring-up failure (e.g. xTaskCreate). */ void BddTargetFreeRtosPipeline_Exit(int status); /* Stack depths as configMINIMAL_STACK_SIZE multipliers (the header cannot see * the FreeRTOS config macro). Each main.c does the xTaskCreate so it controls - * the timing — the PlusTcp target on the network-up hook, lwIP from main(). */ + * the timing - the PlusTcp target on the network-up hook, lwIP from main(). */ #define BDD_TARGET_INTERACTIVE_STACK_MULTIPLIER 48U #define BDD_TARGET_SERVICE_STACK_MULTIPLIER 16U diff --git a/Bdd/Targets/Common/BddTargetInteractive.c b/Bdd/Targets/Common/BddTargetInteractive.c index e215998e..3ba8535e 100644 --- a/Bdd/Targets/Common/BddTargetInteractive.c +++ b/Bdd/Targets/Common/BddTargetInteractive.c @@ -17,8 +17,8 @@ enum * can carry a full path-MTU-class message body without fgets * splitting it across reads. The HandleSet name[] mirrors this size * because the parser splits at the first whitespace; future work - * may decouple the name buffer (always short — RFC 5424 maxima are - * ≤ 255 chars) from the line buffer. */ + * may decouple the name buffer (always short - RFC 5424 maxima are + * <= 255 chars) from the line buffer. */ MAX_LINE_LENGTH = SOLIDSYSLOG_MAX_MESSAGE_SIZE }; diff --git a/Bdd/Targets/Common/BddTargetIps.c b/Bdd/Targets/Common/BddTargetIps.c index 287d41ee..2e90e51d 100644 --- a/Bdd/Targets/Common/BddTargetIps.c +++ b/Bdd/Targets/Common/BddTargetIps.c @@ -6,7 +6,7 @@ enum BDD_TARGET_IP_MAX = 64 /* matches ORIGIN_IP_MAX in OriginSd */ }; -/* Static demo IP — in real deployments this comes from getifaddrs(3) on POSIX, +/* Static demo IP - in real deployments this comes from getifaddrs(3) on POSIX, GetAdaptersAddresses on Windows, or wherever the host's reachable addresses are observed. The library supplies the callback shape; address enumeration is opinionated and left to integrators. diff --git a/Bdd/Targets/Common/BddTargetMtlsConfig.c b/Bdd/Targets/Common/BddTargetMtlsConfig.c index 186f4448..200a9b48 100644 --- a/Bdd/Targets/Common/BddTargetMtlsConfig.c +++ b/Bdd/Targets/Common/BddTargetMtlsConfig.c @@ -74,7 +74,7 @@ void BddTargetMtlsConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint, void* endpoint->Port = BddTargetMtlsConfig_GetPort(); } -/* Static config — host/port never change, so version stays 0 forever and the +/* Static config - host/port never change, so version stays 0 forever and the sender connects exactly once. */ uint32_t BddTargetMtlsConfig_GetEndpointVersion(void* context) { diff --git a/Bdd/Targets/Common/BddTargetMtlsConfig.h b/Bdd/Targets/Common/BddTargetMtlsConfig.h index c07ff914..273ee08d 100644 --- a/Bdd/Targets/Common/BddTargetMtlsConfig.h +++ b/Bdd/Targets/Common/BddTargetMtlsConfig.h @@ -18,14 +18,14 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void BddTargetMtlsConfig_GetEndpoint(struct SolidSyslogEndpoint * endpoint, void* context); uint32_t BddTargetMtlsConfig_GetEndpointVersion(void* context); - /* Override the default mTLS host ("syslog-ng" — Linux compose service + /* Override the default mTLS host ("syslog-ng" - Linux compose service name). Caller owns the string lifetime. Used by per-platform main.c to inject SOLIDSYSLOG_BDD_MTLS_HOST when set. */ void BddTargetMtlsConfig_SetHost(const char* host); /* Override the mTLS server name used for SNI and cert hostname verification, independently of the connection host. See the - matching note in BddTargetTlsConfig.h — FreeRTOS BDD-on-QEMU + matching note in BddTargetTlsConfig.h - FreeRTOS BDD-on-QEMU needs the connection IP separate from the cert subject. */ void BddTargetMtlsConfig_SetServerName(const char* serverName); diff --git a/Bdd/Targets/Common/BddTargetPlusFatMount.c b/Bdd/Targets/Common/BddTargetPlusFatMount.c index 222ac51a..947b25a1 100644 --- a/Bdd/Targets/Common/BddTargetPlusFatMount.c +++ b/Bdd/Targets/Common/BddTargetPlusFatMount.c @@ -1,4 +1,4 @@ -/* FreeRTOS-Plus-FAT implementation of the shared pipeline's FS-mount seam — see +/* FreeRTOS-Plus-FAT implementation of the shared pipeline's FS-mount seam - see * BddTargetPlusFatMount.h. The Plus-FAT sibling of BddTargetFatFsMount: the * volume mount/unmount lives in the FF_Disk_t media driver (FFSemihostingDisk); * the SolidSyslogFile adapter is SolidSyslogPlusFatFile. SolidSyslog S29.05. */ @@ -25,6 +25,6 @@ struct SolidSyslogFile* BddTargetPlusFatMount_CreateFile(void) void BddTargetPlusFatMount_DestroyFile(struct SolidSyslogFile* file) { - /* PlusFatFile_Destroy → Close → ff_fclose flushes the file's dir entry. */ + /* PlusFatFile_Destroy -> Close -> ff_fclose flushes the file's dir entry. */ SolidSyslogPlusFatFile_Destroy(file); } diff --git a/Bdd/Targets/Common/BddTargetTlsConfig.c b/Bdd/Targets/Common/BddTargetTlsConfig.c index dd1224b2..7a37d726 100644 --- a/Bdd/Targets/Common/BddTargetTlsConfig.c +++ b/Bdd/Targets/Common/BddTargetTlsConfig.c @@ -57,7 +57,7 @@ void BddTargetTlsConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint, void* endpoint->Port = BddTargetTlsConfig_GetPort(); } -/* Static config — host/port never change, so version stays 0 forever and the +/* Static config - host/port never change, so version stays 0 forever and the sender connects exactly once. */ uint32_t BddTargetTlsConfig_GetEndpointVersion(void* context) { diff --git a/Bdd/Targets/Common/BddTargetTlsConfig.h b/Bdd/Targets/Common/BddTargetTlsConfig.h index 1f834a30..8b70e6fa 100644 --- a/Bdd/Targets/Common/BddTargetTlsConfig.h +++ b/Bdd/Targets/Common/BddTargetTlsConfig.h @@ -16,7 +16,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void BddTargetTlsConfig_GetEndpoint(struct SolidSyslogEndpoint * endpoint, void* context); uint32_t BddTargetTlsConfig_GetEndpointVersion(void* context); - /* Override the default TLS host ("syslog-ng" — Linux compose service + /* Override the default TLS host ("syslog-ng" - Linux compose service name). Caller owns the string lifetime. Used by the per-platform main.c to inject SOLIDSYSLOG_BDD_TLS_HOST when set, so the same example targets the Linux compose oracle or the Windows OTel oracle @@ -29,7 +29,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN (the Linux / Windows BDD setup uses the cert subject as the connection host), but the FreeRTOS BDD target's QEMU networking needs the connection IP separate - from the cert subject — slirp NAT goes through 10.0.2.2, while + from the cert subject - slirp NAT goes through 10.0.2.2, while the syslog-ng oracle's cert is for "syslog-ng". Caller owns the string lifetime. */ void BddTargetTlsConfig_SetServerName(const char* serverName); diff --git a/Bdd/Targets/Common/BddTargetTlsSender.h b/Bdd/Targets/Common/BddTargetTlsSender.h index 7284b709..8124c737 100644 --- a/Bdd/Targets/Common/BddTargetTlsSender.h +++ b/Bdd/Targets/Common/BddTargetTlsSender.h @@ -19,7 +19,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * DRBG pair on this resource-constrained demo target. Valid once Create has * run (InteractiveTask seeds it during Setup, before any `store file` * rebuild). Returns the address of the file-scope context even if seeding - * failed — the policy's nonce draw then fails closed, which is the correct + * failed - the policy's nonce draw then fails closed, which is the correct * degraded behaviour. */ struct mbedtls_ctr_drbg_context* BddTargetTlsSender_GetRng(void); diff --git a/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_LwipRawTcp.c b/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_LwipRawTcp.c index fd5cae9a..6ce13ccf 100644 --- a/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_LwipRawTcp.c +++ b/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_LwipRawTcp.c @@ -10,14 +10,14 @@ * inner stream swapped for the OS-agnostic LwipRaw adapter. The mbedTLS adapter * takes pre-built handles (mbedtls_ctr_drbg, mbedtls_x509_crt, mbedtls_pk_context) * rather than file paths, because MBEDTLS_FS_IO is disabled in the integrator - * config — there is no host path reachable from QEMU. The demo CA / client cert / + * config - there is no host path reachable from QEMU. The demo CA / client cert / * client key PEMs travel as `static const` arrays in rodata, baked at CMake-time * by xxd -i from Bdd/syslog-ng/tls/ ca.pem / client.pem / client.key. The arrays * are parsed once on first BddTargetTlsSender_Create call. * * Entropy + CTR_DRBG also live in this TU rather than in main.c so all * mbedTLS-specific state is one file's responsibility. The entropy source - * is deliberately weak — see DemoEntropySource — and an audit-trail + * is deliberately weak - see DemoEntropySource - and an audit-trail * WARNING is emitted via printf on first init. */ @@ -82,10 +82,10 @@ static mbedtls_x509_crt clientCertChain; static mbedtls_pk_context clientKey; /* mbedTLS allocates its per-SSL-context IN/OUT buffers (~6 KiB combined) and - * handshake state (~10 KiB) via libc calloc — on this FreeRTOS target that + * handshake state (~10 KiB) via libc calloc - on this FreeRTOS target that * funnels through newlib's tiny syscall heap (~4 KiB, see Common/Syscalls.c), * which can't satisfy a single TLS context. Redirect to pvPortMalloc so - * mbedTLS allocates from the 96 KiB FreeRTOS heap_4 region instead — the + * mbedTLS allocates from the 96 KiB FreeRTOS heap_4 region instead - the * standard FreeRTOS+mbedTLS integration. Gated on MBEDTLS_PLATFORM_MEMORY in * mbedtls_user_config.h. The zero-fill mirrors libc calloc's contract. */ static void* FreeRtosMbedTlsCalloc(size_t nmemb, size_t size) @@ -118,10 +118,10 @@ static void FreeRtosMbedTlsFree(void* ptr) /* PSA crypto's randomness hook (gated on MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG in * the user config). mbedTLS 3.6's TLS 1.3 path drives PSA crypto, and PSA's * built-in entropy collector returns PSA_ERROR_INSUFFICIENT_ENTROPY on - * MBEDTLS_NO_PLATFORM_ENTROPY targets — bypass it by feeding PSA from the + * MBEDTLS_NO_PLATFORM_ENTROPY targets - bypass it by feeding PSA from the * same CTR_DRBG the classic mbedTLS API already uses. The DRBG must be * seeded before psa_crypto_init() so the first PSA crypto operation can - * draw bytes — EnsureMbedTlsInitialised below enforces that ordering. */ + * draw bytes - EnsureMbedTlsInitialised below enforces that ordering. */ psa_status_t mbedtls_psa_external_get_random( mbedtls_psa_external_random_context_t* context, uint8_t* output, @@ -140,7 +140,7 @@ psa_status_t mbedtls_psa_external_get_random( /* Demo-only entropy: XOR the FreeRTOS tick count, a per-call counter, and * the destination address (which varies per call) into each output byte. - * Quality is intentionally terrible — QEMU has no real source — and the + * Quality is intentionally terrible - QEMU has no real source - and the * "demo-only entropy" printf emit at the end of EnsureMbedTlsInitialised * makes that explicit. Real integrators on bare-metal would replace this * with TRNG / HSM bytes. */ @@ -160,7 +160,7 @@ static int DemoEntropySource(void* data, unsigned char* output, size_t len, size static void RtosSleep(int milliseconds) { - /* Same rounding rule as the CmsdkUart sleep in main.c — sub-tick requests + /* Same rounding rule as the CmsdkUart sleep in main.c - sub-tick requests * must still block the task, otherwise vTaskDelay(0) just yields. */ TickType_t ticks = pdMS_TO_TICKS((TickType_t) milliseconds); if ((milliseconds > 0) && (ticks == 0U)) @@ -177,7 +177,7 @@ static void RtosSleep(int milliseconds) * * Each major step emits a printf diagnostic and yields one tick to the * FreeRTOS scheduler. Under QEMU mps2-an385 the DRBG seed + cert/key parses - * can each take several seconds (mbedTLS does serious crypto work — RSA key + * can each take several seconds (mbedTLS does serious crypto work - RSA key * parse, ECDHE primes, ASN.1 walks); without the yields, lower-priority tasks * would starve until init finishes, and without the diagnostic prints the * boot would appear to hang. */ @@ -189,13 +189,13 @@ static void EnsureMbedTlsInitialised(void) } /* Boot diagnostics via printf rather than SolidSyslog_Error because main's - * error handler installation happens AFTER BddTargetTlsSender_Create — + * error handler installation happens AFTER BddTargetTlsSender_Create - * the default no-op handler would otherwise swallow these. */ (void) printf("[mbedtls] init entropy + DRBG seed (slow under QEMU)\r\n"); vTaskDelay(1U); /* Redirect mbedTLS allocations to the FreeRTOS heap before any - * mbedtls_*_init runs. Must come first — once an ssl_setup runs against + * mbedtls_*_init runs. Must come first - once an ssl_setup runs against * the default libc calloc and fails, the failure mode is heap exhaustion * inside newlib's 4 KiB syscall heap, not a recoverable error. */ mbedtls_platform_set_calloc_free(FreeRtosMbedTlsCalloc, FreeRtosMbedTlsFree); @@ -205,7 +205,7 @@ static void EnsureMbedTlsInitialised(void) * randomness is intentionally terrible. The STRONG/WEAK label is * checked structurally by `mbedtls_entropy_func`, which requires at * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes of strong contribution per - * call — without any strong source registered, every + * call - without any strong source registered, every * `mbedtls_ctr_drbg_seed` returns ENTROPY_SOURCE_FAILED (-0x0034) * after looping 256 times trying to satisfy the threshold. The * "demo-only entropy" notice printed at the end of this function is @@ -237,7 +237,7 @@ static void EnsureMbedTlsInitialised(void) * MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG in the user config disables PSA's * built-in entropy collector (which would otherwise return * PSA_ERROR_INSUFFICIENT_ENTROPY on this no-platform-entropy target), so - * the init only succeeds once the DRBG is seeded above — that's why this + * the init only succeeds once the DRBG is seeded above - that's why this * sits after the seed step. Idempotent across subsequent calls. */ psa_status_t psaRc = psa_crypto_init(); if (psaRc != PSA_SUCCESS) @@ -304,7 +304,7 @@ static void EnsureMbedTlsInitialised(void) * entropy explicitly. Integrators porting this off the BDD target should * see this and replace DemoEntropySource with TRNG before shipping. The * `mbedTlsInitialised = true` latch happens only after every fail-able - * step above has succeeded — partial-init state would silently degrade + * step above has succeeded - partial-init state would silently degrade * later handshakes into confusing "internal" errors. */ (void) printf("[mbedtls] init complete. WARNING: demo-only entropy " "(xTaskGetTickCount + per-call counter). Not for production.\r\n"); @@ -319,7 +319,7 @@ static void EnsureMbedTlsInitialised(void) * 6515) differs at Connect time. The mTLS port's syslog-ng listener * peer-verifies the client cert that the wrapper wires unconditionally * below, and the plain-TLS port's listener accepts it as optional-untrusted - * — so the same client identity works on both ports. */ + * - so the same client identity works on both ports. */ static void DispatchEndpoint(struct SolidSyslogEndpoint* endpoint, void* context) { if (BddTargetSwitchConfig_IsMtlsMode()) @@ -341,7 +341,7 @@ static uint32_t DispatchEndpointVersion(void* context) struct SolidSyslogSender* BddTargetTlsSender_Create(struct SolidSyslogResolver* resolver, bool mtls) { /* `mtls` is honoured for cross-platform contract uniformity but does not - * gate cert wiring on FreeRTOS — both TLS and mTLS BDD scenarios share + * gate cert wiring on FreeRTOS - both TLS and mTLS BDD scenarios share * one Switching slot here, and `set transport mtls` arrives over the UART * AFTER this Create call has run. Wiring the client identity * unconditionally lets the dispatcher above flip ports at runtime without @@ -353,7 +353,7 @@ struct SolidSyslogSender* BddTargetTlsSender_Create(struct SolidSyslogResolver* { /* EnsureMbedTlsInitialised already printed a [mbedtls] ... FAILED * diagnostic explaining which step tripped. Returning the shared - * NullSender here keeps the bad-setup contract intact — the + * NullSender here keeps the bad-setup contract intact - the * SwitchingSender's tls slot drops messages cleanly rather than * failing opaquely later inside MbedTlsStream_Open, and the * statics below stay NULL so BddTargetTlsSender_Destroy can @@ -404,7 +404,7 @@ struct SolidSyslogSender* BddTargetTlsSender_Create(struct SolidSyslogResolver* void BddTargetTlsSender_Destroy(void) { /* If EnsureMbedTlsInitialised failed, Create short-circuited to the - * shared NullSender and never assigned the file-scope statics — there + * shared NullSender and never assigned the file-scope statics - there * is nothing to release. The pool-backed Destroy helpers tolerate * a NULL handle but skipping makes the no-op explicit. */ if (sender == NULL) @@ -416,7 +416,7 @@ void BddTargetTlsSender_Destroy(void) SolidSyslogMbedTlsStream_Destroy(tlsStream); SolidSyslogLwipRawTcpStream_Destroy(underlyingStream); - /* Entropy / DRBG / parsed certs survive across Destroy → Create cycles to + /* Entropy / DRBG / parsed certs survive across Destroy -> Create cycles to * avoid re-seeding on every reconnect. Real teardown only happens at * process exit, which the FreeRTOS target never reaches. */ } diff --git a/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_PlusTcpTcp.c b/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_PlusTcpTcp.c index c608150b..0645d988 100644 --- a/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_PlusTcpTcp.c +++ b/Bdd/Targets/Common/BddTargetTlsSender_MbedTls_PlusTcpTcp.c @@ -8,7 +8,7 @@ * Mirrors BddTargetTlsSender_OpenSsl_PosixTcp.c on the POSIX target. The * mbedTLS adapter takes pre-built handles (mbedtls_ctr_drbg, mbedtls_x509_crt, * mbedtls_pk_context) rather than file paths, because MBEDTLS_FS_IO is - * disabled in the integrator config — there is no host path reachable from + * disabled in the integrator config - there is no host path reachable from * QEMU. The demo CA / client cert / client key PEMs travel as `static const` * arrays in rodata, baked at CMake-time by xxd -i from * Bdd/syslog-ng/tls/ ca.pem / client.pem / client.key. The arrays are @@ -16,7 +16,7 @@ * * Entropy + CTR_DRBG also live in this TU rather than in main.c so all * mbedTLS-specific state is one file's responsibility. The entropy source - * is deliberately weak — see DemoEntropySource — and an audit-trail + * is deliberately weak - see DemoEntropySource - and an audit-trail * WARNING is emitted via SolidSyslog_Error on first init. */ @@ -81,10 +81,10 @@ static mbedtls_x509_crt clientCertChain; static mbedtls_pk_context clientKey; /* mbedTLS allocates its per-SSL-context IN/OUT buffers (~6 KiB combined) and - * handshake state (~10 KiB) via libc calloc — on this FreeRTOS target that + * handshake state (~10 KiB) via libc calloc - on this FreeRTOS target that * funnels through newlib's tiny syscall heap (~4 KiB, see Common/Syscalls.c), * which can't satisfy a single TLS context. Redirect to pvPortMalloc so - * mbedTLS allocates from the 96 KiB FreeRTOS heap_4 region instead — the + * mbedTLS allocates from the 96 KiB FreeRTOS heap_4 region instead - the * standard FreeRTOS+mbedTLS integration. Gated on MBEDTLS_PLATFORM_MEMORY in * mbedtls_user_config.h. The zero-fill mirrors libc calloc's contract. */ static void* FreeRtosMbedTlsCalloc(size_t nmemb, size_t size) @@ -117,10 +117,10 @@ static void FreeRtosMbedTlsFree(void* ptr) /* PSA crypto's randomness hook (gated on MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG in * the user config). mbedTLS 3.6's TLS 1.3 path drives PSA crypto, and PSA's * built-in entropy collector returns PSA_ERROR_INSUFFICIENT_ENTROPY on - * MBEDTLS_NO_PLATFORM_ENTROPY targets — bypass it by feeding PSA from the + * MBEDTLS_NO_PLATFORM_ENTROPY targets - bypass it by feeding PSA from the * same CTR_DRBG the classic mbedTLS API already uses. The DRBG must be * seeded before psa_crypto_init() so the first PSA crypto operation can - * draw bytes — EnsureMbedTlsInitialised below enforces that ordering. */ + * draw bytes - EnsureMbedTlsInitialised below enforces that ordering. */ psa_status_t mbedtls_psa_external_get_random( mbedtls_psa_external_random_context_t* context, uint8_t* output, @@ -139,7 +139,7 @@ psa_status_t mbedtls_psa_external_get_random( /* Demo-only entropy: XOR the FreeRTOS tick count, a per-call counter, and * the destination address (which varies per call) into each output byte. - * Quality is intentionally terrible — QEMU has no real source — and the + * Quality is intentionally terrible - QEMU has no real source - and the * "demo-only entropy" printf emit at the end of EnsureMbedTlsInitialised * makes that explicit. Real integrators on bare-metal would replace this * with TRNG / HSM bytes. */ @@ -159,7 +159,7 @@ static int DemoEntropySource(void* data, unsigned char* output, size_t len, size static void RtosSleep(int milliseconds) { - /* Same rounding rule as the CmsdkUart sleep in main.c — sub-tick requests + /* Same rounding rule as the CmsdkUart sleep in main.c - sub-tick requests * must still block the task, otherwise vTaskDelay(0) just yields. */ TickType_t ticks = pdMS_TO_TICKS((TickType_t) milliseconds); if ((milliseconds > 0) && (ticks == 0U)) @@ -177,7 +177,7 @@ static void RtosSleep(int milliseconds) * Each major step emits a SolidSyslog_Error INFO message and yields one * tick to the FreeRTOS scheduler. Under QEMU mps2-an385 the DRBG seed + * cert/key parses can each take several seconds (mbedTLS does serious - * crypto work — RSA key parse, ECDHE primes, ASN.1 walks); without the + * crypto work - RSA key parse, ECDHE primes, ASN.1 walks); without the * yields, lower-priority tasks would starve until init finishes, and * without the diagnostic prints the boot would appear to hang. */ static void EnsureMbedTlsInitialised(void) @@ -188,13 +188,13 @@ static void EnsureMbedTlsInitialised(void) } /* Boot diagnostics via printf rather than SolidSyslog_Error because main's - * error handler installation happens AFTER BddTargetTlsSender_Create — + * error handler installation happens AFTER BddTargetTlsSender_Create - * the default no-op handler would otherwise swallow these. */ (void) printf("[mbedtls] init entropy + DRBG seed (slow under QEMU)\r\n"); vTaskDelay(1U); /* Redirect mbedTLS allocations to the FreeRTOS heap before any - * mbedtls_*_init runs. Must come first — once an ssl_setup runs against + * mbedtls_*_init runs. Must come first - once an ssl_setup runs against * the default libc calloc and fails, the failure mode is heap exhaustion * inside newlib's 4 KiB syscall heap, not a recoverable error. */ mbedtls_platform_set_calloc_free(FreeRtosMbedTlsCalloc, FreeRtosMbedTlsFree); @@ -204,7 +204,7 @@ static void EnsureMbedTlsInitialised(void) * randomness is intentionally terrible. The STRONG/WEAK label is * checked structurally by `mbedtls_entropy_func`, which requires at * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes of strong contribution per - * call — without any strong source registered, every + * call - without any strong source registered, every * `mbedtls_ctr_drbg_seed` returns ENTROPY_SOURCE_FAILED (-0x0034) * after looping 256 times trying to satisfy the threshold. The * "demo-only entropy" notice printed at the end of this function is @@ -236,7 +236,7 @@ static void EnsureMbedTlsInitialised(void) * MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG in the user config disables PSA's * built-in entropy collector (which would otherwise return * PSA_ERROR_INSUFFICIENT_ENTROPY on this no-platform-entropy target), so - * the init only succeeds once the DRBG is seeded above — that's why this + * the init only succeeds once the DRBG is seeded above - that's why this * sits after the seed step. Idempotent across subsequent calls. */ psa_status_t psaRc = psa_crypto_init(); if (psaRc != PSA_SUCCESS) @@ -303,7 +303,7 @@ static void EnsureMbedTlsInitialised(void) * entropy explicitly. Integrators porting this off the BDD target should * see this and replace DemoEntropySource with TRNG before shipping. The * `mbedTlsInitialised = true` latch happens only after every fail-able - * step above has succeeded — partial-init state would silently degrade + * step above has succeeded - partial-init state would silently degrade * later handshakes into confusing "internal" errors. */ (void) printf("[mbedtls] init complete. WARNING: demo-only entropy " "(xTaskGetTickCount + per-call counter). Not for production.\r\n"); @@ -318,7 +318,7 @@ static void EnsureMbedTlsInitialised(void) * 6515) differs at Connect time. The mTLS port's syslog-ng listener * peer-verifies the client cert that the wrapper wires unconditionally * below, and the plain-TLS port's listener accepts it as optional-untrusted - * — so the same client identity works on both ports. */ + * - so the same client identity works on both ports. */ static void DispatchEndpoint(struct SolidSyslogEndpoint* endpoint, void* context) { if (BddTargetSwitchConfig_IsMtlsMode()) @@ -340,7 +340,7 @@ static uint32_t DispatchEndpointVersion(void* context) struct SolidSyslogSender* BddTargetTlsSender_Create(struct SolidSyslogResolver* resolver, bool mtls) { /* `mtls` is honoured for cross-platform contract uniformity but does not - * gate cert wiring on FreeRTOS — both TLS and mTLS BDD scenarios share + * gate cert wiring on FreeRTOS - both TLS and mTLS BDD scenarios share * one Switching slot here, and `set transport mtls` arrives over the UART * AFTER this Create call has run. Wiring the client identity * unconditionally lets the dispatcher above flip ports at runtime without @@ -352,7 +352,7 @@ struct SolidSyslogSender* BddTargetTlsSender_Create(struct SolidSyslogResolver* { /* EnsureMbedTlsInitialised already printed a [mbedtls] ... FAILED * diagnostic explaining which step tripped. Returning the shared - * NullSender here keeps the bad-setup contract intact — the + * NullSender here keeps the bad-setup contract intact - the * SwitchingSender's tls slot drops messages cleanly rather than * failing opaquely later inside MbedTlsStream_Open, and the * statics below stay NULL so BddTargetTlsSender_Destroy can @@ -393,7 +393,7 @@ struct SolidSyslogSender* BddTargetTlsSender_Create(struct SolidSyslogResolver* void BddTargetTlsSender_Destroy(void) { /* If EnsureMbedTlsInitialised failed, Create short-circuited to the - * shared NullSender and never assigned the file-scope statics — there + * shared NullSender and never assigned the file-scope statics - there * is nothing to release. The pool-backed Destroy helpers tolerate * a NULL handle but skipping makes the no-op explicit. */ if (sender == NULL) @@ -405,7 +405,7 @@ void BddTargetTlsSender_Destroy(void) SolidSyslogMbedTlsStream_Destroy(tlsStream); SolidSyslogPlusTcpTcpStream_Destroy(underlyingStream); - /* Entropy / DRBG / parsed certs survive across Destroy → Create cycles to + /* Entropy / DRBG / parsed certs survive across Destroy -> Create cycles to * avoid re-seeding on every reconnect. Real teardown only happens at * process exit, which the FreeRTOS target never reaches. */ } diff --git a/Bdd/Targets/Common/FFSemihostingDisk.c b/Bdd/Targets/Common/FFSemihostingDisk.c index fc6724e2..a7212abc 100644 --- a/Bdd/Targets/Common/FFSemihostingDisk.c +++ b/Bdd/Targets/Common/FFSemihostingDisk.c @@ -1,5 +1,5 @@ /* FreeRTOS-Plus-FAT FF_Disk_t media driver over the shared semihosting flat - * disk — see FFSemihostingDisk.h. Block read/write delegate to SemihostingDisk + * disk - see FFSemihostingDisk.h. Block read/write delegate to SemihostingDisk * (the same host image + BKPT 0xAB trap the ChaN-FatFs diskio.c uses). The IO * manager / partition / format / mount sequence mirrors Plus-FAT's reference * portable/common/ff_ramdisk.c, with format made first-use-only so a persistent diff --git a/Bdd/Targets/Common/FFSemihostingDisk.h b/Bdd/Targets/Common/FFSemihostingDisk.h index c71d98c7..164921a5 100644 --- a/Bdd/Targets/Common/FFSemihostingDisk.h +++ b/Bdd/Targets/Common/FFSemihostingDisk.h @@ -10,21 +10,21 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* FreeRTOS-Plus-FAT FF_Disk_t media driver over the shared semihosting flat * disk (SemihostingDisk) for the QEMU mps2-an385 BDD target. The Plus-FAT * analogue of the ChaN-FatFs diskio.c glue: same host image, same 8 MiB - * FAT16 geometry, same BKPT 0xAB trap — only the vtable shape differs + * FAT16 geometry, same BKPT 0xAB trap - only the vtable shape differs * (FF_Disk_t block callbacks vs ChaN's global disk_*). Modelled on Plus-FAT's * own portable/common/ff_ramdisk.c reference driver, but persistent (the host * image survives the run) so it mounts an existing FAT and only partitions + - * formats on a fresh / zero-filled image — format-on-first-use, not + * formats on a fresh / zero-filled image - format-on-first-use, not * format-always. * * The single FF_Disk_t volume lives in this TU; the FF_IOManager cache is - * allocated internally by Plus-FAT from the FreeRTOS heap (heap_4) — the one + * allocated internally by Plus-FAT from the FreeRTOS heap (heap_4) - the one * place this target allocates for the filesystem, exactly the documented * vendor-allocates stance. Registered into ff_stdio's virtual FS at "/". * Introduced in SolidSyslog S29.05. */ /* Ensure the host image, build the IO manager, mount (formatting on first - * use), and register the volume at "/". Idempotent — repeated calls + * use), and register the volume at "/". Idempotent - repeated calls * short-circuit once mounted. Returns true once the volume is mounted. */ bool FFSemihostingDisk_Mount(void); diff --git a/Bdd/Targets/Common/SemihostingDisk.c b/Bdd/Targets/Common/SemihostingDisk.c index 7ecc6e72..0225d829 100644 --- a/Bdd/Targets/Common/SemihostingDisk.c +++ b/Bdd/Targets/Common/SemihostingDisk.c @@ -1,4 +1,4 @@ -/* Host-backed flat-disk media access over ARM semihosting — see +/* Host-backed flat-disk media access over ARM semihosting - see * SemihostingDisk.h. The BKPT 0xAB trap and the open / read / write / seek / * length / close primitives were extracted from diskio.c in SolidSyslog S29.05 * so the FreeRTOS-Plus-FAT FF_Disk_t driver (FFSemihostingDisk.c) shares the @@ -64,7 +64,7 @@ bool SemihostingDisk_EnsureReady(void) g_diskHandle = -1; } /* Create or truncate a fresh image. Sparse-extend by seeking to the - * last byte and writing one zero — POSIX hosts under semihosting + * last byte and writing one zero - POSIX hosts under semihosting * back-fill the hole with zeros on read, which is what the filesystem * needs to see no FAT and fall through to format-on-first-use. */ g_diskHandle = SemihostingOpen(DISK_IMAGE_PATH, SEMIHOSTING_MODE_WRITE_PLUS_BINARY); diff --git a/Bdd/Targets/Common/SemihostingDisk.h b/Bdd/Targets/Common/SemihostingDisk.h index e8412df9..c0f0a983 100644 --- a/Bdd/Targets/Common/SemihostingDisk.h +++ b/Bdd/Targets/Common/SemihostingDisk.h @@ -12,7 +12,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * shared by both filesystem media drivers on the QEMU mps2-an385 BDD * targets: the ChaN-FatFs disk_* glue (diskio.c) and the FreeRTOS-Plus-FAT * FF_Disk_t driver (FFSemihostingDisk.c). One image, one geometry, one - * semihosting trap — so a FatFs run and a Plus-FAT run exercise byte-for- + * semihosting trap - so a FatFs run and a Plus-FAT run exercise byte-for- * byte the same host file (solidsyslog-disk.img in QEMU's working dir). * * Behave's after_scenario removes the image so each scenario starts with @@ -21,7 +21,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * a zero-filled image and the integrator falls through to format-on-first- * use. * - * Single logical drive; 16384 sectors x 512 B = 8 MiB — large enough for + * Single logical drive; 16384 sectors x 512 B = 8 MiB - large enough for * the store-and-forward / capacity / power-cycle scenarios that exercise * multi-block files, and clear of the ~4085-cluster FAT12/16 boundary so * both formatters land FAT16. */ @@ -40,7 +40,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN }; /* Open the host image, creating + sparse-extending a fresh zero-filled 8 MiB - * file on first use. Idempotent — repeated calls short-circuit on the cached + * file on first use. Idempotent - repeated calls short-circuit on the cached * handle. Returns true once a usable handle is held. */ bool SemihostingDisk_EnsureReady(void); diff --git a/Bdd/Targets/Common/diskio.c b/Bdd/Targets/Common/diskio.c index 7f6b6678..f5e116dd 100644 --- a/Bdd/Targets/Common/diskio.c +++ b/Bdd/Targets/Common/diskio.c @@ -105,7 +105,7 @@ DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void* buff) { case CTRL_SYNC: /* QEMU semihosting writes are synchronous against the host - * file — no kernel-level dirty pages we need to flush. */ + * file - no kernel-level dirty pages we need to flush. */ return RES_OK; case GET_SECTOR_COUNT: *(LBA_t*) buff = (LBA_t) SEMIHOSTING_DISK_SECTOR_COUNT; diff --git a/Bdd/Targets/Common/ffconf.h b/Bdd/Targets/Common/ffconf.h index 8f34ed78..5a127ddc 100644 --- a/Bdd/Targets/Common/ffconf.h +++ b/Bdd/Targets/Common/ffconf.h @@ -1,5 +1,5 @@ /* FatFs integrator configuration shared by the FreeRTOS-Plus-TCP and lwIP - * BDD targets on QEMU mps2-an385. FF_VOLUMES=1 — single logical drive on + * BDD targets on QEMU mps2-an385. FF_VOLUMES=1 - single logical drive on * the semihosting disk image; FF_USE_MKFS=1 so disk_initialize can fall * through to * f_mkfs when the image is fresh (after_scenario deletes @@ -7,13 +7,13 @@ * with no filesystem and the integrator formats on first mount). * * FF_FS_REENTRANT=1 even though only the Service task touches the - * store today — the future reentrancy stress test exercises the + * store today - the future reentrancy stress test exercises the * production lock path with mutexes already in place rather than * having to wire them in later. ffsystem.c uses OS_TYPE 3 (FreeRTOS * dynamic xSemaphoreCreateMutex); see project_s08_05_fatfs_reentrancy_decision * for the trade-off vs SolidSyslogMutex. */ -#define FFCONF_DEF 80386 /* Revision ID — must match FF_DEFINED in ff.h */ +#define FFCONF_DEF 80386 /* Revision ID - must match FF_DEFINED in ff.h */ /* Function Configurations */ #define FF_FS_READONLY 0 @@ -31,7 +31,7 @@ #define FF_STRF_ENCODE 0 /* Locale and Namespace */ -#define FF_CODE_PAGE 437 /* Latin1 — avoids pulling in DBCS sub-tables when LFN=0. */ +#define FF_CODE_PAGE 437 /* Latin1 - avoids pulling in DBCS sub-tables when LFN=0. */ #define FF_USE_LFN 0 /* Short 8.3 filenames; pathPrefix scheme fits (e.g. STORE00.LOG). */ #define FF_MAX_LFN 255 #define FF_LFN_UNICODE 0 @@ -54,12 +54,12 @@ /* System */ #define FF_FS_TINY 0 #define FF_FS_EXFAT 0 -#define FF_FS_NORTC 1 /* No RTC on the QEMU target — fixed-date stamps. */ +#define FF_FS_NORTC 1 /* No RTC on the QEMU target - fixed-date stamps. */ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2026 #define FF_FS_CRTIME 0 #define FF_FS_NOFSINFO 0 #define FF_FS_LOCK 0 -#define FF_FS_REENTRANT 1 /* Forward-looking — exercise the lock path before stress tests need it. */ +#define FF_FS_REENTRANT 1 /* Forward-looking - exercise the lock path before stress tests need it. */ #define FF_FS_TIMEOUT 1000 diff --git a/Bdd/Targets/FreeRtos/Common/Syscalls.c b/Bdd/Targets/FreeRtos/Common/Syscalls.c index 10bf27b7..a580d277 100644 --- a/Bdd/Targets/FreeRtos/Common/Syscalls.c +++ b/Bdd/Targets/FreeRtos/Common/Syscalls.c @@ -9,7 +9,7 @@ * that send carriage-return on Enter still terminate fgets, and each * received byte is echoed back over TX so the user sees what they type. * - * Not host-TDD'd — this file exists only in the cross build (gated by + * Not host-TDD'd - this file exists only in the cross build (gated by * CMAKE_CROSSCOMPILING + arm in the top-level CMakeLists.txt). The QEMU * smoke is the integration check that proves the path end-to-end. */ diff --git a/Bdd/Targets/FreeRtos/Common/startup.c b/Bdd/Targets/FreeRtos/Common/startup.c index 437f9dff..4cdc30da 100644 --- a/Bdd/Targets/FreeRtos/Common/startup.c +++ b/Bdd/Targets/FreeRtos/Common/startup.c @@ -20,7 +20,7 @@ extern void __libc_init_array(void); void Reset_Handler(void); void Default_Handler(void); -/* Cortex-M core exception handlers — weak so user code can override. */ +/* Cortex-M core exception handlers - weak so user code can override. */ void NMI_Handler(void) __attribute__((weak, alias("Default_Handler"))); void HardFault_Handler(void) __attribute__((weak, alias("Default_Handler"))); void MemManage_Handler(void) __attribute__((weak, alias("Default_Handler"))); @@ -56,7 +56,7 @@ void Reset_Handler(void) (void) main(); - /* main() returned — trap. */ + /* main() returned - trap. */ for (;;) { } @@ -72,8 +72,8 @@ void Default_Handler(void) /* Cortex-M3 vector table at the start of FLASH. */ __attribute__((section(".vectors"), used)) const uint32_t vector_table[] = { - (uint32_t) &_estack, /* 0x00 — initial stack pointer */ - (uint32_t) Reset_Handler, /* 0x04 — reset */ + (uint32_t) &_estack, /* 0x00 - initial stack pointer */ + (uint32_t) Reset_Handler, /* 0x04 - reset */ (uint32_t) NMI_Handler, /* 0x08 */ (uint32_t) HardFault_Handler, /* 0x0C */ (uint32_t) MemManage_Handler, /* 0x10 */ @@ -83,9 +83,9 @@ __attribute__((section(".vectors"), used)) const uint32_t vector_table[] = { 0U, 0U, 0U, /* 0x1C-0x28 reserved */ - (uint32_t) SVC_Handler, /* 0x2C — FreeRTOS */ + (uint32_t) SVC_Handler, /* 0x2C - FreeRTOS */ (uint32_t) DebugMon_Handler, /* 0x30 */ 0U, /* 0x34 reserved */ - (uint32_t) PendSV_Handler, /* 0x38 — FreeRTOS */ - (uint32_t) SysTick_Handler, /* 0x3C — FreeRTOS */ + (uint32_t) PendSV_Handler, /* 0x38 - FreeRTOS */ + (uint32_t) SysTick_Handler, /* 0x3C - FreeRTOS */ }; diff --git a/Bdd/Targets/FreeRtos/FreeRTOSConfig.h b/Bdd/Targets/FreeRtos/FreeRTOSConfig.h index a29514cd..d9811a48 100644 --- a/Bdd/Targets/FreeRtos/FreeRTOSConfig.h +++ b/Bdd/Targets/FreeRtos/FreeRTOSConfig.h @@ -33,7 +33,7 @@ * (xSemaphoreCreateMutexStatic places the StaticSemaphore_t inside the * caller-supplied storage). The idle / timer task memory hooks that * static allocation also pulls in are satisfied by the kernel's own - * defaults (configKERNEL_PROVIDED_STATIC_MEMORY = 1) — no boilerplate + * defaults (configKERNEL_PROVIDED_STATIC_MEMORY = 1) - no boilerplate * in main.c, no MPU port. Dynamic allocation stays on for Plus-TCP's * network buffer descriptors and the interactive / service tasks * created via xTaskCreate. */ diff --git a/Bdd/Targets/FreeRtos/FreeRTOSFATConfig.h b/Bdd/Targets/FreeRtos/FreeRTOSFATConfig.h index 299c89b7..55ac7083 100644 --- a/Bdd/Targets/FreeRtos/FreeRTOSFATConfig.h +++ b/Bdd/Targets/FreeRtos/FreeRTOSFATConfig.h @@ -3,7 +3,7 @@ * this file (after FreeRTOS.h) and FreeRTOSFATConfigDefaults.h fills in every * value not set here. Resolved off the -I path (ff_headers.h's `#include * "FreeRTOSFATConfig.h"` finds no copy beside itself), so no source staging is - * needed — unlike ChaN-FatFs's ffconf.h. Introduced in SolidSyslog S29.05. + * needed - unlike ChaN-FatFs's ffconf.h. Introduced in SolidSyslog S29.05. * * Mirrors the host-test config in Tests/Support/PlusFatFakes/Interface so the * adapter sees the same Plus-FAT layout on-target as under host TDD. The @@ -20,7 +20,7 @@ * sizes configNUM_THREAD_LOCAL_STORAGE_POINTERS to cover the three slots. */ #define ffconfigCWD_THREAD_LOCAL_INDEX (0) -/* The store uses absolute 8.3 paths at the volume root (/STORE00.log, …), so +/* The store uses absolute 8.3 paths at the volume root (/STORE00.log, ...), so * relative-path / long-filename support is left at the defaults (both off). */ #endif /* FREERTOSFATCONFIG_H */ diff --git a/Bdd/Targets/FreeRtos/FreeRTOSIPConfig.h b/Bdd/Targets/FreeRtos/FreeRTOSIPConfig.h index 07b53a38..333238ab 100644 --- a/Bdd/Targets/FreeRtos/FreeRTOSIPConfig.h +++ b/Bdd/Targets/FreeRtos/FreeRTOSIPConfig.h @@ -37,7 +37,7 @@ #define ipconfigSUPPORT_SELECT_FUNCTION 0 #define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1 -/* Doubled from 8 — TCP needs descriptors for its retransmit window in +/* Doubled from 8 - TCP needs descriptors for its retransmit window in * addition to the in-flight UDP frames, and 8 is already tight on the BDD * scenarios. The extra ~3 KB of .bss is trivial against mps2-an385 SRAM. */ #define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 16 diff --git a/Bdd/Targets/FreeRtos/Startup.c b/Bdd/Targets/FreeRtos/Startup.c index d5e4edc1..691ea9e9 100644 --- a/Bdd/Targets/FreeRtos/Startup.c +++ b/Bdd/Targets/FreeRtos/Startup.c @@ -1,4 +1,4 @@ -/* Cortex-M3 startup for the QEMU mps2-an385 machine — variant for the +/* Cortex-M3 startup for the QEMU mps2-an385 machine - variant for the * FreeRTOS-Plus-TCP single-task example. * * Differs from Bdd/Targets/FreeRtos/Common/startup.c by extending the vector @@ -33,7 +33,7 @@ void SVC_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); -/* Provided by the Plus-TCP MPS2_AN385 NetworkInterface.c — drained by the +/* Provided by the Plus-TCP MPS2_AN385 NetworkInterface.c - drained by the * EMAC RX task on each task notification. */ void EthernetISR(void) __attribute__((weak, alias("Default_Handler"))); @@ -70,12 +70,12 @@ void Default_Handler(void) } /* Cortex-M3 vector table. System exceptions (entries 0..15) followed by 32 - * external IRQs. Only IRQ 13 is wired to a real handler — every other slot + * external IRQs. Only IRQ 13 is wired to a real handler - every other slot * traps via Default_Handler so a stray interrupt is debuggable rather than * silently jumping into 0xFFFFFFFF. */ __attribute__((section(".vectors"), used)) const uint32_t vector_table[] = { - (uint32_t) &_estack, /* 0x00 — initial stack pointer */ - (uint32_t) Reset_Handler, /* 0x04 — reset */ + (uint32_t) &_estack, /* 0x00 - initial stack pointer */ + (uint32_t) Reset_Handler, /* 0x04 - reset */ (uint32_t) NMI_Handler, /* 0x08 */ (uint32_t) HardFault_Handler, /* 0x0C */ (uint32_t) MemManage_Handler, /* 0x10 */ @@ -85,29 +85,29 @@ __attribute__((section(".vectors"), used)) const uint32_t vector_table[] = { 0U, 0U, 0U, /* 0x1C-0x28 reserved */ - (uint32_t) SVC_Handler, /* 0x2C — FreeRTOS */ + (uint32_t) SVC_Handler, /* 0x2C - FreeRTOS */ (uint32_t) DebugMon_Handler, /* 0x30 */ 0U, /* 0x34 reserved */ - (uint32_t) PendSV_Handler, /* 0x38 — FreeRTOS */ - (uint32_t) SysTick_Handler, /* 0x3C — FreeRTOS */ + (uint32_t) PendSV_Handler, /* 0x38 - FreeRTOS */ + (uint32_t) SysTick_Handler, /* 0x3C - FreeRTOS */ - /* External interrupts — IRQ0..IRQ31. IRQ 13 = LAN9118 Ethernet. */ - (uint32_t) Default_Handler, /* IRQ 0 — UART0 RX */ - (uint32_t) Default_Handler, /* IRQ 1 — UART0 TX */ - (uint32_t) Default_Handler, /* IRQ 2 — UART1 RX */ - (uint32_t) Default_Handler, /* IRQ 3 — UART1 TX */ - (uint32_t) Default_Handler, /* IRQ 4 — UART2 RX */ - (uint32_t) Default_Handler, /* IRQ 5 — UART2 TX */ - (uint32_t) Default_Handler, /* IRQ 6 — GPIO0 */ - (uint32_t) Default_Handler, /* IRQ 7 — GPIO1 */ - (uint32_t) Default_Handler, /* IRQ 8 — Timer0 */ - (uint32_t) Default_Handler, /* IRQ 9 — Timer1 */ - (uint32_t) Default_Handler, /* IRQ 10 — DualTimer */ - (uint32_t) Default_Handler, /* IRQ 11 — SPI0/1 */ - (uint32_t) Default_Handler, /* IRQ 12 — UART overflow */ - (uint32_t) EthernetISR, /* IRQ 13 — Ethernet (LAN9118) */ - (uint32_t) Default_Handler, /* IRQ 14 — Touchscreen */ - (uint32_t) Default_Handler, /* IRQ 15 — Audio I2S */ + /* External interrupts - IRQ0..IRQ31. IRQ 13 = LAN9118 Ethernet. */ + (uint32_t) Default_Handler, /* IRQ 0 - UART0 RX */ + (uint32_t) Default_Handler, /* IRQ 1 - UART0 TX */ + (uint32_t) Default_Handler, /* IRQ 2 - UART1 RX */ + (uint32_t) Default_Handler, /* IRQ 3 - UART1 TX */ + (uint32_t) Default_Handler, /* IRQ 4 - UART2 RX */ + (uint32_t) Default_Handler, /* IRQ 5 - UART2 TX */ + (uint32_t) Default_Handler, /* IRQ 6 - GPIO0 */ + (uint32_t) Default_Handler, /* IRQ 7 - GPIO1 */ + (uint32_t) Default_Handler, /* IRQ 8 - Timer0 */ + (uint32_t) Default_Handler, /* IRQ 9 - Timer1 */ + (uint32_t) Default_Handler, /* IRQ 10 - DualTimer */ + (uint32_t) Default_Handler, /* IRQ 11 - SPI0/1 */ + (uint32_t) Default_Handler, /* IRQ 12 - UART overflow */ + (uint32_t) EthernetISR, /* IRQ 13 - Ethernet (LAN9118) */ + (uint32_t) Default_Handler, /* IRQ 14 - Touchscreen */ + (uint32_t) Default_Handler, /* IRQ 15 - Audio I2S */ (uint32_t) Default_Handler, /* IRQ 16 */ (uint32_t) Default_Handler, /* IRQ 17 */ (uint32_t) Default_Handler, /* IRQ 18 */ diff --git a/Bdd/Targets/FreeRtos/main.c b/Bdd/Targets/FreeRtos/main.c index 1eede1c4..247913f8 100644 --- a/Bdd/Targets/FreeRtos/main.c +++ b/Bdd/Targets/FreeRtos/main.c @@ -1,8 +1,8 @@ /* FreeRTOS-Plus-TCP SolidSyslog BDD target for QEMU mps2-an385. * - * The platform-independent pipeline — SolidSyslog lifecycle, file-backed store + * The platform-independent pipeline - SolidSyslog lifecycle, file-backed store * + security policies, SD set, the interactive `set` handler, the Service drain - * task, and the console glue — lives in Bdd/Targets/Common/BddTargetFreeRtosPipeline + * task, and the console glue - lives in Bdd/Targets/Common/BddTargetFreeRtosPipeline * (shared with the lwIP target, S29.03). This file keeps only the FreeRTOS-Plus-TCP * network backend and the FreeRTOS-Plus-FAT store behind the pipeline seam: * static-IP bring-up, the LAN9118 IRQ priority fix, the per-endpoint RNG / @@ -10,7 +10,7 @@ * TLS/mTLS via mbedTLS over PlusTcp TCP), the RFC 5424 HOSTNAME read from the * Plus-TCP endpoint, and the Plus-FAT FS-mount seam (BddTargetPlusFatMount over * the FF_Disk_t semihosting media driver). The lwIP target pairs lwIP with - * ChaN-FatFs instead — together the two targets prove the SolidSyslogFile seam + * ChaN-FatFs instead - together the two targets prove the SolidSyslogFile seam * is FS-vendor-portable (S29.05). * * Static IPv4 (10.0.2.15) on the QEMU slirp network with the host reachable at @@ -47,14 +47,14 @@ #define CMSDK_UART0_BASE_ADDRESS UINT32_C(0x40004000) /* IRQ number for the QEMU mps2-an385 LAN9118 Ethernet controller. The upstream - * Plus-TCP NetworkInterface.c enables ISER for this IRQ but does NOT write IPR — + * Plus-TCP NetworkInterface.c enables ISER for this IRQ but does NOT write IPR - * leaving the priority at the reset default of 0, which is numerically more * urgent than configMAX_SYSCALL_INTERRUPT_PRIORITY and trips configASSERT the * first time the ISR calls a FreeRTOS API. We set IPR explicitly here before * FreeRTOS_IPInit_Multi triggers the interface init that flips ISER. */ #define ETHERNET_IRQ_NUMBER 13U -/* NVIC IPR (Interrupt Priority Register) base — one byte per IRQ. */ +/* NVIC IPR (Interrupt Priority Register) base - one byte per IRQ. */ #define NVIC_IPR_BASE_ADDRESS UINT32_C(0xE000E400) /* NVIC IPR is 8-bit per IRQ but only the top configPRIO_BITS are implemented. @@ -77,7 +77,7 @@ static const uint8_t TEST_MAC[ipMAC_ADDRESS_LENGTH_BYTES] = {0x02U, 0x00U, 0x00U static NetworkInterface_t networkInterface; static NetworkEndPoint_t networkEndPoint; -/* PlusTcp sender adapters — built by BuildSender on the interactive task, torn +/* PlusTcp sender adapters - built by BuildSender on the interactive task, torn * down by TeardownNetwork. */ static struct SolidSyslogResolver* resolver = NULL; static struct SolidSyslogDatagram* datagram = NULL; @@ -172,7 +172,7 @@ void vApplicationIPNetworkEventHook_Multi(eIPCallbackEvent_t eNetworkEvent, stru } else { - /* Service create failed — undo the interactive task so the next + /* Service create failed - undo the interactive task so the next * eNetworkUp retries both cleanly instead of latching a * half-started pipeline. Safe to delete: this hook runs on the * higher-priority IP task, so the idle+1 interactive task has not @@ -248,7 +248,7 @@ static void GetHostname(struct SolidSyslogHeaderField* field, void* context) * flips it at runtime. Runs on the interactive task. */ static struct SolidSyslogSender* BuildSender(void) { - /* Route TLS / mTLS via the slirp gateway 10.0.2.2 (same path UDP/TCP take — + /* Route TLS / mTLS via the slirp gateway 10.0.2.2 (same path UDP/TCP take - * slirp DNS doesn't reach the docker alias in CI). ServerName is pinned to * "syslog-ng" (the cert subject) so SNI / cert verification still pass. */ BddTargetTlsConfig_SetHost("10.0.2.2"); diff --git a/Bdd/Targets/FreeRtos/mbedtls_user_config.h b/Bdd/Targets/FreeRtos/mbedtls_user_config.h index 57681fad..e3758285 100644 --- a/Bdd/Targets/FreeRtos/mbedtls_user_config.h +++ b/Bdd/Targets/FreeRtos/mbedtls_user_config.h @@ -5,12 +5,12 @@ * #define here adds to the default; anything we #undef removes from it. * * The defaults that mbedTLS picks for a generic build assume a Unix or - * Windows host — they pull /dev/urandom for entropy, use fopen for cert + * Windows host - they pull /dev/urandom for entropy, use fopen for cert * loading, and call BSD sockets directly. The Cortex-M3 / FreeRTOS QEMU * BDD target has none of those, so we strip them and rely on the integrator * (main.c, slice 6b) to wire entropy, transport, and cert handles via DI. * - * Anything not touched here keeps mbedTLS's default — including the cipher + * Anything not touched here keeps mbedTLS's default - including the cipher * suite set, RSA, ECC curves, SHA, AES, the PEM parser, x509 parsing, the * CTR-DRBG implementation, etc. Trimming further is a binary-size exercise * that belongs after the QEMU footprint is measured (slice 6c+). @@ -19,7 +19,7 @@ #ifndef BDD_TARGET_FREERTOS_MBEDTLS_USER_CONFIG_H #define BDD_TARGET_FREERTOS_MBEDTLS_USER_CONFIG_H -/* Don't compile entropy_poll.c's Unix/Windows code path — mbedTLS would +/* Don't compile entropy_poll.c's Unix/Windows code path - mbedTLS would * otherwise #error on "Platform entropy sources only work on Unix and * Windows". main.c provides a weak entropy callback via * mbedtls_entropy_add_source(MBEDTLS_ENTROPY_SOURCE_WEAK). The @@ -32,33 +32,33 @@ * link hazard against newlib stubs. */ #undef MBEDTLS_FS_IO -/* No BSD sockets — the transport is injected as a SolidSyslogStream +/* No BSD sockets - the transport is injected as a SolidSyslogStream * (PlusTcpTcpStream) and bridged into mbedTLS via mbedtls_ssl_set_bio * callbacks. MBEDTLS_NET_C would otherwise pull in . */ #undef MBEDTLS_NET_C /* No host clock. Cortex-M3 has no wall-clock; mbedTLS's cert-validity-date * check is skipped when this is off, which is fine for BDD with baked certs - * carrying validity 20240101–20990101. Production integrators with an RTC + * carrying validity 20240101-20990101. Production integrators with an RTC * should turn MBEDTLS_HAVE_TIME[_DATE] back on. */ #undef MBEDTLS_HAVE_TIME #undef MBEDTLS_HAVE_TIME_DATE /* Disable mbedTLS's own threading primitive layer. The library runs on the - * service task only — concurrent access to the ssl_context is not in scope + * service task only - concurrent access to the ssl_context is not in scope * for this target. Per [[project-mbedtls-coexistence-contract]] the library * must never install threading hooks. */ #undef MBEDTLS_THREADING_C #undef MBEDTLS_THREADING_PTHREAD /* PSA's "internal trusted storage on filesystem" requires MBEDTLS_FS_IO, - * which we just disabled. We don't use the PSA API surface anyway — the + * which we just disabled. We don't use the PSA API surface anyway - the * adapter is built on the classic mbedTLS API (mbedtls_ssl_*, mbedtls_x509_*, * mbedtls_pk_*, mbedtls_ctr_drbg_*). */ #undef MBEDTLS_PSA_ITS_FILE_C #undef MBEDTLS_PSA_CRYPTO_STORAGE_C -/* mbedTLS's timing.c uses gettimeofday / clock_gettime — Unix/Windows only. +/* mbedTLS's timing.c uses gettimeofday / clock_gettime - Unix/Windows only. * The adapter manages its own bounded handshake retry budget via the * injected Sleep callback, so MBEDTLS_TIMING_C is unused. */ #undef MBEDTLS_TIMING_C @@ -66,17 +66,17 @@ /* Route mbedTLS allocations through a runtime-installed calloc/free pair. By * default mbedTLS calls libc calloc/free, which on this target funnels through * newlib into the small 4 KiB syscall heap in Bdd/Targets/FreeRtos/Common/ - * Syscalls.c — far too small for mbedTLS's per-context allocations (IN/OUT - * buffers plus handshake state run ~10–20 KiB). Enabling + * Syscalls.c - far too small for mbedTLS's per-context allocations (IN/OUT + * buffers plus handshake state run ~10-20 KiB). Enabling * MBEDTLS_PLATFORM_MEMORY lets BddTargetTlsSender_MbedTls_PlusTcpTcp.c call * mbedtls_platform_set_calloc_free(...) to redirect those allocations to - * pvPortMalloc, which uses the 96 KiB heap_4 region — the textbook + * pvPortMalloc, which uses the 96 KiB heap_4 region - the textbook * FreeRTOS+mbedTLS integration. */ #define MBEDTLS_PLATFORM_MEMORY /* Route PSA crypto's randomness through an integrator-supplied callback rather * than PSA's internal entropy pool. mbedTLS 3.6's TLS 1.3 path is built on PSA, - * so psa_crypto_init() must succeed before any TLS 1.3 handshake — and the + * so psa_crypto_init() must succeed before any TLS 1.3 handshake - and the * default PSA entropy collector returns PSA_ERROR_INSUFFICIENT_ENTROPY * (-148) on platforms with no real entropy source (which is us, with * MBEDTLS_NO_PLATFORM_ENTROPY defined above). With this define, PSA never @@ -88,7 +88,7 @@ /* Shrink the TLS record buffers from the 16 KiB default. The BDD syslog-ng * oracle's server cert + chain fits in 4 KiB IN comfortably, and the BDD * messages we send fit in 2 KiB OUT. Cuts ~28 KiB off the per-context - * footprint — important when the FreeRTOS heap also has to satisfy + * footprint - important when the FreeRTOS heap also has to satisfy * FreeRTOS-Plus-TCP socket buffers, the SolidSyslog Service task, and the * interactive task all at once. Embedded integrators replicating this * footprint should re-tune both knobs against their peer's largest TLS diff --git a/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h b/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h index 2f62bf27..f75a0fe9 100644 --- a/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h +++ b/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h @@ -4,12 +4,12 @@ /* FreeRTOS BDD-target tuning. SolidSyslog_Log allocates a Formatter and * working buffer of SOLIDSYSLOG_MAX_MESSAGE_SIZE on the caller's stack, * so dropping from 2048 (the RFC 5424 section 6.1 SHOULD value) to 512 - * (the library's pre-S12.12 default) reclaims ~4.5KB per call — material + * (the library's pre-S12.12 default) reclaims ~4.5KB per call - material * on a Cortex-M3 with 4KB task stacks. RFC 5424 receivers are still * required to accept up to 480 bytes, which this comfortably exceeds. * * BDD impact: path-MTU clipping scenarios (udp_mtu.feature) need MAX - * large enough to build a >1472-byte message and trigger EMSGSIZE — that + * large enough to build a >1472-byte message and trigger EMSGSIZE - that * feature is tagged @requires_message_size_1500 and skipped at runtime * by the tunable-driven gate in Bdd/features/environment.py (which * compares the tag's threshold against this header's value via the @@ -21,7 +21,7 @@ * `lifecycleMutex` (serialising SolidSyslog_Service against the * `set store file` rebuild path that destroys and re-creates SolidSyslog * mid-run). The library default of 1 would silently fall the second Create - * back to NullMutex — Lock/Unlock would become no-ops and the rebuild path + * back to NullMutex - Lock/Unlock would become no-ops and the rebuild path * could race the Service task. */ #define SOLIDSYSLOG_MUTEX_POOL_SIZE 2U diff --git a/Bdd/Targets/FreeRtosLwip/FreeRTOSConfig.h b/Bdd/Targets/FreeRtosLwip/FreeRTOSConfig.h index f43cf632..7ae61031 100644 --- a/Bdd/Targets/FreeRtosLwip/FreeRTOSConfig.h +++ b/Bdd/Targets/FreeRtosLwip/FreeRTOSConfig.h @@ -9,7 +9,7 @@ * * S28.09 grew this from the S28.07 link-probe config: the lwIP FreeRTOS * sys_arch needs recursive mutexes (the LWIP_TCPIP_CORE_LOCKING mutex) and - * counting semaphores, and SolidSyslogFreeRtosMutex needs static allocation — + * counting semaphores, and SolidSyslogFreeRtosMutex needs static allocation - * so this now mirrors Bdd/Targets/FreeRtos/FreeRTOSConfig.h (the proven * networking config for this machine) rather than the lean probe variant. The * FreeRTOS software-timer service is left ON for parity even though lwIP runs @@ -39,7 +39,7 @@ /* Static allocation is required by SolidSyslogFreeRtosMutex * (xSemaphoreCreateMutexStatic places the StaticSemaphore_t inside the * caller-supplied storage). The idle / timer task static-memory hooks it - * pulls in are satisfied by configKERNEL_PROVIDED_STATIC_MEMORY = 1 — no + * pulls in are satisfied by configKERNEL_PROVIDED_STATIC_MEMORY = 1 - no * boilerplate in main.c. Dynamic allocation stays on for the lwIP tcpip / * RX tasks and the interactive / service tasks created via xTaskCreate. */ #define configSUPPORT_STATIC_ALLOCATION 1 diff --git a/Bdd/Targets/FreeRtosLwip/arch/cc.h b/Bdd/Targets/FreeRtosLwip/arch/cc.h index dac3ce54..e59589ee 100644 --- a/Bdd/Targets/FreeRtosLwip/arch/cc.h +++ b/Bdd/Targets/FreeRtosLwip/arch/cc.h @@ -3,14 +3,14 @@ * The minimum compiler-environment surface lwIP's arch.h asks an integrator * to supply: the diagnostic / assert hooks and the randomness source. lwIP's * own arch.h derives u8_t / u16_t / u32_t / s8_t / s16_t / s32_t from - * when we do not redefine them — newlib on arm-none-eabi provides + * when we do not redefine them - newlib on arm-none-eabi provides * those, so we let lwIP's defaults stand. * * S28.07 cross-builds this image only to prove the Platform/LwipRaw tree * links for a Cortex-M3 FreeRTOS target; it is never run on QEMU. DIAG is a * no-op and ASSERT spins, matching how a deployed target would trap. LWIP_RAND * is a tiny self-contained xorshift so TCP ISN selection has a definition to - * link against without dragging in newlib's rand() / a real entropy source — + * link against without dragging in newlib's rand() / a real entropy source - * the worked NO_SYS=0 runtime config arrives with S28.09. */ #ifndef LWIP_ARCH_CC_H #define LWIP_ARCH_CC_H diff --git a/Bdd/Targets/FreeRtosLwip/lwipopts.h b/Bdd/Targets/FreeRtosLwip/lwipopts.h index 8aef4c73..559bbfc4 100644 --- a/Bdd/Targets/FreeRtosLwip/lwipopts.h +++ b/Bdd/Targets/FreeRtosLwip/lwipopts.h @@ -6,11 +6,11 @@ * reach the core through the tcpip_callback marshal (S28.06). We still only * use lwIP's Raw API (the adapters call udp_ / tcp_ functions directly via the * marshal), - * so the sequential netconn / socket API stays OFF — the tcpip thread exists + * so the sequential netconn / socket API stays OFF - the tcpip thread exists * for RX delivery (tcpip_input), timeouts, and marshalled callbacks only. * * Memory is lwIP-pool managed (no libc malloc) so the footprint is the static, - * embedded-realistic shape an integrator ships — not the host-test shortcut + * embedded-realistic shape an integrator ships - not the host-test shortcut * (MEM_LIBC_MALLOC) in Tests/Support/LwipFakes/Interface/lwipopts.h. */ #ifndef SOLIDSYSLOG_FREERTOS_LWIP_LWIPOPTS_H #define SOLIDSYSLOG_FREERTOS_LWIP_LWIPOPTS_H @@ -19,13 +19,13 @@ #define NO_SYS 0 #define SYS_LIGHTWEIGHT_PROT 1 #define LWIP_TCPIP_CORE_LOCKING 1 -/* Raw API only — no sequential netconn / BSD-socket API. */ +/* Raw API only - no sequential netconn / BSD-socket API. */ #define LWIP_NETCONN 0 #define LWIP_SOCKET 0 /* tcpip thread. Priorities are numeric here: lwipopts.h is processed via * lwip/opt.h before any FreeRTOS header, so configMAX_PRIORITIES (7) is not - * visible — TCPIP_THREAD_PRIO 6 == configMAX_PRIORITIES - 1, above the + * visible - TCPIP_THREAD_PRIO 6 == configMAX_PRIORITIES - 1, above the * LAN9118 RX task (configMAX_PRIORITIES - 2 == 5, set in EthernetIf.c). * TCPIP_THREAD_STACKSIZE is in BYTES (LWIP_FREERTOS_THREAD_STACKSIZE_IS_ * STACKWORDS defaults to 0, so the sys_arch divides by sizeof(StackType_t)). */ @@ -58,14 +58,14 @@ /* LWIP_DNS on so SolidSyslogLwipRawDnsResolver can resolve the oracle by name * ("syslog-ng") instead of the numeric 10.0.2.2 it was pinned to. We do NOT * configure a DNS server: the QEMU slirp forwarder (10.0.2.3) would resolve the - * "syslog-ng" docker alias to a docker-bridge IP the guest has no route to — + * "syslog-ng" docker alias to a docker-bridge IP the guest has no route to - * only 10.0.2.2 (slirp NAT -> shared-namespace host loopback) reaches the * oracle. So we map the name statically via DNS_LOCAL_HOSTLIST: dns_gethostbyname * consults the hostlist before any server and returns ERR_OK synchronously for a * hit, so the resolve never leaves the guest. This exercises only the resolver's * synchronous local-hostlist branch end-to-end; the async / over-the-wire / * timeout branches are unit-tested (Tests/Lwip/SolidSyslogLwipRawDnsResolverTest) - * — slirp cannot hand the guest a reachable address for the docker alias. + * - slirp cannot hand the guest a reachable address for the docker alias. * DNS_LOCAL_HOSTLIST_INIT is expanded inside lwIP's dns.c, where * DNS_LOCAL_HOSTLIST_ELEM (lwip/dns.h) and IPADDR4_INIT_BYTES (lwip/ip_addr.h) * are in scope. */ @@ -73,7 +73,7 @@ #define DNS_LOCAL_HOSTLIST 1 #define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("syslog-ng", IPADDR4_INIT_BYTES(10, 0, 2, 2))} -/* etharp queues the first packet to a destination while ARP resolves it — +/* etharp queues the first packet to a destination while ARP resolves it - * keep queueing on so the first UDP datagram after boot is not dropped * (mirrors the FreeRTOS-Plus-TCP first-packet ARP behaviour). */ #define ARP_QUEUEING 1 diff --git a/Bdd/Targets/FreeRtosLwip/main.c b/Bdd/Targets/FreeRtosLwip/main.c index 12692eb1..524f1b0b 100644 --- a/Bdd/Targets/FreeRtosLwip/main.c +++ b/Bdd/Targets/FreeRtosLwip/main.c @@ -1,9 +1,9 @@ /* FreeRTOS + lwIP (Raw API, NO_SYS=0) SolidSyslog BDD target for QEMU * mps2-an385. * - * The platform-independent pipeline — SolidSyslog lifecycle, FatFs-backed store + * The platform-independent pipeline - SolidSyslog lifecycle, FatFs-backed store * + security policies, SD set, the interactive `set` handler, the Service drain - * task, and the console glue — lives in Bdd/Targets/Common/BddTargetFreeRtosPipeline + * task, and the console glue - lives in Bdd/Targets/Common/BddTargetFreeRtosPipeline * (shared with the FreeRTOS-Plus-TCP target, S29.03). This file keeps only the * lwIP network backend behind the pipeline seam: the tcpip thread + tcpip_callback * marshal (S28.06), the hand-written LAN9118 netif (netif/EthernetIf.c), the @@ -50,12 +50,12 @@ #define CMSDK_UART0_BASE_ADDRESS UINT32_C(0x40004000) -/* lwIP netif descriptor — must outlive the tcpip thread. */ +/* lwIP netif descriptor - must outlive the tcpip thread. */ static struct netif networkInterface; /* Gateway IP, kept at file scope so the ARP warm-up can reach it after bring-up. */ static ip4_addr_t gatewayAddress; -/* LwipRaw sender adapters — built by BuildSender on the interactive task, torn +/* LwipRaw sender adapters - built by BuildSender on the interactive task, torn * down by TeardownNetwork. */ static struct SolidSyslogResolver* resolver = NULL; static struct SolidSyslogDatagram* datagram = NULL; @@ -178,7 +178,7 @@ static void GatewayResolvedQuery(void* context) *(bool*) context = (etharp_find_addr(&networkInterface, &gatewayAddress, ðRet, &ipRet) >= 0); } -/* Blocks the calling (interactive) task — never the tcpip thread — until the +/* Blocks the calling (interactive) task - never the tcpip thread - until the * gateway resolves or a bounded deadline passes. Generous deadline: QEMU is * markedly slower than host. */ static void WarmUpGatewayArp(void) @@ -235,7 +235,7 @@ void vApplicationStackOverflowHook(TaskHandle_t task, char* taskName) static void GetHostname(struct SolidSyslogHeaderField* field, void* context) { - /* RFC 5424 §6.2.4 rung 2 (static IP) — read back from the netif so a future + /* RFC 5424 §6.2.4 rung 2 (static IP) - read back from the netif so a future * DHCP slice satisfies the same rung without touching this callback. */ const char* address = ip4addr_ntoa(netif_ip4_addr(&networkInterface)); (void) context; @@ -245,7 +245,7 @@ static void GetHostname(struct SolidSyslogHeaderField* field, void* context) /* Bring up the netif on the tcpip thread, warm the gateway ARP, then build the * LwipRaw SwitchingSender: UDP, octet-framed TCP, and a TLS/mTLS slot (mbedTLS * over a second LwipRaw TCP stream). Default transport UDP. Runs on the - * interactive task — LwipRaw adapters touch a started lwIP core, which is now up. */ + * interactive task - LwipRaw adapters touch a started lwIP core, which is now up. */ static struct SolidSyslogSender* BuildSender(void) { /* Bring the netif up on the tcpip thread now the scheduler is running, then diff --git a/Bdd/Targets/FreeRtosLwip/mbedtls_user_config.h b/Bdd/Targets/FreeRtosLwip/mbedtls_user_config.h index 1dbcf4f0..4a263be3 100644 --- a/Bdd/Targets/FreeRtosLwip/mbedtls_user_config.h +++ b/Bdd/Targets/FreeRtosLwip/mbedtls_user_config.h @@ -1,6 +1,6 @@ /* mbedTLS integrator overrides for the FreeRTOS + lwIP QEMU BDD target. * - * Network-backend twin of Bdd/Targets/FreeRtos/mbedtls_user_config.h — the + * Network-backend twin of Bdd/Targets/FreeRtos/mbedtls_user_config.h - the * mbedTLS feature set is transport-agnostic, so the two configs are identical * except for the include guard and the transport references in comments. Kept * as a separate file (rather than #include of the +TCP one) so each target's @@ -11,13 +11,13 @@ * #define here adds to the default; anything we #undef removes from it. * * The defaults that mbedTLS picks for a generic build assume a Unix or - * Windows host — they pull /dev/urandom for entropy, use fopen for cert + * Windows host - they pull /dev/urandom for entropy, use fopen for cert * loading, and call BSD sockets directly. The Cortex-M3 / FreeRTOS QEMU * BDD target has none of those, so we strip them and rely on the integrator * (BddTargetTlsSender_MbedTls_LwipRawTcp.c) to wire entropy, transport, and * cert handles via DI. * - * Anything not touched here keeps mbedTLS's default — including the cipher + * Anything not touched here keeps mbedTLS's default - including the cipher * suite set, RSA, ECC curves, SHA, AES, the PEM parser, x509 parsing, the * CTR-DRBG implementation, etc. Trimming further is a binary-size exercise. */ @@ -25,7 +25,7 @@ #ifndef BDD_TARGET_FREERTOS_LWIP_MBEDTLS_USER_CONFIG_H #define BDD_TARGET_FREERTOS_LWIP_MBEDTLS_USER_CONFIG_H -/* Don't compile entropy_poll.c's Unix/Windows code path — mbedTLS would +/* Don't compile entropy_poll.c's Unix/Windows code path - mbedTLS would * otherwise #error on "Platform entropy sources only work on Unix and * Windows". BddTargetTlsSender_MbedTls_LwipRawTcp.c provides a weak entropy * callback via mbedtls_entropy_add_source. The "demo-only entropy" caveat is @@ -38,33 +38,33 @@ * hazard against newlib stubs. */ #undef MBEDTLS_FS_IO -/* No BSD sockets — the transport is injected as a SolidSyslogStream +/* No BSD sockets - the transport is injected as a SolidSyslogStream * (LwipRawTcpStream) and bridged into mbedTLS via mbedtls_ssl_set_bio * callbacks. MBEDTLS_NET_C would otherwise pull in . */ #undef MBEDTLS_NET_C /* No host clock. Cortex-M3 has no wall-clock; mbedTLS's cert-validity-date * check is skipped when this is off, which is fine for BDD with baked certs - * carrying validity 20240101–20990101. Production integrators with an RTC + * carrying validity 20240101-20990101. Production integrators with an RTC * should turn MBEDTLS_HAVE_TIME[_DATE] back on. */ #undef MBEDTLS_HAVE_TIME #undef MBEDTLS_HAVE_TIME_DATE /* Disable mbedTLS's own threading primitive layer. The library runs on the - * service task only — concurrent access to the ssl_context is not in scope + * service task only - concurrent access to the ssl_context is not in scope * for this target. Per [[project-mbedtls-coexistence-contract]] the library * must never install threading hooks. */ #undef MBEDTLS_THREADING_C #undef MBEDTLS_THREADING_PTHREAD /* PSA's "internal trusted storage on filesystem" requires MBEDTLS_FS_IO, - * which we just disabled. We don't use the PSA API surface anyway — the + * which we just disabled. We don't use the PSA API surface anyway - the * adapter is built on the classic mbedTLS API (mbedtls_ssl_*, mbedtls_x509_*, * mbedtls_pk_*, mbedtls_ctr_drbg_*). */ #undef MBEDTLS_PSA_ITS_FILE_C #undef MBEDTLS_PSA_CRYPTO_STORAGE_C -/* mbedTLS's timing.c uses gettimeofday / clock_gettime — Unix/Windows only. +/* mbedTLS's timing.c uses gettimeofday / clock_gettime - Unix/Windows only. * The adapter manages its own bounded handshake retry budget via the * injected Sleep callback, so MBEDTLS_TIMING_C is unused. */ #undef MBEDTLS_TIMING_C @@ -72,17 +72,17 @@ /* Route mbedTLS allocations through a runtime-installed calloc/free pair. By * default mbedTLS calls libc calloc/free, which on this target funnels through * newlib into the small 4 KiB syscall heap in Bdd/Targets/FreeRtos/Common/ - * Syscalls.c (shared with this target) — far too small for mbedTLS's - * per-context allocations (IN/OUT buffers plus handshake state run ~10–20 KiB). + * Syscalls.c (shared with this target) - far too small for mbedTLS's + * per-context allocations (IN/OUT buffers plus handshake state run ~10-20 KiB). * Enabling MBEDTLS_PLATFORM_MEMORY lets BddTargetTlsSender_MbedTls_LwipRawTcp.c * call mbedtls_platform_set_calloc_free(...) to redirect those allocations to - * pvPortMalloc, which uses the 96 KiB heap_4 region — the textbook + * pvPortMalloc, which uses the 96 KiB heap_4 region - the textbook * FreeRTOS+mbedTLS integration. */ #define MBEDTLS_PLATFORM_MEMORY /* Route PSA crypto's randomness through an integrator-supplied callback rather * than PSA's internal entropy pool. mbedTLS 3.6's TLS 1.3 path is built on PSA, - * so psa_crypto_init() must succeed before any TLS 1.3 handshake — and the + * so psa_crypto_init() must succeed before any TLS 1.3 handshake - and the * default PSA entropy collector returns PSA_ERROR_INSUFFICIENT_ENTROPY * (-148) on platforms with no real entropy source (which is us, with * MBEDTLS_NO_PLATFORM_ENTROPY defined above). With this define, PSA never @@ -94,7 +94,7 @@ /* Shrink the TLS record buffers from the 16 KiB default. The BDD syslog-ng * oracle's server cert + chain fits in 4 KiB IN comfortably, and the BDD * messages we send fit in 2 KiB OUT. Cuts ~28 KiB off the per-context - * footprint — important when the FreeRTOS heap also has to satisfy the lwIP + * footprint - important when the FreeRTOS heap also has to satisfy the lwIP * tcpip / RX tasks, the SolidSyslog Service task, and the interactive task * all at once. Embedded integrators replicating this footprint should re-tune * both knobs against their peer's largest TLS record. */ diff --git a/Bdd/Targets/FreeRtosLwip/netif/EthernetIf.c b/Bdd/Targets/FreeRtosLwip/netif/EthernetIf.c index 3e98589b..02bad3c6 100644 --- a/Bdd/Targets/FreeRtosLwip/netif/EthernetIf.c +++ b/Bdd/Targets/FreeRtosLwip/netif/EthernetIf.c @@ -28,7 +28,7 @@ #include /* QEMU mps2-an385 maps the LAN9118 register block here for the Cortex-M3 - * (CORTEX_M7 would be 0xA0000000 — see the vendored SMM_MPS2.h). */ + * (CORTEX_M7 would be 0xA0000000 - see the vendored SMM_MPS2.h). */ #define ETHERNETIF_SMSC9220_BASE UINT32_C(0x40200000) /* IRQ 13 is the LAN9118 Ethernet controller on the mps2-an385 NVIC. */ @@ -43,7 +43,7 @@ #define ETHERNETIF_RX_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 4U) #define ETHERNETIF_RX_TASK_PRIORITY (configMAX_PRIORITIES - 2U) -/* Wait at most this long for an RX notification before re-polling the FIFO — +/* Wait at most this long for an RX notification before re-polling the FIFO - * a safety net against a missed edge, not the normal wake path. */ #define ETHERNETIF_RX_BLOCK_MS 1500U diff --git a/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h b/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h index 34cb917a..865df2ea 100644 --- a/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h +++ b/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h @@ -2,13 +2,13 @@ #define SOLIDSYSLOG_USER_TUNABLES_H /* FreeRTOS + lwIP BDD-target tuning. Mirrors - * Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h — the lwIP target runs the + * Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h - the lwIP target runs the * same Cortex-M3 with the same task-stack and FreeRtosMutex constraints. * * SolidSyslog_Log builds a Formatter and working buffer of * SOLIDSYSLOG_MAX_MESSAGE_SIZE on the caller's stack, so dropping from 2048 * (the RFC 5424 section 6.1 SHOULD value) to 512 (the library's pre-S12.12 - * default) reclaims ~4.5KB per call — material on a Cortex-M3. RFC 5424 + * default) reclaims ~4.5KB per call - material on a Cortex-M3. RFC 5424 * receivers must still accept 480 bytes, which this exceeds. The * message-size-1500 BDD scenarios are tag-gated off at runtime by the * tunable-driven check in Bdd/features/environment.py. */ @@ -18,7 +18,7 @@ * CircularBuffer producers against the Service-task drain) and * `lifecycleMutex` (serialising SolidSyslog_Service against teardown). The * library default of 1 would silently fall the second Create back to - * NullMutex — Lock/Unlock would become no-ops. */ + * NullMutex - Lock/Unlock would become no-ops. */ #define SOLIDSYSLOG_MUTEX_POOL_SIZE 2U #endif /* SOLIDSYSLOG_USER_TUNABLES_H */ diff --git a/Bdd/Targets/Linux/BddTargetCommandLine.h b/Bdd/Targets/Linux/BddTargetCommandLine.h index aeeb2b5d..f0d5e77f 100644 --- a/Bdd/Targets/Linux/BddTargetCommandLine.h +++ b/Bdd/Targets/Linux/BddTargetCommandLine.h @@ -22,7 +22,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN size_t MaxBlockSize; const char* DiscardPolicy; const char* - SecurityPolicy; /* "crc16" (default) | "hmac-sha256" | "aes-256-gcm" | "null" — at-rest protection */ + SecurityPolicy; /* "crc16" (default) | "hmac-sha256" | "aes-256-gcm" | "null" - at-rest protection */ size_t CapacityThreshold; bool NoSd; bool HaltExit; diff --git a/Bdd/Targets/Linux/BddTargetTcpConfig.c b/Bdd/Targets/Linux/BddTargetTcpConfig.c index 757b7897..8b4e5469 100644 --- a/Bdd/Targets/Linux/BddTargetTcpConfig.c +++ b/Bdd/Targets/Linux/BddTargetTcpConfig.c @@ -5,7 +5,7 @@ #include "SolidSyslogEndpointHost.h" #include "SolidSyslogEndpoint.h" -/* Unprivileged port used by the BDD syslog-ng container — library default is +/* Unprivileged port used by the BDD syslog-ng container - library default is SOLIDSYSLOG_TCP_DEFAULT_PORT (601, RFC 6587 §3.2 / IANA) which requires root. */ enum { @@ -29,7 +29,7 @@ void BddTargetTcpConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint, void* endpoint->Port = BddTargetTcpConfig_GetPort(); } -/* Static config — host/port never change, so version stays 0 forever and the +/* Static config - host/port never change, so version stays 0 forever and the sender connects exactly once. */ uint32_t BddTargetTcpConfig_GetEndpointVersion(void* context) { diff --git a/Bdd/Targets/Linux/BddTargetUdpConfig.c b/Bdd/Targets/Linux/BddTargetUdpConfig.c index 4e3aaf61..18a84d78 100644 --- a/Bdd/Targets/Linux/BddTargetUdpConfig.c +++ b/Bdd/Targets/Linux/BddTargetUdpConfig.c @@ -28,7 +28,7 @@ void BddTargetUdpConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint, void* endpoint->Port = BddTargetUdpConfig_GetPort(); } -/* Static config — host/port never change, so version stays 0 forever and the +/* Static config - host/port never change, so version stays 0 forever and the sender connects exactly once. */ uint32_t BddTargetUdpConfig_GetEndpointVersion(void* context) { diff --git a/Bdd/Targets/Linux/main.c b/Bdd/Targets/Linux/main.c index 594610f7..0f589766 100644 --- a/Bdd/Targets/Linux/main.c +++ b/Bdd/Targets/Linux/main.c @@ -172,7 +172,7 @@ static void OnThresholdCrossed(void* context) } /* DEMO KEY ONLY. A real integrator supplies key material from a secure element, - * a KDF, or encrypted NVM via their own SolidSyslogKeyFunction — never a + * a KDF, or encrypted NVM via their own SolidSyslogKeyFunction - never a * hard-coded constant. This exists so the BDD scenario can exercise the OpenSSL * HMAC-SHA256 at-rest policy end-to-end with real crypto. */ static bool BddDemoGetKey(void* context, uint8_t* keyOut, size_t capacity, size_t* keyLengthOut) @@ -269,7 +269,7 @@ static void DestroySecurityPolicy(const struct BddTargetOptions* options) { SolidSyslogCrc16Policy_Destroy(); } - /* else "null": the shared NullSecurityPolicy is immutable — nothing to free. */ + /* else "null": the shared NullSecurityPolicy is immutable - nothing to free. */ securityPolicy = NULL; } @@ -284,7 +284,7 @@ static void DestroyStore(struct SolidSyslogStore* store, const struct BddTargetO DestroySecurityPolicy(options); SolidSyslogPosixFile_Destroy(storeFile); } - /* else: NullStore is shared and immutable — nothing to destroy. */ + /* else: NullStore is shared and immutable - nothing to destroy. */ } int main(int argc, char* argv[]) diff --git a/Bdd/Targets/Windows/BddTargetWindows.c b/Bdd/Targets/Windows/BddTargetWindows.c index 1037b8fe..2e3bf8a5 100644 --- a/Bdd/Targets/Windows/BddTargetWindows.c +++ b/Bdd/Targets/Windows/BddTargetWindows.c @@ -71,7 +71,7 @@ static uint8_t bufferRing[SOLIDSYSLOG_CIRCULAR_BUFFER_RING_BYTES(BDD_TARGET_BUFF static volatile bool shutdownFlag; static struct SolidSyslog* solidSyslog; -/* Created in CreateSender, destroyed in DestroySender — held in file scope so +/* Created in CreateSender, destroyed in DestroySender - held in file scope so teardown can reach them after the SwitchingSender wraps them all. */ static struct SolidSyslogResolver* resolver; static struct SolidSyslogStream* plainTcpStream; @@ -82,7 +82,7 @@ static struct SolidSyslogAddress* udpAddress; static struct SolidSyslogSender* udpSender; static struct SolidSyslogSender* switchingSender; -/* Block-store backing — created in CreateStore, released in DestroyStore. */ +/* Block-store backing - created in CreateStore, released in DestroyStore. */ static struct SolidSyslogFile* storeFile; static struct SolidSyslogBlockDevice* storeBlockDevice; /* Holds the created at-rest SecurityPolicy handle so DestroyStore can release @@ -243,7 +243,7 @@ static void DestroySender(void) } /* DEMO KEY ONLY. A real integrator supplies key material from a secure element, - * a KDF, or encrypted NVM via their own SolidSyslogKeyFunction — never a + * a KDF, or encrypted NVM via their own SolidSyslogKeyFunction - never a * hard-coded constant. This exists so the BDD scenario can exercise the OpenSSL * HMAC-SHA256 at-rest policy end-to-end with real crypto. */ static bool BddDemoGetKey(void* context, uint8_t* keyOut, size_t capacity, size_t* keyLengthOut) @@ -318,7 +318,7 @@ static void DestroySecurityPolicy(const struct BddTargetWindowsOptions* options) { SolidSyslogCrc16Policy_Destroy(); } - /* else "null": the shared NullSecurityPolicy is immutable — nothing to free. */ + /* else "null": the shared NullSecurityPolicy is immutable - nothing to free. */ securityPolicy = NULL; } @@ -333,7 +333,7 @@ static void DestroyStore(struct SolidSyslogStore* store, const struct BddTargetW DestroySecurityPolicy(options); SolidSyslogWindowsFile_Destroy(storeFile); } - /* else: NullStore is shared and immutable — nothing to destroy. */ + /* else: NullStore is shared and immutable - nothing to destroy. */ } int BddTargetWindows_Run(int argc, char* argv[]) diff --git a/Bdd/Targets/Windows/BddTargetWindowsCommandLine.c b/Bdd/Targets/Windows/BddTargetWindowsCommandLine.c index 90ea7b34..5e17efa8 100644 --- a/Bdd/Targets/Windows/BddTargetWindowsCommandLine.c +++ b/Bdd/Targets/Windows/BddTargetWindowsCommandLine.c @@ -19,7 +19,7 @@ static bool ParsePositiveSize(const char* text, size_t* out) { return false; } - /* Reject leading sign — strtoul silently wraps "-1" to ULONG_MAX, which + /* Reject leading sign - strtoul silently wraps "-1" to ULONG_MAX, which would let "--max-blocks -1" produce a huge size_t. */ if ((text[0] == '-') || (text[0] == '+')) { diff --git a/Bdd/Targets/Windows/BddTargetWindowsCommandLine.h b/Bdd/Targets/Windows/BddTargetWindowsCommandLine.h index 8d16b00c..19ad1c8e 100644 --- a/Bdd/Targets/Windows/BddTargetWindowsCommandLine.h +++ b/Bdd/Targets/Windows/BddTargetWindowsCommandLine.h @@ -13,21 +13,21 @@ SOLIDSYSLOG_EXTERN_C_BEGIN { enum SolidSyslogFacility Facility; enum SolidSyslogSeverity Severity; - const char* Transport; /* "udp" | "tcp" | "tls" | "mtls" — initial selector */ + const char* Transport; /* "udp" | "tcp" | "tls" | "mtls" - initial selector */ const char* MessageId; const char* Msg; const char* AppName; /* --app-name (NULL: derive from argv[0]) */ - const char* Store; /* "null" (default) | "file" — block-store backend */ + const char* Store; /* "null" (default) | "file" - block-store backend */ size_t MaxBlocks; /* --max-blocks */ size_t MaxBlockSize; /* --max-block-size */ const char* DiscardPolicy; /* "oldest" (default) | "newest" | "halt" */ - const char* SecurityPolicy; /* "crc16" (default) | "hmac-sha256" | "null" — at-rest integrity */ + const char* SecurityPolicy; /* "crc16" (default) | "hmac-sha256" | "null" - at-rest integrity */ size_t CapacityThreshold; /* --capacity-threshold (bytes; 0 disables) */ bool HaltExit; /* --halt-exit */ bool NoSd; /* --no-sd (suppress structured data) */ }; - /* Minimal CLI parser — recognises the flags below. Unknown flags and + /* Minimal CLI parser - recognises the flags below. Unknown flags and flags missing their argument are silently ignored. Defaults match the Linux Threaded example so BDD scenarios drive both runners with the same arguments. @@ -42,9 +42,9 @@ SOLIDSYSLOG_EXTERN_C_BEGIN --max-block-size N (default set by example) --discard-policy oldest|newest|halt (default: oldest) --security-policy crc16|hmac-sha256|null (default: crc16) - --capacity-threshold N (default: 0 — disabled) - --halt-exit (flag; default: off — matches the Linux Threaded example so the BDD step's --halt-exit flag works on both runners) - --no-sd (flag; default: off — suppress structured data) + --capacity-threshold N (default: 0 - disabled) + --halt-exit (flag; default: off - matches the Linux Threaded example so the BDD step's --halt-exit flag works on both runners) + --no-sd (flag; default: off - suppress structured data) getopt is not available on MSVC and pulling in a vcpkg getopt for a handful of flags would be overkill. */ void BddTargetWindowsCommandLine_Parse(int argc, char* argv[], struct BddTargetWindowsOptions* options); diff --git a/Core/Interface/SolidSyslogAtomicCounterDefinition.h b/Core/Interface/SolidSyslogAtomicCounterDefinition.h index b3da685a..9aadaf77 100644 --- a/Core/Interface/SolidSyslogAtomicCounterDefinition.h +++ b/Core/Interface/SolidSyslogAtomicCounterDefinition.h @@ -1,5 +1,5 @@ /** @file - * The AtomicCounter vtable (Increment) — the contract an implementor fills in + * The AtomicCounter vtable (Increment) - the contract an implementor fills in * (the AtomicCounter extension point). */ #ifndef SOLIDSYSLOGATOMICCOUNTERDEFINITION_H #define SOLIDSYSLOGATOMICCOUNTERDEFINITION_H diff --git a/Core/Interface/SolidSyslogBlockDeviceDefinition.h b/Core/Interface/SolidSyslogBlockDeviceDefinition.h index 9c5aa3ec..4ae9c309 100644 --- a/Core/Interface/SolidSyslogBlockDeviceDefinition.h +++ b/Core/Interface/SolidSyslogBlockDeviceDefinition.h @@ -1,6 +1,6 @@ /** @file * The BlockDevice vtable (Acquire / Dispose / Exists / Read / Append / WriteAt / - * Size / GetBlockSize) — the contract an implementor fills in (the BlockDevice + * Size / GetBlockSize) - the contract an implementor fills in (the BlockDevice * extension point). */ #ifndef SOLIDSYSLOGBLOCKDEVICEDEFINITION_H #define SOLIDSYSLOGBLOCKDEVICEDEFINITION_H diff --git a/Core/Interface/SolidSyslogBlockStore.h b/Core/Interface/SolidSyslogBlockStore.h index 4de6fdb6..c6b3cca2 100644 --- a/Core/Interface/SolidSyslogBlockStore.h +++ b/Core/Interface/SolidSyslogBlockStore.h @@ -7,13 +7,13 @@ * keeps unsent records queued. * * MaxBlocks caps retention; DiscardPolicy governs the overflow once every block - * is full — Oldest evicts the oldest block to keep accepting writes, Newest + * is full - Oldest evicts the oldest block to keep accepting writes, Newest * refuses the incoming record, Halt refuses it, latches (IsHalted stops * Service), and fires OnStoreFull once. An optional capacity-threshold function * (queried each Write) drives an edge-triggered OnThresholdCrossed callback for * early back-pressure signalling. Mind the recursion gotcha: under a * PassthroughBuffer, SolidSyslog_Log sends inline, so logging from the - * threshold callback re-enters Write — drive the logger from a returning Buffer + * threshold callback re-enters Write - drive the logger from a returning Buffer * or gate the Log instead. * * Internally each pool slot composes an inner RecordStore over a BlockSequence, diff --git a/Core/Interface/SolidSyslogBuffer.h b/Core/Interface/SolidSyslogBuffer.h index a8b7f798..8c52fda4 100644 --- a/Core/Interface/SolidSyslogBuffer.h +++ b/Core/Interface/SolidSyslogBuffer.h @@ -1,7 +1,7 @@ /** @file * The buffer role: producer Write / consumer Read that decouples * SolidSyslog_Log from Service. These calls dispatch to the injected buffer's - * vtable, so behaviour — notably whether Write blocks or returns at once — is + * vtable, so behaviour - notably whether Write blocks or returns at once - is * that buffer's. */ #ifndef SOLIDSYSLOGBUFFER_H #define SOLIDSYSLOGBUFFER_H @@ -26,7 +26,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * in @p bytesRead; returns false when nothing was delivered, which the drain * loop reads as "empty, stop". @p bytesRead is always set (0 on false). A * head record too large for @p maxSize also returns false and is left - * un-dequeued (the drain stalls at it) — this cannot arise under correct + * un-dequeued (the drain stalls at it) - this cannot arise under correct * configuration, so an implementation reports it via SolidSyslog_Error under * the buffer-backend-failed category rather than failing silently. */ bool SolidSyslogBuffer_Read(struct SolidSyslogBuffer * buffer, void* data, size_t maxSize, size_t* bytesRead); diff --git a/Core/Interface/SolidSyslogBufferCategories.h b/Core/Interface/SolidSyslogBufferCategories.h index c0369e5c..63a2f934 100644 --- a/Core/Interface/SolidSyslogBufferCategories.h +++ b/Core/Interface/SolidSyslogBufferCategories.h @@ -12,7 +12,7 @@ * Portable Buffer-role error categories. Any Buffer implementation reuses * these; a portable handler switch on event->Category reacts to a buffer * backend failure identically regardless of the underlying mechanism - * (POSIX message queue, ring, ...). + * (POSIX message queue, ring...). */ /** The buffer's underlying backend refused a record (queue full, write failed, diff --git a/Core/Interface/SolidSyslogBufferDefinition.h b/Core/Interface/SolidSyslogBufferDefinition.h index d28ed769..1cb763f6 100644 --- a/Core/Interface/SolidSyslogBufferDefinition.h +++ b/Core/Interface/SolidSyslogBufferDefinition.h @@ -1,5 +1,5 @@ /** @file - * The Buffer vtable (Write / Read) — the contract an implementor fills in (the + * The Buffer vtable (Write / Read) - the contract an implementor fills in (the * Buffer extension point). */ #ifndef SOLIDSYSLOGBUFFERDEFINITION_H #define SOLIDSYSLOGBUFFERDEFINITION_H @@ -17,7 +17,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * the two sides mutually safe itself, since Service (Read) and Log (Write) * can run on different tasks. * Read returns false for a head record too large for the caller's buffer and - * reports it via SolidSyslog_Error (buffer-backend-failed) — that state + * reports it via SolidSyslog_Error (buffer-backend-failed) - that state * cannot arise under correct configuration, so it must not be silent. * * Records come back in the order they went in, and one Read delivers diff --git a/Core/Interface/SolidSyslogCircularBuffer.h b/Core/Interface/SolidSyslogCircularBuffer.h index ade598b4..b6ca5f4c 100644 --- a/Core/Interface/SolidSyslogCircularBuffer.h +++ b/Core/Interface/SolidSyslogCircularBuffer.h @@ -1,6 +1,6 @@ /** @file * An in-memory ring Buffer that decouples Log (enqueue) from Service (drain), - * backed entirely by caller-supplied storage — no allocation of its own. + * backed entirely by caller-supplied storage - no allocation of its own. * * Records are framed with a uint16 length prefix and stored back-to-back. A * record is never split across the ring's end: one that would straddle the diff --git a/Core/Interface/SolidSyslogCircularBufferErrors.h b/Core/Interface/SolidSyslogCircularBufferErrors.h index 4deb148b..6ed2948d 100644 --- a/Core/Interface/SolidSyslogCircularBufferErrors.h +++ b/Core/Interface/SolidSyslogCircularBufferErrors.h @@ -18,7 +18,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN SOLIDSYSLOG_CIRCULAR_BUFFER_ERROR_UNKNOWN_DESTROY, /** The record at the head of the ring is larger than the read buffer * Service handed to Read, so it cannot be delivered and is left - * un-dequeued — the drain stalls at this record. This cannot occur + * un-dequeued - the drain stalls at this record. This cannot occur * under correct configuration (the drain scratch is sized to hold any * record Write accepts), so an emitted code indicates the ring's * length prefix has been corrupted. */ diff --git a/Core/Interface/SolidSyslogCrc16.h b/Core/Interface/SolidSyslogCrc16.h index 9fb7849f..186096df 100644 --- a/Core/Interface/SolidSyslogCrc16.h +++ b/Core/Interface/SolidSyslogCrc16.h @@ -1,7 +1,7 @@ /** @file * CRC-16/CCITT-FALSE checksum (poly 0x1021, init 0xFFFF, no reflection, no * final XOR; a.k.a. CRC-16/IBM-3740, check value 0x29B1). A pure function over - * a byte range — no state, no lifecycle. Used by SolidSyslogCrc16Policy for an + * a byte range - no state, no lifecycle. Used by SolidSyslogCrc16Policy for an * unkeyed at-rest integrity trailer. */ #ifndef SOLIDSYSLOGCRC16_H #define SOLIDSYSLOGCRC16_H diff --git a/Core/Interface/SolidSyslogCrc16Policy.h b/Core/Interface/SolidSyslogCrc16Policy.h index 5fb0909a..a3d7aa17 100644 --- a/Core/Interface/SolidSyslogCrc16Policy.h +++ b/Core/Interface/SolidSyslogCrc16Policy.h @@ -1,7 +1,7 @@ /** @file * A SecurityPolicy that appends a two-byte CRC-16 trailer to each stored * record. Seal computes the CRC over the whole content; Open recomputes and - * compares. This is an unkeyed checksum — it catches accidental corruption + * compares. This is an unkeyed checksum - it catches accidental corruption * (bit-rot, a truncated write) but is not tamper-evidence: anyone who edits a * record can recompute a matching CRC. For tamper-evidence or confidentiality * use a keyed policy. Being a checksum (not an AEAD), it ignores the record's diff --git a/Core/Interface/SolidSyslogDatagram.h b/Core/Interface/SolidSyslogDatagram.h index c89832a9..f3e8c08e 100644 --- a/Core/Interface/SolidSyslogDatagram.h +++ b/Core/Interface/SolidSyslogDatagram.h @@ -17,7 +17,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogDatagram; /* Distinct outcomes of SendTo. Oversize is reserved for the EMSGSIZE - * recovery path (S12.12) — implementations that cannot detect oversize + * recovery path (S12.12) - implementations that cannot detect oversize * collapse it into Failed. */ enum SolidSyslogDatagramSendResult { @@ -40,8 +40,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * the sender trims to MaxPayload and retries. * @retval SOLIDSYSLOG_DATAGRAM_SEND_RESULT_FAILED Transient failure; the record is kept. * - * FAILED is transient by design: its usual causes — an unreachable - * collector, a wrong address or port, a stack not yet up — are resolved + * FAILED is transient by design: its usual causes - an unreachable + * collector, a wrong address or port, a stack not yet up - are resolved * outside the library, and holding the record until they are is what an * audit trail wants. Size is the one cause the record itself carries. * diff --git a/Core/Interface/SolidSyslogDatagramDefinition.h b/Core/Interface/SolidSyslogDatagramDefinition.h index 0bca2b59..da466fea 100644 --- a/Core/Interface/SolidSyslogDatagramDefinition.h +++ b/Core/Interface/SolidSyslogDatagramDefinition.h @@ -1,5 +1,5 @@ /** @file - * The Datagram vtable (Open / SendTo / MaxPayload / Close) — the unconnected + * The Datagram vtable (Open / SendTo / MaxPayload / Close) - the unconnected * (UDP) transport contract an implementor fills in (the Datagram extension * point). */ #ifndef SOLIDSYSLOGDATAGRAMDEFINITION_H diff --git a/Core/Interface/SolidSyslogEndpointHost.h b/Core/Interface/SolidSyslogEndpointHost.h index ad4cc6f8..631c7f0c 100644 --- a/Core/Interface/SolidSyslogEndpointHost.h +++ b/Core/Interface/SolidSyslogEndpointHost.h @@ -1,5 +1,5 @@ /** @file - * The value sink an endpoint callback writes the destination host into — + * The value sink an endpoint callback writes the destination host into - * copied verbatim so a DNS name or IP literal reaches the resolver intact. */ #ifndef SOLIDSYSLOGENDPOINTHOST_H #define SOLIDSYSLOGENDPOINTHOST_H diff --git a/Core/Interface/SolidSyslogError.h b/Core/Interface/SolidSyslogError.h index 3a15a8b1..6d78b3a5 100644 --- a/Core/Interface/SolidSyslogError.h +++ b/Core/Interface/SolidSyslogError.h @@ -11,12 +11,12 @@ #include "SolidSyslogPrival.h" /* - * Policy severities for the universal lifecycle categories — one authoritative + * Policy severities for the universal lifecycle categories - one authoritative * level per category so the choice cannot drift across the dozens of emit * sites that raise them. See docs/error-severity.md. BAD_CONFIG is split: a * fatal misconfig (Create fell back to the Null object) uses the macro below, * while a degraded-but-delivering misconfig emits SOLIDSYSLOG_SEVERITY_WARNING - * directly at the site — the two are genuinely different levels, so a single + * directly at the site - the two are genuinely different levels, so a single * shared macro would be a footgun. */ #define SOLIDSYSLOG_POOL_EXHAUSTED_SEVERITY SOLIDSYSLOG_SEVERITY_CRITICAL diff --git a/Core/Interface/SolidSyslogFileDefinition.h b/Core/Interface/SolidSyslogFileDefinition.h index f8d1db38..b0617b5f 100644 --- a/Core/Interface/SolidSyslogFileDefinition.h +++ b/Core/Interface/SolidSyslogFileDefinition.h @@ -1,6 +1,6 @@ /** @file * The File vtable (Open / Close / IsOpen / Read / Write / SeekTo / Size / - * Truncate / Exists / Delete) — the contract a porter fills in (the File + * Truncate / Exists / Delete) - the contract a porter fills in (the File * extension point). */ #ifndef SOLIDSYSLOGFILEDEFINITION_H #define SOLIDSYSLOGFILEDEFINITION_H @@ -13,7 +13,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** The File contract a porter implements (FatFs, FreeRTOS-Plus-FAT, a raw - * flash driver, ...). One instance holds at most one open file; Open on an + * flash driver...). One instance holds at most one open file; Open on an * already-open instance is not expected. Read/Write share a single position * moved by SeekTo, so the consumer seeks before each transfer. */ struct SolidSyslogFile diff --git a/Core/Interface/SolidSyslogKeyFunction.h b/Core/Interface/SolidSyslogKeyFunction.h index 032fb200..3903e902 100644 --- a/Core/Interface/SolidSyslogKeyFunction.h +++ b/Core/Interface/SolidSyslogKeyFunction.h @@ -16,7 +16,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * seal / verify time, copies the key into a transient buffer, uses it, and * wipes the buffer, so the key is never stored on the policy instance. The * integrator decides where the key actually lives (secure element, KDF, - * encrypted NVM, ...). + * encrypted NVM...). * * Writes up to @p capacity bytes into @p keyOut, sets @p keyLengthOut to * the number of bytes written, and returns true on success. Returns false diff --git a/Core/Interface/SolidSyslogMutex.h b/Core/Interface/SolidSyslogMutex.h index b5b3d6ac..70346fa1 100644 --- a/Core/Interface/SolidSyslogMutex.h +++ b/Core/Interface/SolidSyslogMutex.h @@ -1,7 +1,7 @@ /** @file * The mutex role: mutual exclusion (Lock / Unlock) around buffer and pool * critical sections. These calls dispatch to the injected mutex's vtable, so - * behaviour — including whether Lock blocks — is that mutex's. */ + * behaviour - including whether Lock blocks - is that mutex's. */ #ifndef SOLIDSYSLOGMUTEX_H #define SOLIDSYSLOGMUTEX_H diff --git a/Core/Interface/SolidSyslogMutexDefinition.h b/Core/Interface/SolidSyslogMutexDefinition.h index 5c2aca5d..4b35ee63 100644 --- a/Core/Interface/SolidSyslogMutexDefinition.h +++ b/Core/Interface/SolidSyslogMutexDefinition.h @@ -1,5 +1,5 @@ /** @file - * The Mutex vtable (Lock / Unlock) — the contract an implementor fills in (the + * The Mutex vtable (Lock / Unlock) - the contract an implementor fills in (the * Mutex extension point). */ #ifndef SOLIDSYSLOGMUTEXDEFINITION_H #define SOLIDSYSLOGMUTEXDEFINITION_H diff --git a/Core/Interface/SolidSyslogNullBlockDevice.h b/Core/Interface/SolidSyslogNullBlockDevice.h index e4b934b4..738025a0 100644 --- a/Core/Interface/SolidSyslogNullBlockDevice.h +++ b/Core/Interface/SolidSyslogNullBlockDevice.h @@ -1,5 +1,5 @@ /** @file - * The no-op BlockDevice Null object: every method reports a device that does not exist — + * The no-op BlockDevice Null object: every method reports a device that does not exist - * Acquire, Dispose, Exists, Read, Append and WriteAt return false, Size and GetBlockSize * return 0. */ #ifndef SOLIDSYSLOGNULLBLOCKDEVICE_H diff --git a/Core/Interface/SolidSyslogNullSecurityPolicy.h b/Core/Interface/SolidSyslogNullSecurityPolicy.h index 0808053f..7ba01f59 100644 --- a/Core/Interface/SolidSyslogNullSecurityPolicy.h +++ b/Core/Interface/SolidSyslogNullSecurityPolicy.h @@ -1,5 +1,5 @@ /** @file - * The no-op SecurityPolicy Null object: pass-through integrity — Seal and Open both return + * The no-op SecurityPolicy Null object: pass-through integrity - Seal and Open both return * true without touching the record, adding no integrity data and accepting every record. */ #ifndef SOLIDSYSLOGNULLSECURITYPOLICY_H #define SOLIDSYSLOGNULLSECURITYPOLICY_H diff --git a/Core/Interface/SolidSyslogOriginSd.h b/Core/Interface/SolidSyslogOriginSd.h index 13856b30..e1c8fc75 100644 --- a/Core/Interface/SolidSyslogOriginSd.h +++ b/Core/Interface/SolidSyslogOriginSd.h @@ -5,7 +5,7 @@ * number of repeated ip PARAMs. Every field is independently optional: a NULL * string omits its PARAM, and the ip PARAMs appear only when both GetIpCount * and GetIpAt are supplied (GetIpAt is then called once per index). The config - * strings are borrowed, not copied, and read at Format time — they must outlive + * strings are borrowed, not copied, and read at Format time - they must outlive * the created SD. */ #ifndef SOLIDSYSLOGORIGINSD_H #define SOLIDSYSLOGORIGINSD_H @@ -45,8 +45,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * characters. */ const char* SwVersion; /** NULL omits the enterpriseId PARAM. RFC 5424 §7.2.2 asks for your - * IANA-registered private enterprise number on its own — "32473", or - * "32473.1.2" if you use sub-identifiers below it — rather than the + * IANA-registered private enterprise number on its own - "32473", or + * "32473.1.2" if you use sub-identifiers below it - rather than the * 1.3.6.1.4.1 arc the number already sits under. Registering one is the * caller's to do, and the value's form is not checked here. Until you have * one, RFC 5612 reserves 32473 for examples and testing: use it in a test diff --git a/Core/Interface/SolidSyslogPassthroughBuffer.h b/Core/Interface/SolidSyslogPassthroughBuffer.h index d88ffd3d..a1adf4a6 100644 --- a/Core/Interface/SolidSyslogPassthroughBuffer.h +++ b/Core/Interface/SolidSyslogPassthroughBuffer.h @@ -3,7 +3,7 @@ * sender inline, so SolidSyslog_Log blocks on the send and returns only once it * completes; Read always reports empty because nothing is ever queued, so * Service has nothing to drain. This is the simplest wiring for a single-task - * setup with no store-and-forward — no ring, no mutex, no background drain. The + * setup with no store-and-forward - no ring, no mutex, no background drain. The * cost is that a slow or blocking sender stalls the logging thread. */ #ifndef SOLIDSYSLOGPASSTHROUGHBUFFER_H #define SOLIDSYSLOGPASSTHROUGHBUFFER_H diff --git a/Core/Interface/SolidSyslogResolver.h b/Core/Interface/SolidSyslogResolver.h index 3d01c31e..95f36e9a 100644 --- a/Core/Interface/SolidSyslogResolver.h +++ b/Core/Interface/SolidSyslogResolver.h @@ -1,8 +1,8 @@ /** @file * The resolver role: turn a host/port into a destination address (Resolve) for * a later Datagram or Stream to send to. This call dispatches to the injected - * resolver's vtable, so behaviour — DNS lookup, numeric parse, or a pinned - * fixed destination, and whether it blocks — is that resolver's. */ + * resolver's vtable, so behaviour - DNS lookup, numeric parse, or a pinned + * fixed destination, and whether it blocks - is that resolver's. */ #ifndef SOLIDSYSLOGRESOLVER_H #define SOLIDSYSLOGRESOLVER_H diff --git a/Core/Interface/SolidSyslogResolverCategories.h b/Core/Interface/SolidSyslogResolverCategories.h index 1b257330..caeb6e61 100644 --- a/Core/Interface/SolidSyslogResolverCategories.h +++ b/Core/Interface/SolidSyslogResolverCategories.h @@ -15,7 +15,7 @@ */ /** The resolver could not turn the destination host into an address (DNS - * failure, unparseable literal, ...). */ + * failure, unparseable literal...). */ #define SOLIDSYSLOG_CAT_RESOLVER_RESOLVE_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_RESOLVER_BASE + 1U)) #endif /* SOLIDSYSLOGRESOLVERCATEGORIES_H */ diff --git a/Core/Interface/SolidSyslogResolverDefinition.h b/Core/Interface/SolidSyslogResolverDefinition.h index 69de824d..a1a15288 100644 --- a/Core/Interface/SolidSyslogResolverDefinition.h +++ b/Core/Interface/SolidSyslogResolverDefinition.h @@ -1,5 +1,5 @@ /** @file - * The Resolver vtable (Resolve) — the host-to-address contract an implementor + * The Resolver vtable (Resolve) - the host-to-address contract an implementor * fills in (the Resolver extension point). */ #ifndef SOLIDSYSLOGRESOLVERDEFINITION_H #define SOLIDSYSLOGRESOLVERDEFINITION_H diff --git a/Core/Interface/SolidSyslogSecurityPolicyCategories.h b/Core/Interface/SolidSyslogSecurityPolicyCategories.h index 331caa91..5916ee1c 100644 --- a/Core/Interface/SolidSyslogSecurityPolicyCategories.h +++ b/Core/Interface/SolidSyslogSecurityPolicyCategories.h @@ -10,7 +10,7 @@ /** * Portable SecurityPolicy-role error categories, shared by every integrity / - * confidentiality policy (HMAC, AES-GCM, OpenSSL, Mbed TLS, ...). Seal (write + * confidentiality policy (HMAC, AES-GCM, OpenSSL, Mbed TLS...). Seal (write * side) and open (read side) are kept distinct because "a stored record can no * longer be read back" is a materially different operational signal from * "a record could not be written". diff --git a/Core/Interface/SolidSyslogSecurityPolicyDefinition.h b/Core/Interface/SolidSyslogSecurityPolicyDefinition.h index 2fbdf510..ddd07418 100644 --- a/Core/Interface/SolidSyslogSecurityPolicyDefinition.h +++ b/Core/Interface/SolidSyslogSecurityPolicyDefinition.h @@ -1,5 +1,5 @@ /** @file - * The SecurityPolicy vtable (SealRecord / OpenRecord) — the at-rest + * The SecurityPolicy vtable (SealRecord / OpenRecord) - the at-rest * integrity/confidentiality contract an implementor fills in (the SecurityPolicy * extension point). SealRecord authenticates (AEAD policies also encrypt) and * writes a trailer on the way in; OpenRecord verifies (and decrypts) on replay, diff --git a/Core/Interface/SolidSyslogSender.h b/Core/Interface/SolidSyslogSender.h index 63ad4f9d..9b3b3788 100644 --- a/Core/Interface/SolidSyslogSender.h +++ b/Core/Interface/SolidSyslogSender.h @@ -1,7 +1,7 @@ /** @file * The sender role: deliver a framed message (Send) / drop the connection * (Disconnect). These calls dispatch to the injected sender's vtable, so - * behaviour — transport, framing, connect-on-first-use — is that sender's. */ + * behaviour - transport, framing, connect-on-first-use - is that sender's. */ #ifndef SOLIDSYSLOGSENDER_H #define SOLIDSYSLOGSENDER_H diff --git a/Core/Interface/SolidSyslogSenderDefinition.h b/Core/Interface/SolidSyslogSenderDefinition.h index 938dc1da..8ed6f079 100644 --- a/Core/Interface/SolidSyslogSenderDefinition.h +++ b/Core/Interface/SolidSyslogSenderDefinition.h @@ -1,5 +1,5 @@ /** @file - * The Sender vtable (Send / Disconnect) — the contract an implementor fills in + * The Sender vtable (Send / Disconnect) - the contract an implementor fills in * (the Sender extension point). */ #ifndef SOLIDSYSLOGSENDERDEFINITION_H #define SOLIDSYSLOGSENDERDEFINITION_H diff --git a/Core/Interface/SolidSyslogStore.h b/Core/Interface/SolidSyslogStore.h index 03436e38..61b852da 100644 --- a/Core/Interface/SolidSyslogStore.h +++ b/Core/Interface/SolidSyslogStore.h @@ -1,8 +1,8 @@ /** @file * The store role: retain unsent records (Write) and replay them in order via a * read cursor (ReadNextUnsent / MarkSent), so a send failure never drops a - * stored record — it stays for retry. These calls dispatch to the injected - * store's vtable, so behaviour — capacity, discard policy, durability — is + * stored record - it stays for retry. These calls dispatch to the injected + * store's vtable, so behaviour - capacity, discard policy, durability - is * that store's. */ #ifndef SOLIDSYSLOGSTORE_H #define SOLIDSYSLOGSTORE_H diff --git a/Core/Interface/SolidSyslogStoreDefinition.h b/Core/Interface/SolidSyslogStoreDefinition.h index 2f895126..9a633dac 100644 --- a/Core/Interface/SolidSyslogStoreDefinition.h +++ b/Core/Interface/SolidSyslogStoreDefinition.h @@ -1,6 +1,6 @@ /** @file * The Store vtable (Write / ReadNextUnsent / MarkSent / HasUnsent / IsHalted / - * GetTotalBytes / GetUsedBytes / IsTransient) — the store-and-forward contract + * GetTotalBytes / GetUsedBytes / IsTransient) - the store-and-forward contract * an implementor fills in (the Store extension point). */ #ifndef SOLIDSYSLOGSTOREDEFINITION_H #define SOLIDSYSLOGSTOREDEFINITION_H diff --git a/Core/Interface/SolidSyslogStream.h b/Core/Interface/SolidSyslogStream.h index 159906fa..967ee7ba 100644 --- a/Core/Interface/SolidSyslogStream.h +++ b/Core/Interface/SolidSyslogStream.h @@ -1,8 +1,8 @@ /** @file * The stream role: connection-oriented byte transport (Open / Send / Read / * Close) for octet-framed delivery. These calls dispatch to the injected - * stream's vtable, so behaviour — connect bound, blocking discipline, any TLS - * layering — is that stream's. */ + * stream's vtable, so behaviour - connect bound, blocking discipline, any TLS + * layering - is that stream's. */ #ifndef SOLIDSYSLOGSTREAM_H #define SOLIDSYSLOGSTREAM_H diff --git a/Core/Interface/SolidSyslogStreamDefinition.h b/Core/Interface/SolidSyslogStreamDefinition.h index 4a837246..f6eef418 100644 --- a/Core/Interface/SolidSyslogStreamDefinition.h +++ b/Core/Interface/SolidSyslogStreamDefinition.h @@ -1,5 +1,5 @@ /** @file - * The Stream vtable (Open / Send / Read / Close) — the byte-stream (TCP, TLS + * The Stream vtable (Open / Send / Read / Close) - the byte-stream (TCP, TLS * over TCP) transport contract an implementor fills in (the Stream extension * point). */ #ifndef SOLIDSYSLOGSTREAMDEFINITION_H @@ -27,17 +27,17 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * not just this stream. Leave nothing open on a failed path: the caller * retries with a bare Open and never calls Close first. */ bool (*Open)(struct SolidSyslogStream* base, const struct SolidSyslogAddress* addr); - /** All-or-nothing. Never report a partial write as success — the record + /** All-or-nothing. Never report a partial write as success - the record * is gone from the caller's hands once you return true. If the whole * buffer cannot go, close internally and return false; the caller * reopens and store-and-forward replays. */ bool (*Send)(struct SolidSyslogStream* base, const void* buffer, size_t size); - /** Return 0 when nothing is available, never a negative — the two are + /** Return 0 when nothing is available, never a negative - the two are * acted on differently, and a would-block reported as an error costs a * reconnect on an idle link. Reserve the negative return for a real * teardown, and close internally before making it. */ SolidSyslogSsize (*Read)(struct SolidSyslogStream* base, void* buffer, size_t size); - /** Idempotent, and leaves the instance reusable — a later Open + /** Idempotent, and leaves the instance reusable - a later Open * reconnects it. Called on a stream that is already closed, on one that * never opened, and again from Destroy. */ void (*Close)(struct SolidSyslogStream* base); diff --git a/Core/Interface/SolidSyslogStreamSender.h b/Core/Interface/SolidSyslogStreamSender.h index 84aab85a..6d35a948 100644 --- a/Core/Interface/SolidSyslogStreamSender.h +++ b/Core/Interface/SolidSyslogStreamSender.h @@ -1,6 +1,6 @@ /** @file * A Sender that delivers each message octet-framed (RFC 6587 octet-counting: a - * decimal length, a space, then the message bytes) over any injected Stream — + * decimal length, a space, then the message bytes) over any injected Stream - * plain TCP, TLS, or a caller-supplied byte transport. It resolves the endpoint * and opens the stream lazily on the first Send, reconnecting when the endpoint * version changes or after any send failure (a short or failed write closes the diff --git a/Core/Interface/SolidSyslogStructuredData.h b/Core/Interface/SolidSyslogStructuredData.h index d4ae128c..f291fddc 100644 --- a/Core/Interface/SolidSyslogStructuredData.h +++ b/Core/Interface/SolidSyslogStructuredData.h @@ -1,7 +1,7 @@ /** @file * The structured-data role: emit one or more RFC 5424 SD-ELEMENTs into a * message (Format). This call dispatches to the injected SD's vtable, so the - * content — and whether it is stateful — is that SD's. */ + * content - and whether it is stateful - is that SD's. */ #ifndef SOLIDSYSLOGSTRUCTUREDDATA_H #define SOLIDSYSLOGSTRUCTUREDDATA_H diff --git a/Core/Interface/SolidSyslogStructuredDataDefinition.h b/Core/Interface/SolidSyslogStructuredDataDefinition.h index de6d3441..8efa3abe 100644 --- a/Core/Interface/SolidSyslogStructuredDataDefinition.h +++ b/Core/Interface/SolidSyslogStructuredDataDefinition.h @@ -1,5 +1,5 @@ /** @file - * The StructuredData vtable (Format) — the SD-source contract an implementor + * The StructuredData vtable (Format) - the SD-source contract an implementor * fills in (the StructuredData extension point). */ #ifndef SOLIDSYSLOGSTRUCTUREDDATADEFINITION_H #define SOLIDSYSLOGSTRUCTUREDDATADEFINITION_H @@ -15,7 +15,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * * Format runs inside SolidSyslog_Log, on the application's thread, so an * implementation that blocks stalls the caller's logging. Writing nothing - * is a valid answer — a message where no source writes emits NILVALUE — so + * is a valid answer - a message where no source writes emits NILVALUE - so * a source with nothing to report need not invent a value. */ struct SolidSyslogStructuredData { diff --git a/Core/Interface/SolidSyslogSwitchingSender.h b/Core/Interface/SolidSyslogSwitchingSender.h index 92be6310..c0941bcd 100644 --- a/Core/Interface/SolidSyslogSwitchingSender.h +++ b/Core/Interface/SolidSyslogSwitchingSender.h @@ -1,6 +1,6 @@ /** @file * A composite Sender that fronts several inner senders and routes each message - * through the one the Selector picks — the wiring for dual-SIEM fan-out or an + * through the one the Selector picks - the wiring for dual-SIEM fan-out or an * active/standby failover stack. The Selector is called on every Send and * returns an index into the Senders array; a value at or beyond SenderCount * (including any value when the array is empty) routes to the shared diff --git a/Core/Interface/SolidSyslogTimeQuality.h b/Core/Interface/SolidSyslogTimeQuality.h index 77edd4c6..4edcef5e 100644 --- a/Core/Interface/SolidSyslogTimeQuality.h +++ b/Core/Interface/SolidSyslogTimeQuality.h @@ -25,7 +25,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** syncAccuracy in microseconds; SOLIDSYSLOG_SYNC_ACCURACY_OMIT omits the field. * RFC 5424 §7.1.3 forbids the parameter when isSynced is 0, so a callback * reporting IsSynced false must leave this at SOLIDSYSLOG_SYNC_ACCURACY_OMIT. - * The field is written whenever it holds any other value — the pairing is + * The field is written whenever it holds any other value - the pairing is * the caller's to keep until #748 enforces it. §7.1.3 also asks that it be * written only where the accuracy of the time source is actually known. */ uint32_t SyncAccuracyMicroseconds; diff --git a/Core/Interface/SolidSyslogTlsStreamCategories.h b/Core/Interface/SolidSyslogTlsStreamCategories.h index 5aabc0de..7aaaeead 100644 --- a/Core/Interface/SolidSyslogTlsStreamCategories.h +++ b/Core/Interface/SolidSyslogTlsStreamCategories.h @@ -16,7 +16,7 @@ */ /** TLS context / library setup failed before any handshake (bad CA bundle, - * cert or key load failure, ...). */ + * cert or key load failure...). */ #define SOLIDSYSLOG_CAT_TLS_STREAM_INIT_FAILED ((uint16_t) (SOLIDSYSLOG_CAT_TLS_STREAM_BASE + 1U)) /** The TLS handshake with the server did not complete (peer verification, * protocol, or transport failure). */ diff --git a/Core/Interface/SolidSyslogTunablesDefaults.h b/Core/Interface/SolidSyslogTunablesDefaults.h index e70fba6f..550b31da 100644 --- a/Core/Interface/SolidSyslogTunablesDefaults.h +++ b/Core/Interface/SolidSyslogTunablesDefaults.h @@ -1,6 +1,6 @@ /** @file - * The default values for every compile-time tunable — pool sizes, message / - * path / integrity limits, and timeouts — each #ifndef-guarded so a user + * The default values for every compile-time tunable - pool sizes, message / + * path / integrity limits, and timeouts - each #ifndef-guarded so a user * override wins. Reached through the SolidSyslogTunables.h umbrella. */ #ifndef SOLIDSYSLOG_TUNABLES_DEFAULTS_H #define SOLIDSYSLOG_TUNABLES_DEFAULTS_H @@ -15,8 +15,8 @@ * * A build links exactly one implementation of each platform/vendor-selected * role (one TCP stream backend, one datagram backend, one mutex, one crypto - * vendor, ...), so a single role tunable serves whichever implementation is - * compiled in — the integrator reasons about "how many TCP streams", never + * vendor...), so a single role tunable serves whichever implementation is + * compiled in - the integrator reasons about "how many TCP streams", never * "how many POSIX streams". SOLIDSYSLOG_ADDRESS_POOL_SIZE established this * pattern; the role blocks below follow it. * @@ -56,7 +56,7 @@ * * Floor: smallest size that still leaves room for a meaningful prefix * after subtracting the 6-byte filename suffix and null terminator. - * 32 leaves 24 characters for the prefix — enough for any sane + * 32 leaves 24 characters for the prefix - enough for any sane * filesystem location. Sub-floor values rejected at compile time. */ #ifndef SOLIDSYSLOG_MAX_PATH_SIZE @@ -69,7 +69,7 @@ /** * Maximum bytes of integrity-tag the library will reserve per record. - * Drives the RecordStore per-record buffer width — every record carries + * Drives the RecordStore per-record buffer width - every record carries * a tag this wide regardless of the active SolidSyslogSecurityPolicy. * Default 32 is large enough for HMAC-SHA256; CRC-16 uses 2 of those * bytes; the rest is unused slack the integrator can recover by @@ -95,7 +95,7 @@ * holds more records before rotating to a fresh file; a smaller block * rotates (and fsyncs) more often. * - * Floor: one worst-case record — the RFC 5424 max message plus the widest + * Floor: one worst-case record - the RFC 5424 max message plus the widest * integrity tag plus the 5-byte record framing (2 magic + 2 length + * 1 sent-flag). Below that a block could not hold a single record, so the * default must clear it for every SecurityPolicy. Sub-floor values @@ -133,7 +133,7 @@ * Number of SolidSyslogCircularBuffer instances the library's internal * static pool can simultaneously hold. Each instance is a small * bookkeeping struct (vtable, mutex pointer, ring pointer, head/tail/wrap) - * — roughly 64 bytes on a 64-bit target, 32 on a 32-bit target. The + * - roughly 64 bytes on a 64-bit target, 32 on a 32-bit target. The * caller's ring memory is separate (passed to SolidSyslogCircularBuffer_Create). * * Most integrators only ever create one CircularBuffer per process; @@ -153,10 +153,10 @@ /** * Role pool: Mutex. Number of mutex instances the library's internal static * pool can simultaneously hold, across whichever implementation is compiled - * in — SolidSyslogPosixMutex (pthread_mutex_t), SolidSyslogWindowsMutex + * in - SolidSyslogPosixMutex (pthread_mutex_t), SolidSyslogWindowsMutex * (CRITICAL_SECTION), or SolidSyslogFreeRtosMutex (StaticSemaphore_t). * - * Default 1 — most integrators wire a single mutex into a CircularBuffer or + * Default 1 - most integrators wire a single mutex into a CircularBuffer or * other thread-safe primitive. Targets that need more (e.g. a separate * lifecycle mutex alongside a buffer mutex) bump this via * SOLIDSYSLOG_USER_TUNABLES_FILE. @@ -174,11 +174,11 @@ /** * Role pool: Datagram (UDP transport). Number of datagram instances the * library's internal static pool can simultaneously hold, across whichever - * implementation is compiled in — SolidSyslogPosixDatagram, + * implementation is compiled in - SolidSyslogPosixDatagram, * SolidSyslogWinsockDatagram, SolidSyslogPlusTcpDatagram, or * SolidSyslogLwipRawDatagram. * - * Default 1 — almost all integrators wire a single datagram into a UdpSender. + * Default 1 - almost all integrators wire a single datagram into a UdpSender. * Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely * needed. * @@ -195,11 +195,11 @@ /** * Role pool: Resolver. Number of resolver instances the library's internal * static pool can simultaneously hold, across whichever implementation is - * compiled in — SolidSyslogPosixResolver, SolidSyslogWinsockResolver, + * compiled in - SolidSyslogPosixResolver, SolidSyslogWinsockResolver, * SolidSyslogPlusTcpResolver, SolidSyslogLwipRawResolver, or * SolidSyslogLwipRawDnsResolver. * - * Default 1 — almost all integrators wire a single resolver shared across + * Default 1 - almost all integrators wire a single resolver shared across * their Senders. If a build wires two resolver implementations into one * executable (e.g. the lwIP numeric AND DNS resolver), set this to the sum * via SOLIDSYSLOG_USER_TUNABLES_FILE. @@ -217,9 +217,9 @@ /** * Role pool: File. Number of file instances the library's internal static * pool can simultaneously hold, across whichever implementation is compiled - * in — SolidSyslogPosixFile, SolidSyslogWindowsFile, or SolidSyslogFatFsFile. + * in - SolidSyslogPosixFile, SolidSyslogWindowsFile, or SolidSyslogFatFsFile. * - * Default 1 — almost all integrators wire a single file into a + * Default 1 - almost all integrators wire a single file into a * FileBlockDevice. Integrators using FileBlockDevice with BlockStore may * want to bump this in line with SOLIDSYSLOG_BLOCK_STORE_POOL_SIZE via * SOLIDSYSLOG_USER_TUNABLES_FILE. @@ -237,11 +237,11 @@ /** * Role pool: TCP stream. Number of TCP stream instances the library's * internal static pool can simultaneously hold, across whichever - * implementation is compiled in — SolidSyslogPosixTcpStream, + * implementation is compiled in - SolidSyslogPosixTcpStream, * SolidSyslogWinsockTcpStream, SolidSyslogPlusTcpTcpStream, or * SolidSyslogLwipRawTcpStream. * - * Default 2 — common multi-transport wirings combine a plain TCP stream with + * Default 2 - common multi-transport wirings combine a plain TCP stream with * a second TCP stream that underlies a TLS stream (TLS wraps an injected * Stream as its byte transport), so a pool of 1 would silently fall the * second Create back to NullStream. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE @@ -262,7 +262,7 @@ * internal static pool can simultaneously hold. Each instance carries * an mqd_t plus the per-process queue name (Formatter storage). * - * Default 1 — almost all integrators wire a single MQ-backed buffer. + * Default 1 - almost all integrators wire a single MQ-backed buffer. * The queue name derives from the process ID, so bumping above 1 in * the same process would race multiple slots onto the same * `/solidsyslog_` name; an integrator needing N > 1 must @@ -284,7 +284,7 @@ * tiny (vtable + a Sender pointer). * * PassthroughBuffer is the single-task "direct-send, no buffering" - * configuration — every integrator typically creates one. Default 1. + * configuration - every integrator typically creates one. Default 1. * Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one process or * task needs its own passthrough Buffer instance. * @@ -304,7 +304,7 @@ * config (resolver/datagram/endpoint pointers), the resolved address * storage, and connection state. * - * Default 1 — almost all integrators wire a single UDP sender into + * Default 1 - almost all integrators wire a single UDP sender into * either SolidSyslogConfig directly or as one branch of a * SwitchingSender. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more * than one is genuinely needed. @@ -323,7 +323,7 @@ * Number of SolidSyslogSwitchingSender instances the library's * internal static pool can simultaneously hold. * - * Default 1 — a SwitchingSender wraps several inner senders, so one + * Default 1 - a SwitchingSender wraps several inner senders, so one * per process is the typical pattern. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE * if more than one is genuinely needed. * @@ -342,7 +342,7 @@ * static pool can simultaneously hold. Each instance carries its * config (resolver/stream/endpoint pointers) and connection state. * - * Default 2 — common multi-transport wirings combine a plain TCP + * Default 2 - common multi-transport wirings combine a plain TCP * stream sender with a TLS stream sender behind a SwitchingSender so * a TLS failure can fall back to plain TCP (or vice-versa). A pool of * 1 would starve the second branch and silently resolve it to the @@ -361,7 +361,7 @@ /** * Number of SolidSyslogBlockStore instances the library's internal - * static pool can simultaneously hold. Sizes three pools 1:1 — the + * static pool can simultaneously hold. Sizes three pools 1:1 - the * BlockStore slot itself, plus the TU-internal RecordStore and * BlockSequence pools that each BlockStore composes. The 1:1 * invariant means a BlockStore slot is guaranteed a free RecordStore @@ -369,7 +369,7 @@ * fallback under normal use, the BlockStore as a whole resolves to * SolidSyslogNullStore. * - * Default 1 — almost all integrators wire a single store-and-forward + * Default 1 - almost all integrators wire a single store-and-forward * BlockStore. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than * one is genuinely needed. * @@ -388,7 +388,7 @@ * static pool can simultaneously hold. Each instance carries the cached * open-file handle plus the path-prefix pointer. * - * Default 1 — almost all integrators wire a single FileBlockDevice as + * Default 1 - almost all integrators wire a single FileBlockDevice as * the backing store for one BlockStore. Bump via * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely needed. * @@ -404,7 +404,7 @@ /** * Number of SolidSyslogMetaSd instances the library's internal - * static pool can simultaneously hold. Default 1 — meta SD is typically + * static pool can simultaneously hold. Default 1 - meta SD is typically * wired into SolidSyslogConfig.Sd[] once per process. * * Floor: 1. Sub-floor values rejected at compile time. @@ -454,7 +454,7 @@ * Period (milliseconds) the SolidSyslogLwipRawTcpStream bounded-connect * spin loop sleeps between polls of the lwIP-side connected_cb flag. * Each iteration calls the integrator-injected SolidSyslogSleepFunction - * so the loop never busy-waits — under NO_SYS=1 the integrator's Sleep + * so the loop never busy-waits - under NO_SYS=1 the integrator's Sleep * implementation ticks sys_check_timeouts and drives RX; under NO_SYS=0 * it yields to the tcpip thread (vTaskDelay or equivalent). * @@ -478,7 +478,7 @@ * SolidSyslogSleepFunction) until the dns_found_callback fires or this deadline * elapses. * - * Default 5000 ms — DNS is markedly slower than the 200 ms TCP connect: a cold + * Default 5000 ms - DNS is markedly slower than the 200 ms TCP connect: a cold * lookup may traverse a recursive resolver and the network round-trip dominates. * There is deliberately no per-instance runtime getter (unlike the TCP connect * timeout); DNS timeout rarely needs live tuning. Override at build time via @@ -498,7 +498,7 @@ * Period (milliseconds) the SolidSyslogLwipRawDnsResolver bounded-resolve spin * loop sleeps between polls of the lwIP-side dns_found_callback done flag. * Each iteration calls the integrator-injected SolidSyslogSleepFunction so the - * loop never busy-waits — under NO_SYS=1 the integrator's Sleep ticks + * loop never busy-waits - under NO_SYS=1 the integrator's Sleep ticks * sys_check_timeouts and drives the DNS retransmit timer; under NO_SYS=0 it * yields to the tcpip thread (vTaskDelay or equivalent). Mirrors * SOLIDSYSLOG_LWIP_RAW_TCP_CONNECT_POLL_MS. @@ -518,12 +518,12 @@ /** * Maximum number of struct pbuf* the SolidSyslogLwipRawTcpStream RX queue * holds before backpressuring lwIP. Bounds the *count* of queued pbufs, - * not their byte volume — lwIP's TCP_WND and MEMP_NUM_PBUF cap upstream + * not their byte volume - lwIP's TCP_WND and MEMP_NUM_PBUF cap upstream * receive bytes; this knob caps how many segment-sized pbufs can pile up * behind a slow Stream_Read drain before the tcp_recv callback returns * non-ERR_OK so lwIP retains the pbuf and replays the callback later. * - * Default 8 — sized for the typical mTLS handshake flight (ServerHello + + * Default 8 - sized for the typical mTLS handshake flight (ServerHello + * Certificate + ServerKeyExchange + ServerHelloDone is 2-4 segments; 8 * leaves margin for cert chains and renegotiation traffic). * @@ -540,12 +540,12 @@ /** * Role pool: AtomicCounter. Number of atomic-counter instances the library's * internal static pool can simultaneously hold, across whichever - * implementation is compiled in — SolidSyslogStdAtomicCounter (C11 + * implementation is compiled in - SolidSyslogStdAtomicCounter (C11 * ) or SolidSyslogWindowsAtomicCounter (legacy MSVC * InterlockedCompareExchange). Each instance carries a single counter word * (the sequenceId counter). * - * Default 1 — RFC 5424 sequenceIds are scoped per SolidSyslog instance, and + * Default 1 - RFC 5424 sequenceIds are scoped per SolidSyslog instance, and * almost all integrators run a single SolidSyslog instance per process. Bump * via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely needed. * @@ -562,11 +562,11 @@ /** * Role pool: TLS stream. Number of TLS stream instances the library's * internal static pool can simultaneously hold, across whichever crypto - * vendor is compiled in — SolidSyslogOpenSslStream (OpenSSL) or + * vendor is compiled in - SolidSyslogOpenSslStream (OpenSSL) or * SolidSyslogMbedTlsStream (Mbed TLS). Each instance carries the vendor's * session/context handles and the integrator's TLS config. * - * Default 1 — TLS senders are scoped per destination and almost all + * Default 1 - TLS senders are scoped per destination and almost all * integrators wire a single TLS sender per process. Bump via * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely needed * (e.g. multi-destination egress with separate TLS sessions per peer). @@ -584,13 +584,13 @@ /** * Role pool: HMAC-SHA256 SecurityPolicy. Number of keyed HMAC policy * instances the library's internal static pool can simultaneously hold, - * across whichever crypto vendor is compiled in — + * across whichever crypto vendor is compiled in - * SolidSyslogMbedTlsHmacSha256Policy or SolidSyslogOpenSslHmacSha256Policy. * Each instance carries the integrator's key-accessor callback - * (SolidSyslogKeyFunction) and its context — the policy fetches the key on + * (SolidSyslogKeyFunction) and its context - the policy fetches the key on * demand and never stores it. * - * Default 1 — a single at-rest store with one integrity policy is the common + * Default 1 - a single at-rest store with one integrity policy is the common * case. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one store with * an independent key is genuinely needed. * @@ -608,10 +608,10 @@ * Role pool: AES-256-GCM SecurityPolicy. Number of keyed AEAD policy instances * the library's internal static pool can simultaneously hold. Each instance * carries the integrator's key-accessor callback (SolidSyslogKeyFunction) and - * its context — the policy fetches the 32-byte key on demand and never stores + * its context - the policy fetches the 32-byte key on demand and never stores * it. * - * Default 1 — a single at-rest store with one confidentiality policy is the + * Default 1 - a single at-rest store with one confidentiality policy is the * common case. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one store * with an independent key is genuinely needed. * @@ -648,9 +648,9 @@ * Number of SolidSyslog{Posix,Winsock,FreeRtos}Address instances the * library's internal static pool can simultaneously hold. Each instance * carries one platform sockaddr (struct sockaddr_in on POSIX/Windows, - * struct freertos_sockaddr on FreeRTOS) — ~16 bytes per slot. + * struct freertos_sockaddr on FreeRTOS) - ~16 bytes per slot. * - * Default 3 — matches the canonical BDD multi-transport wiring + * Default 3 - matches the canonical BDD multi-transport wiring * (UDP + plain-TCP + TLS-stream, one Address per Sender) so common * integrators are spared an override. Same trade-off as * SOLIDSYSLOG_TCP_STREAM_POOL_SIZE / _STREAM_SENDER_POOL_SIZE: @@ -676,7 +676,7 @@ * comfortable for loopback / LAN and short enough that ten failing attempts * cost 2 s; raise it for WAN deployments behind a high-RTT link. * - * Runtime override: install GetConnectTimeoutMs on the per-Stream config — + * Runtime override: install GetConnectTimeoutMs on the per-Stream config - * the getter is invoked on every connect attempt so live tuning takes effect * without rebuilding or recreating the stream. * @@ -697,7 +697,7 @@ * full TLS 1.2 / 1.3 exchange on a healthy LAN with cert validation; raise * it for WAN deployments or constrained MCUs that handshake slowly. * - * Runtime override: install GetHandshakeTimeoutMs on the per-Stream config — + * Runtime override: install GetHandshakeTimeoutMs on the per-Stream config - * the getter is invoked on every handshake attempt so live tuning takes * effect without rebuilding or recreating the stream. * diff --git a/Core/Interface/SolidSyslogUdpPayload.h b/Core/Interface/SolidSyslogUdpPayload.h index 14f3a948..6854791e 100644 --- a/Core/Interface/SolidSyslogUdpPayload.h +++ b/Core/Interface/SolidSyslogUdpPayload.h @@ -14,7 +14,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** Largest UDP payload guaranteed to fit an unfragmented IPv6 datagram: - * IPv6 minimum MTU 1280 − 40-byte IPv6 header − 8-byte UDP header + * IPv6 minimum MTU 1280 - 40-byte IPv6 header - 8-byte UDP header * (RFC 8200 §5). Used as the last-resort MaxPayload when the OS cannot * report a path MTU. */ enum @@ -29,7 +29,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Returns the largest length' <= length such that buffer[0..length' - 1] * ends on a UTF-8 codepoint boundary. Walks back over any partial * multi-byte sequence at the cut point. Assumes the bytes preceding the - * cut form valid UTF-8 (the formatter guarantees this — S12.10). */ + * cut form valid UTF-8 (the formatter guarantees this - S12.10). */ size_t SolidSyslogUdpPayload_TrimToCodepointBoundary(const uint8_t* buffer, size_t length); SOLIDSYSLOG_EXTERN_C_END diff --git a/Core/Source/SolidSyslog.c b/Core/Source/SolidSyslog.c index b2f394f6..8188b437 100644 --- a/Core/Source/SolidSyslog.c +++ b/Core/Source/SolidSyslog.c @@ -205,7 +205,7 @@ static void SolidSyslog_InstallStructuredData( { if ((configured == NULL) && (count > 0U)) { - /* Inconsistent pairing — the formatter would dereference Sd[i] for + /* Inconsistent pairing - the formatter would dereference Sd[i] for * i < SdCount against a NULL array. Report and leave the reset * defaults (no SD) in place so Log() degrades safely. */ SolidSyslog_Report( @@ -239,7 +239,7 @@ enum SolidSyslogServiceStatus SolidSyslog_Service(struct SolidSyslog* handle) } else { - /* Halted store — skip drain/send. */ + /* Halted store - skip drain/send. */ status = SOLIDSYSLOG_SERVICE_HALTED; } @@ -270,19 +270,19 @@ static enum SolidSyslogServiceStatus SolidSyslog_ProcessMessages(struct SolidSys } else { - /* Buffer idle, nothing stored, no failed send — IDLE (initial value). */ + /* Buffer idle, nothing stored, no failed send - IDLE (initial value). */ } return status; } /* Eagerly drain the buffer so the producer-side shock absorber stays small while - * the sender is slow or down — overflow then engages the store's discard policy + * the sender is slow or down - overflow then engages the store's discard policy * rather than silently dropping at the buffer. The fall-through to a direct * Sender_Send on Store_Write rejection is *only* taken when the store is * transient (NullStore): a NullStore Write rejection means "I never retain * anything, please try the sender." For a real BlockStore, rejection is the - * discard policy speaking — letting that message escape via direct send would + * discard policy speaking - letting that message escape via direct send would * break the discard-newest contract (a newer message would bypass older stored * ones once the sender recovered). */ static inline bool SolidSyslog_DrainBufferIntoStore(struct SolidSyslog* self) @@ -364,7 +364,7 @@ static void SolidSyslog_DoLog( } else { - /* Inconsistent pairing — the formatter would dereference sd[i] for + /* Inconsistent pairing - the formatter would dereference sd[i] for i < sdCount against a NULL array. Report and drop to no per-message SD so the message still logs (degrade safely), mirroring the Create-time guard in SolidSyslog_InstallStructuredData. */ diff --git a/Core/Source/SolidSyslogBlockSequence.c b/Core/Source/SolidSyslogBlockSequence.c index 2cd16ba7..49dafdbd 100644 --- a/Core/Source/SolidSyslogBlockSequence.c +++ b/Core/Source/SolidSyslogBlockSequence.c @@ -177,7 +177,7 @@ static void BlockSequence_ScanForBlockPresence( } else { - /* present run already closed — nothing to record */ + /* present run already closed - nothing to record */ } } } @@ -199,7 +199,7 @@ static void BlockSequence_LocateRunBoundaries(const struct BlockPresence* presen *newest = BlockSequence_CircularPrev(*newest); } } - /* else: every block is present — maxBlocks is clamped to MAX_SEQUENCE - 1 + /* else: every block is present - maxBlocks is clamped to MAX_SEQUENCE - 1 * so this cannot arise from the library's own rotation. Caller's defaults * for oldest=0, newest=MAX_SEQUENCE-1 stand. */ } @@ -237,7 +237,7 @@ static inline void BlockSequence_NotifyThresholdCrossed(struct SolidSyslogBlockS } else { - /* still above threshold and already notified — no edge to report */ + /* still above threshold and already notified - no edge to report */ } } } @@ -272,7 +272,7 @@ bool SolidSyslogBlockSequence_PrepareForWrite( if (blockFull && BlockSequence_StoreIsFull(blockSequence)) { - blockSequence->AtCapacity = true; /* sticky 100% — fixes UsedBytes at total */ + blockSequence->AtCapacity = true; /* sticky 100% - fixes UsedBytes at total */ BlockSequence_NotifyThresholdCrossed(blockSequence); /* threshold first per S05.09 ordering */ BlockSequence_NotifyStoreFull(blockSequence); spaceAvailable = false; @@ -283,7 +283,7 @@ bool SolidSyslogBlockSequence_PrepareForWrite( } else { - /* current block has room — leave spaceAvailable=true */ + /* current block has room - leave spaceAvailable=true */ } return spaceAvailable; @@ -354,7 +354,7 @@ static bool BlockSequence_RotateToNextBlock(struct SolidSyslogBlockSequence* blo /* Dispose-then-Acquire enforces the BlockDevice contract that an Acquired block * starts empty. Stale content can be left by a crash mid-Append on a previous * run, or by a Dispose that succeeded after our state had already advanced - * past it. Flash drivers depend on this — Acquire = erase, and writing into + * past it. Flash drivers depend on this - Acquire = erase, and writing into * a non-erased block corrupts data on most flash families. * * If Dispose fails we surface the failure rather than letting Acquire mask it: diff --git a/Core/Source/SolidSyslogBlockStore.c b/Core/Source/SolidSyslogBlockStore.c index 4f58c9f8..909ffb16 100644 --- a/Core/Source/SolidSyslogBlockStore.c +++ b/Core/Source/SolidSyslogBlockStore.c @@ -14,7 +14,7 @@ const struct SolidSyslogErrorSource BlockStoreErrorSource = {"BlockStore"}; -/* vtable — forward-declared because BlockStore_InitialiseVtable references them before their definitions */ +/* vtable - forward-declared because BlockStore_InitialiseVtable references them before their definitions */ static bool BlockStore_Write(struct SolidSyslogStore* base, const void* data, size_t size); static bool BlockStore_ReadNextUnsent(struct SolidSyslogStore* base, void* data, size_t maxSize, size_t* bytesRead); static void BlockStore_MarkSent(struct SolidSyslogStore* base); @@ -29,12 +29,12 @@ static inline void BlockStore_InitialiseVtable(struct SolidSyslogBlockStore* sel static void BlockStore_ResumeFromExistingBlock(struct SolidSyslogBlockStore* self); /* ------------------------------------------------------------------ - * Initialise / Cleanup — private lifecycle pair invoked by Static.c. + * Initialise / Cleanup - private lifecycle pair invoked by Static.c. * * Initialise stores the two inner pool pointers (Static.c acquired them * before this call), wires the vtable, and runs the existing-block * resume scan. Cleanup is a pure vtable swap to NullStore for - * use-after-destroy crash-safety — Static.c destroys the inner pool + * use-after-destroy crash-safety - Static.c destroys the inner pool * slots outside the outer FreeIfInUse lock, which keeps the per-pool * ConfigLock acquisitions sequential rather than nested. * ----------------------------------------------------------------*/ @@ -62,7 +62,7 @@ void BlockStore_Cleanup(struct SolidSyslogStore* base) { /* Overwrite the abstract base with the shared NullStore vtable so * use-after-destroy is a safe no-op rather than a NULL-fn-pointer crash. - * The inner pool pointers are still in the slot at this point — Static.c + * The inner pool pointers are still in the slot at this point - Static.c * pulls them out before FreeIfInUse and destroys them after the outer * lock is released. */ *base = *SolidSyslogNullStore_Get(); @@ -162,7 +162,7 @@ static size_t BlockStore_GetUsedBytes(struct SolidSyslogStore* base) return SolidSyslogBlockSequence_UsedBytes(BlockStore_SelfFromBase(base)->BlockSequence); } -/* BlockStore retains records — a BlockStore_Write rejection here is the discard +/* BlockStore retains records - a BlockStore_Write rejection here is the discard * policy speaking (DISCARD_NEWEST or HALT), and the message must NOT * bypass older stored records via a Service direct-send fallback. */ static bool BlockStore_IsTransient(struct SolidSyslogStore* base) diff --git a/Core/Source/SolidSyslogBlockStoreStatic.c b/Core/Source/SolidSyslogBlockStoreStatic.c index d850fe6b..61a19ef9 100644 --- a/Core/Source/SolidSyslogBlockStoreStatic.c +++ b/Core/Source/SolidSyslogBlockStoreStatic.c @@ -51,8 +51,8 @@ struct SolidSyslogStore* SolidSyslogBlockStore_Create(const struct SolidSyslogBl if (!BlockStore_DeviceCanHoldOneRecord(config, recordStore)) { /* The device's block is smaller than one worst-case record. The store - * still works — BuildBlockSequenceConfig grows the block to the minimum so - * a record always fits — but the device was configured below a usable size, + * still works - BuildBlockSequenceConfig grows the block to the minimum so + * a record always fits - but the device was configured below a usable size, * so surface it as a WARNING (delivered, degraded) rather than failing. */ BlockStore_Report( SOLIDSYSLOG_SEVERITY_WARNING, @@ -134,7 +134,7 @@ static struct SolidSyslogBlockSequenceConfig BlockStore_BuildBlockSequenceConfig /* True when the device's block can hold one worst-case record (max message + the active * policy's trailer + record framing). When false the block is grown to that floor and a - * WARNING is emitted — the store works, but the device's configured size was degraded. */ + * WARNING is emitted - the store works, but the device's configured size was degraded. */ static bool BlockStore_DeviceCanHoldOneRecord( const struct SolidSyslogBlockStoreConfig* config, const struct SolidSyslogRecordStore* recordStore @@ -155,7 +155,7 @@ void SolidSyslogBlockStore_Destroy(struct SolidSyslogStore* base) * the BlockStore_Cleanup callback, because Cleanup overwrites the * abstract base with the NullStore vtable but the derived RecordStore / * BlockSequence pointers stay in the slot. After the outer FreeIfInUse - * releases the ConfigLock we destroy the inner slots — keeps each pool's + * releases the ConfigLock we destroy the inner slots - keeps each pool's * lock acquisition sequential rather than nested. */ struct SolidSyslogRecordStore* recordStore = BlockStore_Pool[index].RecordStore; struct SolidSyslogBlockSequence* blockSequence = BlockStore_Pool[index].BlockSequence; diff --git a/Core/Source/SolidSyslogCrc16Policy.c b/Core/Source/SolidSyslogCrc16Policy.c index 1300b776..904883c0 100644 --- a/Core/Source/SolidSyslogCrc16Policy.c +++ b/Core/Source/SolidSyslogCrc16Policy.c @@ -34,7 +34,7 @@ void SolidSyslogCrc16Policy_Destroy(void) { } -/* CRC-16 is a checksum, not an AEAD — it covers the whole content and has no +/* CRC-16 is a checksum, not an AEAD - it covers the whole content and has no * use for the header/body split, so HeaderLength is ignored. It detects * accidental corruption; it authenticates nothing. */ static bool Crc16Policy_Crc16SealRecord( diff --git a/Core/Source/SolidSyslogEndpointHostPrivate.h b/Core/Source/SolidSyslogEndpointHostPrivate.h index ade9a4ec..f6de93e9 100644 --- a/Core/Source/SolidSyslogEndpointHostPrivate.h +++ b/Core/Source/SolidSyslogEndpointHostPrivate.h @@ -16,7 +16,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogFormatter* Formatter; }; - /* Internal constructor — wraps a sender's stack host formatter. The sender + /* Internal constructor - wraps a sender's stack host formatter. The sender * builds one per resolve, passes it to the configured endpoint callback, * then reads the formatted host back out. Stack-transient: the caller owns * the storage. */ diff --git a/Core/Source/SolidSyslogFileBlockDevice.c b/Core/Source/SolidSyslogFileBlockDevice.c index ff06ae99..4ef12de5 100644 --- a/Core/Source/SolidSyslogFileBlockDevice.c +++ b/Core/Source/SolidSyslogFileBlockDevice.c @@ -24,7 +24,7 @@ enum SEQUENCE_DIGITS = 2U, FILENAME_SUFFIX = SEQUENCE_DIGITS + sizeof(FILE_EXTENSION) - 1U, MAX_PREFIX_LENGTH = (size_t) SOLIDSYSLOG_MAX_PATH_SIZE - (size_t) FILENAME_SUFFIX - 1U, - /* Two-digit on-disk sequence — indices > 99 cannot be represented + /* Two-digit on-disk sequence - indices > 99 cannot be represented * uniquely. Without this guard, a wide blockIndex would be narrowed * to uint8_t and alias an existing block (256 -> 00). */ MAX_BLOCK_INDEX = 99U @@ -35,7 +35,7 @@ static inline bool FileBlockDevice_IsValidBlockIndex(size_t blockIndex) return blockIndex <= MAX_BLOCK_INDEX; } -/* vtable — forward-declared because FileBlockDevice_Initialise wires them before their definitions */ +/* vtable - forward-declared because FileBlockDevice_Initialise wires them before their definitions */ static bool FileBlockDevice_Acquire(struct SolidSyslogBlockDevice* base, size_t blockIndex); static bool FileBlockDevice_Dispose(struct SolidSyslogBlockDevice* base, size_t blockIndex); static bool FileBlockDevice_Exists(struct SolidSyslogBlockDevice* base, size_t blockIndex); diff --git a/Core/Source/SolidSyslogFileBlockDevicePrivate.h b/Core/Source/SolidSyslogFileBlockDevicePrivate.h index b426d97c..eee30d1c 100644 --- a/Core/Source/SolidSyslogFileBlockDevicePrivate.h +++ b/Core/Source/SolidSyslogFileBlockDevicePrivate.h @@ -16,7 +16,7 @@ struct SolidSyslogFile; /* OpenHandle caches the single SolidSyslogFile the device holds. The handle is * re-pointed only when the targeted blockIndex changes; same-block runs reuse * it. This is the structural enforcement of the S27.01 single-handle-per-path - * invariant — by construction the device has exactly one underlying file. */ + * invariant - by construction the device has exactly one underlying file. */ struct OpenHandle { struct SolidSyslogFile* File; diff --git a/Core/Source/SolidSyslogFormatter.c b/Core/Source/SolidSyslogFormatter.c index 0d90ff5f..cf1eb9c8 100644 --- a/Core/Source/SolidSyslogFormatter.c +++ b/Core/Source/SolidSyslogFormatter.c @@ -113,7 +113,7 @@ void SolidSyslogFormatter_Bom(struct SolidSyslogFormatter* formatter) void SolidSyslogFormatter_NilValue(struct SolidSyslogFormatter* formatter) { - /* RFC 5424 §6 NILVALUE — a single '-' standing in for an absent field. */ + /* RFC 5424 §6 NILVALUE - a single '-' standing in for an absent field. */ SolidSyslogFormatter_AsciiCharacter(formatter, '-'); } @@ -205,7 +205,7 @@ static inline size_t Formatter_Utf8CodepointLength(const char* source) } else { - /* lead does not start a valid 1-/2-/3-/4-byte UTF-8 sequence — length stays 0 */ + /* lead does not start a valid 1-/2-/3-/4-byte UTF-8 sequence - length stays 0 */ } return length; @@ -318,7 +318,7 @@ static inline void Formatter_WriteEscaped(struct EscapedContext* context) { static const char ESCAPE_PREFIX = '\\'; /* An escape pair on the wire ('\' + char) decodes back to the single - * character it was escaping — one byte in the reader's decoder buffer. */ + * character it was escaping - one byte in the reader's decoder buffer. */ static const size_t ESCAPED_CHARACTER_DECODED_LENGTH = 1; if (Formatter_Fits(context, ESCAPED_CHARACTER_DECODED_LENGTH)) { @@ -528,7 +528,7 @@ static inline void Formatter_TrimTruncatedMultiByteTail(struct SolidSyslogFormat } else { - /* tail does not look like a truncated multi-byte sequence — trim nothing */ + /* tail does not look like a truncated multi-byte sequence - trim nothing */ } for (size_t i = trimFrom; i < p; i++) { diff --git a/Core/Source/SolidSyslogFormatter.h b/Core/Source/SolidSyslogFormatter.h index 08d209ec..f7ef4879 100644 --- a/Core/Source/SolidSyslogFormatter.h +++ b/Core/Source/SolidSyslogFormatter.h @@ -15,7 +15,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN SOLIDSYSLOG_FORMATTER_OVERHEAD = 2U }; -/* NOLINTBEGIN(cppcoreguidelines-macro-usage) — worst-case output sizing +/* NOLINTBEGIN(cppcoreguidelines-macro-usage) - worst-case output sizing macros: must be preprocessor-visible array-size const-expressions, so a static const / constexpr cannot replace them. Now that this header is library-private (Core/Source) the root .clang-tidy governs it and enables @@ -59,7 +59,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void SolidSyslogFormatter_FourDigit(struct SolidSyslogFormatter * formatter, uint32_t value); void SolidSyslogFormatter_SixDigit(struct SolidSyslogFormatter * formatter, uint32_t value); /* Returns a pointer to the formatted bytes. The buffer is NUL-terminated for - * convenience but the content is not a C string — UTF-8 content may contain + * convenience but the content is not a C string - UTF-8 content may contain * embedded NUL (U+0000), and a truncated multi-byte tail is masked with NULs * so strlen stops before any invalid UTF-8. SolidSyslogFormatter_Length * reports the raw byte count (independent of the trim); bytes in diff --git a/Core/Source/SolidSyslogHeaderFieldPrivate.h b/Core/Source/SolidSyslogHeaderFieldPrivate.h index dab957cd..0a603076 100644 --- a/Core/Source/SolidSyslogHeaderFieldPrivate.h +++ b/Core/Source/SolidSyslogHeaderFieldPrivate.h @@ -20,7 +20,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN size_t Remaining; }; - /* Internal constructor — wraps a message-buffer formatter and caps this + /* Internal constructor - wraps a message-buffer formatter and caps this * field at maxLength bytes. MessageFormatter builds one per header field * and passes it to the configured callback. Stack-transient: the caller * owns the storage. */ diff --git a/Core/Source/SolidSyslogMacros.h b/Core/Source/SolidSyslogMacros.h index 6aefbfd0..0632a7e0 100644 --- a/Core/Source/SolidSyslogMacros.h +++ b/Core/Source/SolidSyslogMacros.h @@ -2,9 +2,9 @@ #define SOLIDSYSLOGMACROS_H /* Compile-time assertion. C++11 and C11 have native primitives that carry the - message into the diagnostic; a strict C99 toolchain — the conformance + message into the diagnostic; a strict C99 toolchain - the conformance baseline, built on every pull request by the `build-linux-c99` lane (see - docs/builds.md) — has neither, so it falls back to declaring an array + docs/builds.md) - has neither, so it falls back to declaring an array whose length goes negative (a constraint violation every C99 compiler rejects) when cond is false. The fallback uses a fixed name: repeated identical extern declarations in one translation unit are compatible, so no diff --git a/Core/Source/SolidSyslogMessageFormatter.c b/Core/Source/SolidSyslogMessageFormatter.c index 9068aed7..64a1cd4e 100644 --- a/Core/Source/SolidSyslogMessageFormatter.c +++ b/Core/Source/SolidSyslogMessageFormatter.c @@ -156,7 +156,7 @@ static inline void MessageFormatter_FormatStringField( struct SolidSyslogHeaderField field; /* maxSize is the field's storage size (carries a NUL slot); the usable - * field width is one less — matching the RFC HOSTNAME / APP-NAME / PROCID + * field width is one less - matching the RFC HOSTNAME / APP-NAME / PROCID * caps the scratch-field formatter enforced before this writer existed. */ SolidSyslogHeaderField_FromFormatter(&field, f, maxSize - 1U); fn(&field, context); @@ -218,7 +218,7 @@ static inline void MessageFormatter_FormatSdElements( { /* Skip NULL entries rather than dereference them. Per-instance slots are expected to use SolidSyslogNullSd, but a per-message array is supplied - at the call site where a conditionally-absent SD is naturally NULL — + at the call site where a conditionally-absent SD is naturally NULL - the library must not crash on caller input. */ if (sd[i] != NULL) { @@ -231,7 +231,7 @@ static inline void MessageFormatter_FormatMsg(struct SolidSyslogFormatter* f, co { /* Guard msg before SkipLeadingBom dereferences it, then guard the * post-strip body so a caller-supplied BOM-only string emits no - * dangling SP-BOM (RFC 5424 §6.4 — the BOM belongs to a non-empty MSG). */ + * dangling SP-BOM (RFC 5424 §6.4 - the BOM belongs to a non-empty MSG). */ if (MessageFormatter_StringIsValid(msg)) { const char* body = MessageFormatter_SkipLeadingBom(msg); diff --git a/Core/Source/SolidSyslogNullBuffer.c b/Core/Source/SolidSyslogNullBuffer.c index c5b61c45..d65fac6c 100644 --- a/Core/Source/SolidSyslogNullBuffer.c +++ b/Core/Source/SolidSyslogNullBuffer.c @@ -25,7 +25,7 @@ static bool NullBuffer_Read(struct SolidSyslogBuffer* base, void* data, size_t m return false; } -/* Write swallows the record — a misconfigured Buffer paired with a +/* Write swallows the record - a misconfigured Buffer paired with a * caller that doesn't gate Log() must not block or crash. */ static void NullBuffer_Write(struct SolidSyslogBuffer* base, const void* data, size_t size) { diff --git a/Core/Source/SolidSyslogNullFile.c b/Core/Source/SolidSyslogNullFile.c index f074557a..b0605eb1 100644 --- a/Core/Source/SolidSyslogNullFile.c +++ b/Core/Source/SolidSyslogNullFile.c @@ -35,8 +35,8 @@ struct SolidSyslogFile* SolidSyslogNullFile_Get(void) /* Open returns false so callers see a consistently non-functional file. * NullFile is the fallback when PosixFile / WindowsFile / FatFsFile - * Create exhausts the pool — at that point the wider chain - * (BlockStore → NullStore) is already broken; presenting "open failed" + * Create exhausts the pool - at that point the wider chain + * (BlockStore -> NullStore) is already broken; presenting "open failed" * lets the consumer's existing error path handle it cleanly. */ static bool NullFile_Open(struct SolidSyslogFile* base, const char* path) { diff --git a/Core/Source/SolidSyslogNullStore.c b/Core/Source/SolidSyslogNullStore.c index dbe1ebb9..df833486 100644 --- a/Core/Source/SolidSyslogNullStore.c +++ b/Core/Source/SolidSyslogNullStore.c @@ -30,7 +30,7 @@ struct SolidSyslogStore* SolidSyslogNullStore_Get(void) } /* NullStore never retains. Returns false to signal "not held by this store" - * so the eager-drain loop in ProcessMessages takes the direct-send path — + * so the eager-drain loop in ProcessMessages takes the direct-send path - * NullStore + real-buffer + UDP is the constrained-system "one attempt per * message, no buffering" configuration. */ static bool NullStore_Write(struct SolidSyslogStore* base, const void* data, size_t size) @@ -79,7 +79,7 @@ static size_t NullStore_GetUsedBytes(struct SolidSyslogStore* base) return 0; } -/* NullStore retains nothing — a NullStore_Write rejection means "I never had it, +/* NullStore retains nothing - a NullStore_Write rejection means "I never had it, * please try the sender." Service's DrainBufferIntoStore consults this * to know it's safe to fall through to direct-send. */ static bool NullStore_IsTransient(struct SolidSyslogStore* base) diff --git a/Core/Source/SolidSyslogRecordStore.c b/Core/Source/SolidSyslogRecordStore.c index e7e7312c..97643376 100644 --- a/Core/Source/SolidSyslogRecordStore.c +++ b/Core/Source/SolidSyslogRecordStore.c @@ -99,7 +99,7 @@ void SolidSyslogRecordStore_Initialise( void SolidSyslogRecordStore_Cleanup(struct SolidSyslogRecordStore* recordStore) { /* No owned resources to release. The next SolidSyslogRecordStore_Initialise overwrites every - * field, so leave the slot's bytes alone — clearing them would be + * field, so leave the slot's bytes alone - clearing them would be * write-then-overwrite churn. */ (void) recordStore; } @@ -142,7 +142,7 @@ static inline bool RecordStore_AssembleRecord(struct SolidSyslogRecordStore* rec RecordStore_MagicAddress(recordStore)[0] = MAGIC_BYTE_0; RecordStore_MagicAddress(recordStore)[1] = MAGIC_BYTE_1; - /* Length is packed little-endian into the byte buffer — the on-disk + /* Length is packed little-endian into the byte buffer - the on-disk * format is LE regardless of host (every supported target is LE; an * explicit pack keeps that invariant readable and side-steps MISRA * 21.15 which forbids memcpy between incompatible essential types). */ @@ -275,7 +275,7 @@ static inline bool RecordStore_IsMagicValid(struct SolidSyslogRecordStore* recor static inline uint16_t RecordStore_RecordLength(struct SolidSyslogRecordStore* recordStore) { - /* Little-endian unpack — see AssembleRecord for the format invariant. */ + /* Little-endian unpack - see AssembleRecord for the format invariant. */ const uint8_t* lengthBytes = RecordStore_LengthAddress(recordStore); return (uint16_t) (((uint16_t) lengthBytes[0]) | (((uint16_t) lengthBytes[1]) << 8)); } @@ -494,8 +494,8 @@ static bool RecordStore_AdvancePastSentRecord( /* `flag` defaults to SENT_FLAG_SENT and the Read result is intentionally * ignored: a sent-flag we cannot read is treated as already-sent so the - * scan keeps walking the block. The alternative — stop scanning, refuse - * to advance — would jam the logger on one bad byte and skip every record + * scan keeps walking the block. The alternative - stop scanning, refuse + * to advance - would jam the logger on one bad byte and skip every record * that follows in the same block. The single skipped record surfaces * downstream as a sequenceId gap (RFC 5424 §6.3.1), which the receiver * can detect; an integrator-supplied error reporter will surface diff --git a/Core/Source/SolidSyslogSdElement.c b/Core/Source/SolidSyslogSdElement.c index 77c5ff18..ab552b5c 100644 --- a/Core/Source/SolidSyslogSdElement.c +++ b/Core/Source/SolidSyslogSdElement.c @@ -59,7 +59,7 @@ struct SolidSyslogSdValue* SolidSyslogSdElement_Param(struct SolidSyslogSdElemen /* A skipped param (NULL name, or a suppressed element) opens no framing and * hands back a sink over the drop formatter, so the caller's value writes are - * absorbed without disturbing the element. ValueOpen stays false — there is no + * absorbed without disturbing the element. ValueOpen stays false - there is no * quote for the next SolidSyslogSdElement_Param / SolidSyslogSdElement_End to * close. */ static inline struct SolidSyslogSdValue* SdElement_SkipParam(struct SolidSyslogSdElement* element) diff --git a/Core/Source/SolidSyslogSdElementPrivate.h b/Core/Source/SolidSyslogSdElementPrivate.h index 82dcd655..36192f10 100644 --- a/Core/Source/SolidSyslogSdElementPrivate.h +++ b/Core/Source/SolidSyslogSdElementPrivate.h @@ -13,14 +13,14 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Definition lives here (not the public header) so an SD author handed a * SolidSyslogSdElement* cannot reach the wrapped formatter. The embedded - * Value is the sink SolidSyslogSdElement_Param hands back — one per element, + * Value is the sink SolidSyslogSdElement_Param hands back - one per element, * re-initialised on each SolidSyslogSdElement_Param (only one param value is * open at a time). * * DropStorage backs a zero-size formatter that safely absorbs the value of * a skipped param (NULL param name, or a NULL-SD-ID-suppressed element): * every write to it is dropped, so a skipped value cannot corrupt framing. - * Suppressed marks an element opened with a NULL SD-ID — it emits nothing. */ + * Suppressed marks an element opened with a NULL SD-ID - it emits nothing. */ struct SolidSyslogSdElement { struct SolidSyslogFormatter* Formatter; @@ -31,7 +31,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN bool Suppressed; }; - /* Internal constructor — wraps a message-buffer formatter. MessageFormatter + /* Internal constructor - wraps a message-buffer formatter. MessageFormatter * (S14.06) builds one of these around the handed formatter and passes it to * each SD's Format. Stack-transient: the caller owns the storage. */ void SolidSyslogSdElement_FromFormatter( diff --git a/Core/Source/SolidSyslogSdValue.c b/Core/Source/SolidSyslogSdValue.c index d1d3b264..ce1ff16f 100644 --- a/Core/Source/SolidSyslogSdValue.c +++ b/Core/Source/SolidSyslogSdValue.c @@ -54,7 +54,7 @@ static size_t SdValue_DrainPending(struct SolidSyslogSdValue* value, const char* } else { - /* source exhausted mid-sequence — keep the tail for the next call */ + /* source exhausted mid-sequence - keep the tail for the next call */ } } return consumed; @@ -111,7 +111,7 @@ static inline size_t SdValue_ExpectedLength(char lead) return length; } -/* Emits one UTF-8 unit through the formatter's escaper — the single source of +/* Emits one UTF-8 unit through the formatter's escaper - the single source of * truth for escaping ('"', '\\', ']') and per-byte ill-formed substitution. */ static inline void SdValue_EmitUnit(struct SolidSyslogSdValue* value, const char* bytes, size_t count) { diff --git a/Core/Source/SolidSyslogSdValuePrivate.h b/Core/Source/SolidSyslogSdValuePrivate.h index 36bd35de..397db7ce 100644 --- a/Core/Source/SolidSyslogSdValuePrivate.h +++ b/Core/Source/SolidSyslogSdValuePrivate.h @@ -30,7 +30,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN size_t PendingCount; }; - /* Internal constructor — wraps a message-buffer formatter so values stream + /* Internal constructor - wraps a message-buffer formatter so values stream * straight into it. Stack-transient: the caller owns the storage. */ void SolidSyslogSdValue_FromFormatter(struct SolidSyslogSdValue * value, struct SolidSyslogFormatter * formatter); diff --git a/Core/Source/SolidSyslogSenderHealth.c b/Core/Source/SolidSyslogSenderHealth.c index 2098bde4..519538c4 100644 --- a/Core/Source/SolidSyslogSenderHealth.c +++ b/Core/Source/SolidSyslogSenderHealth.c @@ -26,7 +26,7 @@ void SolidSyslogSenderHealth_Update( else { /* WARNING: a destination outage is recoverable (store-and-forward - * covers it) and may clear on its own — it is not a library fault. + * covers it) and may clear on its own - it is not a library fault. * Setup faults an integrator must fix in code (bad config, pool * exhaustion) are CRITICAL; see docs/error-severity.md. */ SolidSyslog_Error( diff --git a/Core/Source/SolidSyslogSenderHealth.h b/Core/Source/SolidSyslogSenderHealth.h index 358a5576..1175380e 100644 --- a/Core/Source/SolidSyslogSenderHealth.h +++ b/Core/Source/SolidSyslogSenderHealth.h @@ -14,8 +14,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * Per-sender reporting identity: which error source raised the edge and the * per-class detail codes for the two transitions. The portable Sender-role * categories and the severity ladder are owned by - * SolidSyslogSenderHealth_Update — a single authoritative mapping every - * sender shares — so a caller only supplies what is genuinely its own. + * SolidSyslogSenderHealth_Update - a single authoritative mapping every + * sender shares - so a caller only supplies what is genuinely its own. */ struct SolidSyslogSenderHealthReporter { diff --git a/Core/Source/SolidSyslogStatic.c b/Core/Source/SolidSyslogStatic.c index 6a87e7d1..eda1c80e 100644 --- a/Core/Source/SolidSyslogStatic.c +++ b/Core/Source/SolidSyslogStatic.c @@ -26,7 +26,7 @@ static struct SolidSyslogPoolAllocator SolidSyslog_Allocator = {SolidSyslog_InUs /* Exhaustion-fallback handle. Populated lazily on first reach because * the SolidSyslogNull* Get() siblings return runtime addresses (no file-scope * designated initialiser will accept them). Sits outside SolidSyslog_Pool[] so - * IndexFromHandle naturally returns invalid for it — SolidSyslog_Destroy( + * IndexFromHandle naturally returns invalid for it - SolidSyslog_Destroy( * &NullInstance) fires WARNING + ignore, while SolidSyslog_Log / * SolidSyslog_Service against it route through the public Null* siblings and * silently drop. */ diff --git a/Core/Source/SolidSyslogSwitchingSender.c b/Core/Source/SolidSyslogSwitchingSender.c index 4057f4d9..48923590 100644 --- a/Core/Source/SolidSyslogSwitchingSender.c +++ b/Core/Source/SolidSyslogSwitchingSender.c @@ -92,7 +92,7 @@ static inline void SwitchingSender_SwitchTo( /* Out-of-range selector index (including empty-array case) resolves to the * shared NullSender. NullSender.Send returns true so the Service algorithm - * drops the message — a misconfigured selector must not retain messages in + * drops the message - a misconfigured selector must not retain messages in * the Store. */ static inline struct SolidSyslogSender* SwitchingSender_RequestedSender(const struct SolidSyslogSwitchingSender* self) { diff --git a/Core/Source/SolidSyslogTimestampFormatter.h b/Core/Source/SolidSyslogTimestampFormatter.h index 4f7919a4..e9252235 100644 --- a/Core/Source/SolidSyslogTimestampFormatter.h +++ b/Core/Source/SolidSyslogTimestampFormatter.h @@ -9,8 +9,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogTimestamp; /* Formats a captured timestamp as an RFC 3339 / RFC 5424 TIMESTAMP field: - * YYYY-MM-DDTHH:MM:SS.ffffff followed by 'Z' (UTC) or '±HH:MM'. A value - * that violates any RFC range — including a zero-initialised timestamp — + * YYYY-MM-DDTHH:MM:SS.ffffff followed by 'Z' (UTC) or '+/-HH:MM'. A value + * that violates any RFC range - including a zero-initialised timestamp - * is emitted as the NILVALUE '-'. Capturing the current time is the * caller's concern; this module only turns a value into bytes. */ void SolidSyslogTimestampFormatter_Format( diff --git a/Core/Source/SolidSyslogUdpPayload.c b/Core/Source/SolidSyslogUdpPayload.c index d6cf5846..f49bb78c 100644 --- a/Core/Source/SolidSyslogUdpPayload.c +++ b/Core/Source/SolidSyslogUdpPayload.c @@ -60,7 +60,7 @@ static inline bool UdpPayload_LastCodepointExtendsPastCut( return (lastCodepointStart + UdpPayload_ExpectedSequenceLength(buffer[lastCodepointStart])) > length; } -/* 11110xxx is the only remaining pattern — invalid bytes never reach here +/* 11110xxx is the only remaining pattern - invalid bytes never reach here * because the formatter (S12.10) guarantees valid UTF-8 upstream. */ static inline size_t UdpPayload_ExpectedSequenceLength(uint8_t startByte) { diff --git a/Core/Source/SolidSyslogUdpSender.c b/Core/Source/SolidSyslogUdpSender.c index 1cb3bd96..0a73d426 100644 --- a/Core/Source/SolidSyslogUdpSender.c +++ b/Core/Source/SolidSyslogUdpSender.c @@ -94,7 +94,7 @@ static bool UdpSender_Send(struct SolidSyslogSender* base, const void* buffer, s return result; } -/* Driven only from the genuine delivery path — a NULL-buffer argument error +/* Driven only from the genuine delivery path - a NULL-buffer argument error * never touches the delivery-health edge. */ static inline void UdpSender_UpdateDeliveryHealth(struct SolidSyslogUdpSender* self, bool delivered) { @@ -234,7 +234,7 @@ static inline enum SolidSyslogDatagramSendResult UdpSender_RetryAfterOversize( if (result == SOLIDSYSLOG_DATAGRAM_SEND_RESULT_OVERSIZE) { /* Retry still OVERSIZE means the kernel disagrees with its own - * MaxPayload — swallow for the same reason. */ + * MaxPayload - swallow for the same reason. */ result = SOLIDSYSLOG_DATAGRAM_SEND_RESULT_SENT; } } diff --git a/Core/Source/SolidSyslogUtf8.h b/Core/Source/SolidSyslogUtf8.h index 225446d0..eb9e52fa 100644 --- a/Core/Source/SolidSyslogUtf8.h +++ b/Core/Source/SolidSyslogUtf8.h @@ -8,7 +8,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Byte-level UTF-8 lead and continuation classifiers per RFC 3629 §4. - * These cover the disjoint top-bit patterns only — overlong / surrogate / + * These cover the disjoint top-bit patterns only - overlong / surrogate / * above-Unicode validity is composed on top by callers that need it. */ static inline bool SolidSyslogUtf8_IsAsciiByte(char byte) diff --git a/Platform/FatFs/Source/SolidSyslogFatFsFile.c b/Platform/FatFs/Source/SolidSyslogFatFsFile.c index 4d21a031..632cf869 100644 --- a/Platform/FatFs/Source/SolidSyslogFatFsFile.c +++ b/Platform/FatFs/Source/SolidSyslogFatFsFile.c @@ -11,7 +11,7 @@ #include "SolidSyslogTunables.h" #include "ff.h" -/* The shared file-block-size default must clear one FatFs sector — a block +/* The shared file-block-size default must clear one FatFs sector - a block * smaller than the underlying sector cannot back a coherent on-disk record * layout. FF_MAX_SS comes from the integrator's ffconf.h; guard with defined() * so the check is skipped (rather than evaluating an undefined identifier) on diff --git a/Platform/FreeRtos/Interface/SolidSyslogFreeRtosMutex.h b/Platform/FreeRtos/Interface/SolidSyslogFreeRtosMutex.h index 2ab56c67..f418bbaa 100644 --- a/Platform/FreeRtos/Interface/SolidSyslogFreeRtosMutex.h +++ b/Platform/FreeRtos/Interface/SolidSyslogFreeRtosMutex.h @@ -11,9 +11,9 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogMutex; - /** Create takes no config; an exhausted pool — or a build without + /** Create takes no config; an exhausted pool - or a build without * configSUPPORT_STATIC_ALLOCATION=1, where xSemaphoreCreateMutexStatic - * yields no handle — falls back to the shared NullMutex, whose Lock and + * yields no handle - falls back to the shared NullMutex, whose Lock and * Unlock are no-ops. */ struct SolidSyslogMutex* SolidSyslogFreeRtosMutex_Create(void); /** Release the pool slot; deletes the underlying FreeRTOS mutex semaphore. */ diff --git a/Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h b/Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h index 55f2e02c..4eff4151 100644 --- a/Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h +++ b/Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h @@ -13,8 +13,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** Hundredths of a second of uptime from xTaskGetTickCount, for the meta-SD * sysUpTime field. Meets the SolidSyslogSysUpTimeFunction contract for a * 64-bit TickType_t at any tick rate, and for a 32-bit one whose - * configTICK_RATE_HZ divides 100. Elsewhere — the 1000 Hz default among - * them — the value wraps to zero early, so supply your own + * configTICK_RATE_HZ divides 100. Elsewhere - the 1000 Hz default among + * them - the value wraps to zero early, so supply your own * SolidSyslogSysUpTimeFunction where uptime matters. */ uint32_t SolidSyslogFreeRtos_GetSysUpTime(void); diff --git a/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutex.c b/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutex.c index 2d4d0e09..6421233b 100644 --- a/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutex.c +++ b/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutex.c @@ -29,7 +29,7 @@ void FreeRtosMutex_Initialise(struct SolidSyslogMutex* base) /* The storage is ours, so this cannot fail for want of memory; the kernel * returns NULL only when handed a NULL buffer, which this call never does. * configSUPPORT_STATIC_ALLOCATION is a compile-time requirement rather than - * a runtime one — without it the function does not exist to call. The + * a runtime one - without it the function does not exist to call. The * branch is therefore defensive: an unexpected NULL leaves the NullMutex * vtable in place rather than a dangling handle in Lock/Unlock. */ if (xSemaphoreCreateMutexStatic(&self->Buffer) != NULL) diff --git a/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexPrivate.h b/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexPrivate.h index 59bb6d2d..f15458bc 100644 --- a/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexPrivate.h +++ b/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexPrivate.h @@ -13,7 +13,7 @@ /* xSemaphoreCreateMutexStatic returns a handle that is the same pointer * as the StaticSemaphore_t passed in, so the per-instance struct doesn't - * carry a separate SemaphoreHandle_t — the primitive is embedded directly, + * carry a separate SemaphoreHandle_t - the primitive is embedded directly, * as in every Mutex adapter. */ struct SolidSyslogFreeRtosMutex { diff --git a/Platform/LwipRaw/Interface/SolidSyslogLwipRawDatagram.h b/Platform/LwipRaw/Interface/SolidSyslogLwipRawDatagram.h index 14b46dbb..ab288576 100644 --- a/Platform/LwipRaw/Interface/SolidSyslogLwipRawDatagram.h +++ b/Platform/LwipRaw/Interface/SolidSyslogLwipRawDatagram.h @@ -5,7 +5,7 @@ * * - Open makes a udp_new pcb; Close removes it. Both run under the * SolidSyslogLwipRaw_Marshal hop, since they touch lwIP core state. - * - SendTo runs the whole send — pbuf alloc, udp_sendto, free — in a single + * - SendTo runs the whole send - pbuf alloc, udp_sendto, free - in a single * marshal hop, so a NO_SYS=0 integrator pays one tcpip-thread context switch * per Send rather than three. The pbuf is PBUF_REF: lwIP points at the * caller's buffer instead of copying it, safe because the buffer outlives the diff --git a/Platform/LwipRaw/Interface/SolidSyslogLwipRawDnsResolver.h b/Platform/LwipRaw/Interface/SolidSyslogLwipRawDnsResolver.h index 82d82074..c6ecb539 100644 --- a/Platform/LwipRaw/Interface/SolidSyslogLwipRawDnsResolver.h +++ b/Platform/LwipRaw/Interface/SolidSyslogLwipRawDnsResolver.h @@ -15,8 +15,8 @@ * * - An ERR_OK synchronous hit (numeric literal, DNS cache, local hostlist) * resolves immediately. - * - An ERR_INPROGRESS queued query spins on the caller's thread — sleeping via - * the config's Sleep so lwIP's DNS timer / RX paths get cycles — until the + * - An ERR_INPROGRESS queued query spins on the caller's thread - sleeping via + * the config's Sleep so lwIP's DNS timer / RX paths get cycles - until the * dns_found_callback fires or the deadline passes. The authoritative address * read then runs back under the marshal hop (the thread the callback wrote * on), never off the volatile completion flag. diff --git a/Platform/LwipRaw/Interface/SolidSyslogLwipRawMarshal.h b/Platform/LwipRaw/Interface/SolidSyslogLwipRawMarshal.h index 99f71457..e0ece000 100644 --- a/Platform/LwipRaw/Interface/SolidSyslogLwipRawMarshal.h +++ b/Platform/LwipRaw/Interface/SolidSyslogLwipRawMarshal.h @@ -8,16 +8,16 @@ * state and is intentionally not marshalled.) * * - NO_SYS=1 (bare metal, no RTOS): the default direct-call marshal is correct - * — one execution context, no core to protect. + * - one execution context, no core to protect. * - NO_SYS=0 (RTOS with a tcpip thread): the integrator installs a marshal that - * hops onto that thread — a LOCK_TCPIP_CORE / UNLOCK_TCPIP_CORE pair, or a + * hops onto that thread - a LOCK_TCPIP_CORE / UNLOCK_TCPIP_CORE pair, or a * mailbox post that waits for the callback to run. * * The marshal MUST invoke its callback synchronously, before it returns: the * wrapper reads results the callback writes immediately after the hop, so an * asynchronous marshal is caller error. Core locking satisfies this directly. - * A mailbox post does not on its own — tcpip_callback_with_block(.., block=1) - * blocks until the message is accepted, not until it is executed — so such a + * A mailbox post does not on its own - tcpip_callback_with_block(.., block=1) + * blocks until the message is accepted, not until it is executed - so such a * marshal must wait for completion itself. See docs/platforms/lwipraw/setup.md. */ #ifndef SOLIDSYSLOGLWIPRAWMARSHAL_H #define SOLIDSYSLOGLWIPRAWMARSHAL_H @@ -33,7 +33,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN typedef void (*SolidSyslogLwipRawMarshalFunction)(SolidSyslogLwipRawCallback callback, void* context); /** Installs the process-global marshal. One lwIP instance and one tcpip - * thread per process means a single global slot suffices — same shape as + * thread per process means a single global slot suffices - same shape as * SolidSyslog_SetErrorHandler. NULL restores the direct-call default. * Intended for setup-time configuration; not synchronised with concurrent * installs. */ diff --git a/Platform/LwipRaw/Interface/SolidSyslogLwipRawTcpStream.h b/Platform/LwipRaw/Interface/SolidSyslogLwipRawTcpStream.h index 0215ac15..b244486e 100644 --- a/Platform/LwipRaw/Interface/SolidSyslogLwipRawTcpStream.h +++ b/Platform/LwipRaw/Interface/SolidSyslogLwipRawTcpStream.h @@ -7,13 +7,13 @@ * unmarshalled. What the stream does through its vtable is the substance: * * - Open runs tcp_new + pcb setup + tcp_connect in one marshalled batch, then - * spins on the caller's thread — sleeping via the config's Sleep so lwIP's - * timer / RX paths advance the SYN exchange — until the connected callback + * spins on the caller's thread - sleeping via the config's Sleep so lwIP's + * timer / RX paths advance the SYN exchange - until the connected callback * reports success, an error, or the connect deadline (config's * GetConnectTimeoutMs, re-read each attempt so a runtime-tunable value applies * on the next reconnect) elapses. On failure the half-open pcb is tcp_abort'd. * Every pcb carries SOF_KEEPALIVE, and Nagle is off (TCP_NODELAY) so a small - * latency-sensitive record — or a stacked TLS handshake flight — is not held + * latency-sensitive record - or a stacked TLS handshake flight - is not held * for an ACK. * - Send is all-or-nothing: tcp_write uses TCP_WRITE_FLAG_COPY, so the caller's * buffer lifetime ends at return; any write/output failure closes the stream diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressPrivate.h b/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressPrivate.h index ac0f55f6..161a803c 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressPrivate.h +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressPrivate.h @@ -14,7 +14,7 @@ struct SolidSyslogAddress; * the destination IP and port as independent arguments to udp_sendto / * tcp_connect, so we store them as independent fields and let consumers * read/write them directly via -> on the downcast pointer. No per-field - * accessors — there is no invariant to enforce. */ + * accessors - there is no invariant to enforce. */ struct SolidSyslogLwipRawAddress { ip_addr_t Ip; diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressStatic.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressStatic.c index fddb4a5b..03411db8 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressStatic.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawAddressStatic.c @@ -25,7 +25,7 @@ struct SolidSyslogAddress* SolidSyslogLwipRawAddress_Create(void) { /* TU-private fallback returned when the pool is exhausted. Sized as * a real SolidSyslogLwipRawAddress so subsequent writes (e.g. a Resolver - * overwrite at the exhausted-fallback call site) are bounded — same + * overwrite at the exhausted-fallback call site) are bounded - same * ip_addr_t + u16_t storage as any pooled slot. Not a per-Sender slot: * multi-overflow integrators share this storage and race on it. Bumping * SOLIDSYSLOG_ADDRESS_POOL_SIZE removes the race. */ diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagram.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagram.c index 78e6e3a3..6e6085dc 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagram.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagram.c @@ -28,7 +28,7 @@ struct SolidSyslogAddress; /* Per-operation parameters carried across one marshal hop. Only the fields * the in-flight op needs are set (Open/Close set just Self); SendTo fills the * rest. One struct per class so the void*-context recovery has a single cast - * site (LwipRawDatagramCallFromContext) — see D.002 in docs/misra-deviations.md. */ + * site (LwipRawDatagramCallFromContext) - see D.002 in docs/misra-deviations.md. */ struct LwipRawDatagramCall { struct SolidSyslogLwipRawDatagram* Self; @@ -71,8 +71,8 @@ static inline struct SolidSyslogLwipRawDatagram* LwipRawDatagram_SelfFromBase(st } /* Recovers the per-op call struct from the void* context the marshal passes - * back into each Do* callback. Single named helper so the void→struct cast - * lives in one place — one suppression site per class, not one per callback + * back into each Do* callback. Single named helper so the void->struct cast + * lives in one place - one suppression site per class, not one per callback * (the marshal-seam analogue of LwipRawTcpStream_SelfFromArg; see D.002). */ static inline struct LwipRawDatagramCall* LwipRawDatagramCallFromContext(void* context) { @@ -150,7 +150,7 @@ static enum SolidSyslogDatagramSendResult LwipRawDatagram_SendTo( return result; } -/* Runs the whole send — pbuf alloc, sendto, free — in one marshalled hop so +/* Runs the whole send - pbuf alloc, sendto, free - in one marshalled hop so * a NO_SYS=0 integrator pays a single tcpip-thread context switch per Send * rather than three. PBUF_REF points lwIP at the caller's buffer; the buffer * outlives the synchronous hop, so no copy is needed. */ diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolver.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolver.c index 68ed883b..42e44544 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolver.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolver.c @@ -31,7 +31,7 @@ struct SolidSyslogAddress; * call runs on the lwIP-owning thread; its immediate return code comes back in * Err. The async-completion result is published the same way: DoPublishResult * runs on the lwIP thread, copies the resolved address into Destination, and - * reports the outcome in Resolved — so the multi-byte ResolvedIp / ResolvedOk + * reports the outcome in Resolved - so the multi-byte ResolvedIp / ResolvedOk * fields the dns_found_callback wrote are read on the thread that wrote them * (race-free, with the marshal providing the cross-thread barrier) rather than * on the caller's thread off the back of the volatile Done flag. One struct so @@ -109,7 +109,7 @@ static bool LwipRawDnsResolver_Resolve( if (call.Err == ERR_OK) { - /* Synchronous hit: numeric literal, DNS cache, or local hostlist — + /* Synchronous hit: numeric literal, DNS cache, or local hostlist - * dns_gethostbyname wrote ResolvedIp under the marshal hop above and the * found_callback never fired, so reading it here (ordered after the * marshal returned) is safe and on a single thread. */ @@ -123,7 +123,7 @@ static bool LwipRawDnsResolver_Resolve( * dns_found_callback signals completion via the volatile Done flag (or * the deadline passes). The callback wrote the multi-byte ResolvedIp / * ResolvedOk on the lwIP thread, so the authoritative read + publish runs - * back on that thread via DoPublishResult — never off the volatile flag + * back on that thread via DoPublishResult - never off the volatile flag * on the caller's thread, which would be an unsynchronised data race. */ if (LwipRawDnsResolver_WaitForCallback(self)) { @@ -132,7 +132,7 @@ static bool LwipRawDnsResolver_Resolve( } else { - /* ERR_ARG / any other immediate rejection — Resolved stays false. + /* ERR_ARG / any other immediate rejection - Resolved stays false. * Terminating else per MISRA 15.7. */ } return call.Resolved; @@ -162,7 +162,7 @@ static void LwipRawDnsResolver_FoundCallback(const char* name, const ip_addr_t* /* Bounded async-resolve spin: each iteration sleeps via the integrator-injected * Sleep so lwIP's DNS timer / RX paths get cycles to advance the query. Runs on - * the caller's thread — never the lwIP thread. Exits when the callback has set + * the caller's thread - never the lwIP thread. Exits when the callback has set * the volatile Done flag (success or NULL-delivery failure) or the deadline * elapses (timeout). Returns whether completion was observed; the authoritative * success/address read happens under the marshal in DoPublishResult, so this diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverPrivate.h b/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverPrivate.h index 51140f9f..b9eeddac 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverPrivate.h +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverPrivate.h @@ -19,7 +19,7 @@ struct SolidSyslogLwipRawDnsResolver /* In-flight async-resolve state. The bounded spin polls Done on the * caller's thread; the dns_found_callback writes Done + ResolvedOk + * ResolvedIp on the lwIP (tcpip) thread. Done is volatile because the two - * threads are different — the synchronous ERR_OK path writes them too, + * threads are different - the synchronous ERR_OK path writes them too, * on the caller's thread, before any spin. */ volatile bool Done; bool ResolvedOk; diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawMarshalPrivate.h b/Platform/LwipRaw/Source/SolidSyslogLwipRawMarshalPrivate.h index d4123c93..560ac802 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawMarshalPrivate.h +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawMarshalPrivate.h @@ -9,7 +9,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Library-internal dispatch call site. The LwipRaw wrapper classes batch the lwIP API calls for one public operation into a single callback and hand it here; we run it through the currently-installed marshal. No NULL - check — the null-object default direct-calls. */ + check - the null-object default direct-calls. */ void SolidSyslogLwipRaw_Marshal(SolidSyslogLwipRawCallback callback, void* context); SOLIDSYSLOG_EXTERN_C_END diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawResolver.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawResolver.c index 3caa9b1b..e38970c8 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawResolver.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawResolver.c @@ -49,7 +49,7 @@ static bool LwipRawResolver_Resolve( /* No SolidSyslogLwipRaw_Marshal hop here: ipaddr_aton is a pure string * parser that touches no lwIP core state, so it is safe on any thread. * The sibling SolidSyslogLwipRawDnsResolver (S28.08) WILL call lwIP DNS - * APIs (dns_gethostbyname) and must marshal them — that is where the hop + * APIs (dns_gethostbyname) and must marshal them - that is where the hop * belongs, not here. */ bool resolved = ipaddr_aton(host, &self->Ip) != 0; if (resolved) diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStream.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStream.c index 29e9640c..41aacc49 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStream.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStream.c @@ -33,7 +33,7 @@ struct SolidSyslogStream; * fills only the fields it needs (Close/Abort set just Self); read-back * results (ConnectErr / SendResult / ReadResult) are returned in the same * struct. One struct per class so the void*-context recovery has a single - * cast site (LwipRawTcpStreamCallFromContext) — see D.002 in + * cast site (LwipRawTcpStreamCallFromContext) - see D.002 in * docs/misra-deviations.md. Send/Read fields never overlap in one call. */ struct LwipRawTcpStreamCall { @@ -124,7 +124,7 @@ static inline bool LwipRawTcpStream_ConfigProvidesGetter(const struct SolidSyslo return config->GetConnectTimeoutMs != NULL; } -/* Null Object substituted when the integrator does not install a getter — +/* Null Object substituted when the integrator does not install a getter - * returns the compile-time tunable so the bounded-wait path has a single * code path regardless of whether the integrator wired runtime tuning. */ static uint32_t LwipRawTcpStream_NullConnectTimeoutGetter(void* context) @@ -140,7 +140,7 @@ static inline struct SolidSyslogLwipRawTcpStream* LwipRawTcpStream_SelfFromBase( /* Recovers our self pointer from the void* argument lwIP passes back into * every callback we registered via tcp_arg(pcb, self). Single named helper - * so the void→struct cast lives in one place — and MISRA 11.5 has one + * so the void->struct cast lives in one place - and MISRA 11.5 has one * suppression site, not one per callback. */ static inline struct SolidSyslogLwipRawTcpStream* LwipRawTcpStream_SelfFromArg(void* arg) { @@ -148,7 +148,7 @@ static inline struct SolidSyslogLwipRawTcpStream* LwipRawTcpStream_SelfFromArg(v } /* Recovers the per-op call struct from the void* context the marshal passes - * back into each Do* callback — the marshal-seam analogue of SelfFromArg, + * back into each Do* callback - the marshal-seam analogue of SelfFromArg, * one cast site for all marshalled ops (see D.002). */ static inline struct LwipRawTcpStreamCall* LwipRawTcpStreamCallFromContext(void* context) { @@ -188,7 +188,7 @@ static bool LwipRawTcpStream_Open(struct SolidSyslogStream* base, const struct S /* The setup-and-connect hop: tcp_new + pcb configuration + tcp_connect all * run on the lwIP-owning thread in one marshalled batch. The connected_cb - * may fire here (synchronously, on the same thread) — it only flips volatile + * may fire here (synchronously, on the same thread) - it only flips volatile * flags. The bounded spin that waits for those flags stays on the caller's * thread (sleeping the lwIP thread mid-connect would starve RX/timers). */ static void LwipRawTcpStream_DoOpenAndConnect(void* context) @@ -226,13 +226,13 @@ static struct tcp_pcb* LwipRawTcpStream_OpenAndConfigurePcb(struct SolidSyslogLw { ip_set_option(pcb, SOF_KEEPALIVE); /* Disable Nagle. The syslog client writes small, latency-sensitive - * records (octet-framed messages, and — when an upper TLS layer is - * stacked on this stream — multi-segment handshake flights) and never + * records (octet-framed messages, and - when an upper TLS layer is + * stacked on this stream - multi-segment handshake flights) and never * pipelines a second write behind an unacked one. With Nagle on, lwIP * holds a sub-MSS segment until the previous one is ACKed; a TLS * handshake flight (e.g. a client certificate) then stalls mid-exchange * waiting for an ACK that the peer only sends after it has the whole - * flight — a deadlock observed against syslog-ng over mutual TLS. + * flight - a deadlock observed against syslog-ng over mutual TLS. * TCP_NODELAY is the right default for this request/response workload. */ tcp_nagle_disable(pcb); tcp_arg(pcb, self); @@ -245,7 +245,7 @@ static struct tcp_pcb* LwipRawTcpStream_OpenAndConfigurePcb(struct SolidSyslogLw /* Bounded synchronous-Open spin: each iteration sleeps via the * integrator-injected Sleep so lwIP's timer / RX paths get cycles to - * advance the SYN/SYN-ACK exchange. Runs on the caller's thread — never the + * advance the SYN/SYN-ACK exchange. Runs on the caller's thread - never the * lwIP thread. Exits on Connected (success), Errored (set by connected_cb * on non-ERR_OK or by tcp_err), or elapsed >= deadline (timeout). */ static bool LwipRawTcpStream_WaitForConnectedCallback(struct SolidSyslogLwipRawTcpStream* self) @@ -269,7 +269,7 @@ static uint32_t LwipRawTcpStream_ResolveConnectTimeoutMs(struct SolidSyslogLwipR return self->Config.GetConnectTimeoutMs(self->Config.ConnectTimeoutContext); } -/* Connect failed or timed out — release the pcb cleanly on the lwIP thread. +/* Connect failed or timed out - release the pcb cleanly on the lwIP thread. * tcp_abort (not tcp_close) because a half-open pcb has no graceful close. */ static void LwipRawTcpStream_DoAbort(void* context) { @@ -295,7 +295,7 @@ static bool LwipRawTcpStream_Send(struct SolidSyslogStream* base, const void* bu * A peer FIN (RecvCallback with NULL p) sets Errored but leaves the pcb non-NULL, * so IsOpen alone would keep writing into a doomed connection; failing the send * lets StreamSender close and reconnect. Read deliberately still runs while - * Errored — it must drain queued bytes and then close on EOF. */ + * Errored - it must drain queued bytes and then close on EOF. */ static inline bool LwipRawTcpStream_IsWritable(const struct SolidSyslogLwipRawTcpStream* self) { return LwipRawTcpStream_IsOpen(self) && !self->Errored; @@ -314,7 +314,7 @@ static bool LwipRawTcpStream_SendOrCloseOnFailure( ) { /* TCP_WRITE_FLAG_COPY hands the caller's buffer to lwIP-owned pbufs - * before tcp_write returns — caller buffer lifetime ends here. + * before tcp_write returns - caller buffer lifetime ends here. * tcp_output nudges transmission; ERR_MEM there is "queued, lwIP * retries" so we still report success (lwIP owns the bytes). */ err_t writeErr = tcp_write(self->Pcb, buffer, (u16_t) size, TCP_WRITE_FLAG_COPY); @@ -385,7 +385,7 @@ static void LwipRawTcpStream_DoRead(void* context) } else { - /* Peer FIN drained → close internally per the Stream contract + /* Peer FIN drained -> close internally per the Stream contract * ("< 0 means EOF AND socket closed internally"); ReadResult stays * READ_FAILED. */ LwipRawTcpStream_ClosePcb(self); @@ -394,14 +394,14 @@ static void LwipRawTcpStream_DoRead(void* context) /* Copies up to `size` bytes out of the head pbuf chain, advancing the read * cursor. The cursor (RxHeadOffset) and the fully-drained test are keyed off - * tot_len, not the first link's len — lwIP hands us a pbuf chain whenever a + * tot_len, not the first link's len - lwIP hands us a pbuf chain whenever a * segment spans more than one pool pbuf, and pbuf_copy_partial walks head->next * for us so the tail links are not lost. The cursor advances by the count * pbuf_copy_partial actually copied, not the requested amount: under lwIP's - * tot_len == Σ link->len invariant the two are equal, but keying off the real + * tot_len == sum of link->len invariant the two are equal, but keying off the real * copy keeps a malformed/overstated tot_len from advancing past un-copied * bytes and reporting stale buffer content as received. When the whole chain - * is drained, pbuf_free's it (frees every link) and advances the queue head — + * is drained, pbuf_free's it (frees every link) and advances the queue head - * tail entries shift up through the bounded ring via modular arithmetic, no * compaction. */ static size_t LwipRawTcpStream_DrainHeadBytes(struct SolidSyslogLwipRawTcpStream* self, void* buffer, size_t size) @@ -431,7 +431,7 @@ static void LwipRawTcpStream_EnqueueRxPbuf(struct SolidSyslogLwipRawTcpStream* s /* Drains every queued pbuf via pbuf_free. Used by ClosePcb so an explicit * Close, Send-failure-induced Close, or Destroy never leaks the pbufs lwIP * handed us via tcp_recv. After tcp_err nulls Pcb the queue may still hold - * pbufs we accepted before the error — those need freeing too. */ + * pbufs we accepted before the error - those need freeing too. */ static void LwipRawTcpStream_DrainAllQueuedPbufs(struct SolidSyslogLwipRawTcpStream* self) { while (LwipRawTcpStream_HasQueuedRx(self)) @@ -467,9 +467,9 @@ static void LwipRawTcpStream_DoClose(void* context) } /* tcp_close must NOT be called on a pcb that has already been released by - * tcp_err — that's a use-after-free in lwIP. The Pcb != NULL guard works + * tcp_err - that's a use-after-free in lwIP. The Pcb != NULL guard works * because LwipRawTcpStream_ErrCallback nulls Pcb when lwIP releases the - * pcb on its side. The queue drain runs unconditionally — pbufs we + * pcb on its side. The queue drain runs unconditionally - pbufs we * accepted via tcp_recv are ours to free regardless of pcb state. Always * called from inside a marshalled hop (DoSend / DoRead / DoClose). */ static void LwipRawTcpStream_ClosePcb(struct SolidSyslogLwipRawTcpStream* self) @@ -497,7 +497,7 @@ static err_t LwipRawTcpStream_ConnectedCallback(void* arg, struct tcp_pcb* pcb, return ERR_OK; } -/* tcp_recv fires when lwIP has bytes for us — non-NULL p means a pbuf +/* tcp_recv fires when lwIP has bytes for us - non-NULL p means a pbuf * arrived; NULL p means peer half-closed (FIN). Backpressure on a full * queue by returning non-ERR_OK; lwIP holds the pbuf and replays the * callback when the queue drains. Runs on the lwIP thread (lwIP invokes it @@ -523,7 +523,7 @@ static err_t LwipRawTcpStream_RecvCallback(void* arg, struct tcp_pcb* tpcb, stru return result; } -/* Real tcp_sent handling is unused under TCP_WRITE_FLAG_COPY — caller +/* Real tcp_sent handling is unused under TCP_WRITE_FLAG_COPY - caller * buffers are released at Send return, not at peer-ACK time. The slot * exists because lwIP requires the callback set when the pcb is wired. */ static err_t LwipRawTcpStream_SentCallback(void* arg, struct tcp_pcb* tpcb, u16_t len) @@ -535,7 +535,7 @@ static err_t LwipRawTcpStream_SentCallback(void* arg, struct tcp_pcb* tpcb, u16_ } /* lwIP fires tcp_err for fatal events (RST, OOM, ABRT) AFTER releasing the - * pcb upstream — we must null our Pcb pointer and NOT call tcp_close. + * pcb upstream - we must null our Pcb pointer and NOT call tcp_close. * Subsequent Stream_Close sees Pcb == NULL and is a safe no-op. Runs on the * lwIP thread, touches no lwIP API. */ static void LwipRawTcpStream_ErrCallback(void* arg, err_t err) diff --git a/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicy.h b/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicy.h index e0110d83..1cfdbe58 100644 --- a/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicy.h +++ b/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicy.h @@ -6,14 +6,14 @@ * * - Seal encrypts a record in place: draws a fresh 12-byte nonce from the * caller's CTR-DRBG, encrypts the body (Content past HeaderLength), - * authenticates the header as associated data, and writes nonce‖tag into the - * record trailer. It is keyed and fails closed — if the key is unavailable or + * authenticates the header as associated data, and writes nonce||tag into the + * record trailer. It is keyed and fails closed - if the key is unavailable or * not exactly 32 bytes, Seal returns false and nothing is stored. * - Open reverses it: decrypts the body and verifies the tag over the header and * ciphertext. A tag mismatch (tamper, or wrong key) is the expected rejection * and returns false silently; only a genuine mbedTLS fault is reported. * - * The key is fetched on demand via GetKey and wiped after every operation — it + * The key is fetched on demand via GetKey and wiped after every operation - it * is never stored on the instance. */ #ifndef SOLIDSYSLOGMBEDTLSAESGCMPOLICY_H #define SOLIDSYSLOGMBEDTLSAESGCMPOLICY_H diff --git a/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicyErrors.h b/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicyErrors.h index 656993f5..310a8ade 100644 --- a/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicyErrors.h +++ b/Platform/MbedTls/Interface/SolidSyslogMbedTlsAesGcmPolicyErrors.h @@ -12,7 +12,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** Detail codes for events whose Source is MbedTlsAesGcmPolicyErrorSource. A * handler reads these off event->Detail after matching event->Source; the * members name their own fault. A tag mismatch on open is the expected - * tamper-detected outcome and is NOT reported — DECRYPT_FAILED is only a + * tamper-detected outcome and is NOT reported - DECRYPT_FAILED is only a * genuine mbedTLS error. */ enum SolidSyslogMbedTlsAesGcmPolicyErrors { diff --git a/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256Policy.h b/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256Policy.h index 53785390..5bba614e 100644 --- a/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256Policy.h +++ b/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256Policy.h @@ -6,14 +6,14 @@ * * - Seal authenticates the whole record content as one buffer (the header/body * split matters only to AEAD policies, so HeaderLength is ignored) and writes - * the 32-byte tag into the record trailer. It is keyed and fails closed — if + * the 32-byte tag into the record trailer. It is keyed and fails closed - if * the key is unavailable or shorter than the SHA-256 output (32 bytes), Seal * returns false and nothing is stored. * - Open recomputes the tag and compares it to the stored one in constant time - * (no early exit, no timing oracle). A mismatch returns false silently — the - * expected tamper verdict — and is not reported. + * (no early exit, no timing oracle). A mismatch returns false silently - the + * expected tamper verdict - and is not reported. * - * The key is fetched on demand via GetKey and wiped after every computation — it + * The key is fetched on demand via GetKey and wiped after every computation - it * is never stored on the instance. */ #ifndef SOLIDSYSLOGMBEDTLSHMACSHA256POLICY_H #define SOLIDSYSLOGMBEDTLSHMACSHA256POLICY_H diff --git a/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256PolicyErrors.h b/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256PolicyErrors.h index ba44e2d9..a73b05ee 100644 --- a/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256PolicyErrors.h +++ b/Platform/MbedTls/Interface/SolidSyslogMbedTlsHmacSha256PolicyErrors.h @@ -12,7 +12,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** Detail codes for events whose Source is MbedTlsHmacSha256PolicyErrorSource. * A handler reads these off event->Detail after matching event->Source; the * members name their own fault. KEY_TOO_SHORT is raised when GetKey returns a - * key below the SHA-256 output length (32 bytes) — the policy fails closed + * key below the SHA-256 output length (32 bytes) - the policy fails closed * rather than seal with a cryptographically worthless MAC. A tag mismatch on * open is silent (the expected tamper verdict), so no HMAC_FAILED for that. */ enum SolidSyslogMbedTlsHmacSha256PolicyErrors diff --git a/Platform/MbedTls/Interface/SolidSyslogMbedTlsStream.h b/Platform/MbedTls/Interface/SolidSyslogMbedTlsStream.h index bd15816e..996cb49b 100644 --- a/Platform/MbedTls/Interface/SolidSyslogMbedTlsStream.h +++ b/Platform/MbedTls/Interface/SolidSyslogMbedTlsStream.h @@ -1,5 +1,5 @@ /** @file - * TLS over an injected byte-transport Stream via Mbed TLS, itself a Stream — so + * TLS over an injected byte-transport Stream via Mbed TLS, itself a Stream - so * a StreamSender speaks TLS to a remote collector without knowing the transport * underneath, whether a TCP stream from a platform pack or one the caller * supplies. @@ -12,17 +12,17 @@ * non-blocking transport means each mbedtls_ssl_handshake may want more I/O; * the injected Sleep bridges those polls until the handshake completes, hits * a hard error (HANDSHAKE_REJECTED), or the bounded budget expires - * (HANDSHAKE_TIMEOUT — re-read from GetHandshakeTimeoutMs each attempt, so a + * (HANDSHAKE_TIMEOUT - re-read from GetHandshakeTimeoutMs each attempt, so a * runtime-tunable value applies on the next reconnect). A failed Open closes * the stream so the sender reconnects on its next pass. * - Send is all-or-nothing: a short write or any TLS error is taken as an * unrecoverable session and closes the stream, so the sender reconnects. * - Read returns the bytes read, 0 for would-block, or closes the stream on any - * other TLS return (alert, transport error) — fail-fast, and store-and-forward + * other TLS return (alert, transport error) - fail-fast, and store-and-forward * replays after the reconnect. * * Peer identity is set by ServerName (see the config member). All key material - * is injected as caller-built, caller-owned mbedTLS handles — never file paths + * is injected as caller-built, caller-owned mbedTLS handles - never file paths * or PEM blobs. Coexistence contract: this adapter touches only per-instance * ssl_config / ssl_context state and never calls process-global mbedTLS APIs * (platform setup/teardown, psa_crypto_init, threading-alt, debug hooks), so it @@ -48,25 +48,25 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogMbedTlsStreamConfig { - /** Underlying byte stream the TLS records ride on. Borrowed — this stream + /** Underlying byte stream the TLS records ride on. Borrowed - this stream * may Close it but never destroys it; the caller owns it and must keep it * valid until SolidSyslogMbedTlsStream_Destroy. */ struct SolidSyslogStream* Transport; SolidSyslogSleepFunction Sleep; /**< Bridges the WANT_READ/WANT_WRITE polls of the bounded handshake - retry; required — there is no fallback. */ + retry; required - there is no fallback. */ SolidSyslogTlsHandshakeTimeoutFunction GetHandshakeTimeoutMs; /**< Per-attempt handshake deadline in ms; NULL uses the SOLIDSYSLOG_TLS_HANDSHAKE_TIMEOUT_MS tunable. */ void* HandshakeTimeoutContext; /**< Passed back to GetHandshakeTimeoutMs unchanged; NULL is fine. */ struct mbedtls_ctr_drbg_context* Rng; /**< Seeded CTR-DRBG for the handshake; caller-built and caller-owned. */ struct mbedtls_x509_crt* CaChain; /**< Trust anchors the peer cert must chain to; caller-built and owned. */ /** SNI + peer-identity check. A non-empty name is verified against the peer - * cert (SAN/CN). NULL connects chain-only but emits a WARNING — the peer is + * cert (SAN/CN). NULL connects chain-only but emits a WARNING - the peer is * unverified (MITM-class). "" is the no-name-check opt-out (closed network / * private CA): the cert must still chain to CaChain, but the endpoint * identity is not checked; no diagnostic. */ const char* ServerName; struct mbedtls_x509_crt* ClientCertChain; /**< mTLS leaf (+ intermediates); caller-owned. NULL (or a NULL - ClientKey) disables mTLS — both must be set to present a client cert. */ + ClientKey) disables mTLS - both must be set to present a client cert. */ struct mbedtls_pk_context* ClientKey; /**< Private key matching ClientCertChain; caller-owned. NULL disables mTLS. */ }; diff --git a/Platform/MbedTls/Source/SolidSyslogMbedTlsAesGcmPolicy.c b/Platform/MbedTls/Source/SolidSyslogMbedTlsAesGcmPolicy.c index d80e80ec..0cb95c2d 100644 --- a/Platform/MbedTls/Source/SolidSyslogMbedTlsAesGcmPolicy.c +++ b/Platform/MbedTls/Source/SolidSyslogMbedTlsAesGcmPolicy.c @@ -26,12 +26,12 @@ enum AES_256_KEY_BITS = 256, GCM_NONCE_SIZE = 12, GCM_TAG_SIZE = 16, - /* Trailer is nonce ‖ tag — fits SOLIDSYSLOG_MAX_INTEGRITY_SIZE (32). */ + /* Trailer is nonce || tag - fits SOLIDSYSLOG_MAX_INTEGRITY_SIZE (32). */ AES_GCM_TRAILER_SIZE = GCM_NONCE_SIZE + GCM_TAG_SIZE }; /* Seal/open write the nonce and tag into record->Trailer, which the store sizes - * at SOLIDSYSLOG_MAX_INTEGRITY_SIZE. Fail the build — not a record at runtime — + * at SOLIDSYSLOG_MAX_INTEGRITY_SIZE. Fail the build - not a record at runtime - * if that shared buffer is ever tuned below this policy's trailer. */ SOLIDSYSLOG_STATIC_ASSERT( AES_GCM_TRAILER_SIZE <= SOLIDSYSLOG_MAX_INTEGRITY_SIZE, @@ -67,7 +67,7 @@ void MbedTlsAesGcmPolicy_Initialise( void MbedTlsAesGcmPolicy_Cleanup(struct SolidSyslogSecurityPolicy* base) { - /* No owned resources to release — the key is fetched on demand via the + /* No owned resources to release - the key is fetched on demand via the * GetKey callback and never stored on the instance, and the CTR-DRBG is * caller-owned. */ (void) base; @@ -77,7 +77,7 @@ static inline struct SolidSyslogMbedTlsAesGcmPolicy* MbedTlsAesGcmPolicy_SelfFro struct SolidSyslogSecurityPolicy* base ) { - /* Base is the first member of the instance struct — see Private.h. */ + /* Base is the first member of the instance struct - see Private.h. */ return (struct SolidSyslogMbedTlsAesGcmPolicy*) base; } @@ -127,7 +127,7 @@ static bool MbedTlsAesGcmPolicy_SealRecord( } /* Fetches the AES-256 key on demand. Fails closed (and reports) if the key is - * unavailable or not exactly 32 bytes — AES-256 admits no other key length. */ + * unavailable or not exactly 32 bytes - AES-256 admits no other key length. */ static bool MbedTlsAesGcmPolicy_FetchKey(struct SolidSyslogMbedTlsAesGcmPolicy* policy, uint8_t* keyOut) { size_t keyLength = 0; @@ -144,11 +144,11 @@ static bool MbedTlsAesGcmPolicy_FetchKey(struct SolidSyslogMbedTlsAesGcmPolicy* return fetched; } -/* Encrypts the record's body in place and writes nonce‖tag into its trailer. +/* Encrypts the record's body in place and writes nonce||tag into its trailer. * Takes the whole record (not the unpacked buffers) so key and nonce never sit * adjacent as same-typed scalar parameters; the trailer/header layout lives in * one place. The nonce is expected already in Trailer[0..GCM_NONCE_SIZE). One- - * shot AEAD — mbedTLS computes the whole tag in a single call (output == input + * shot AEAD - mbedTLS computes the whole tag in a single call (output == input * is permitted for GCM encryption). */ static bool MbedTlsAesGcmPolicy_GcmEncrypt(const struct SolidSyslogSecurityRecord* record, const uint8_t* key) { @@ -200,11 +200,11 @@ static bool MbedTlsAesGcmPolicy_OpenRecord( return opened; } -/* Decrypts the record's body in place, reading nonce‖tag from its trailer and +/* Decrypts the record's body in place, reading nonce||tag from its trailer and * authenticating the header. Takes the whole record for the same reasons as * GcmEncrypt. mbedtls_gcm_auth_decrypt verifies the tag itself and signals the * verdict through its return code: 0 = authentic, GCM_AUTH_FAILED = tamper / - * wrong key (the expected rejection — return false silently, like the HMAC + * wrong key (the expected rejection - return false silently, like the HMAC * verify), anything else = a genuine mbedTLS error worth reporting. */ static bool MbedTlsAesGcmPolicy_GcmDecrypt(const struct SolidSyslogSecurityRecord* record, const uint8_t* key) { @@ -240,7 +240,7 @@ static bool MbedTlsAesGcmPolicy_GcmDecrypt(const struct SolidSyslogSecurityRecor } else { - /* Genuine mbedTLS failure — errored stays true and is reported below. */ + /* Genuine mbedTLS failure - errored stays true and is reported below. */ } } mbedtls_gcm_free(&ctx); diff --git a/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256Policy.c b/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256Policy.c index 30023ebb..6382f03e 100644 --- a/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256Policy.c +++ b/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256Policy.c @@ -66,7 +66,7 @@ void MbedTlsHmacSha256Policy_Initialise( void MbedTlsHmacSha256Policy_Cleanup(struct SolidSyslogSecurityPolicy* base) { - /* No owned resources to release — the key is fetched on demand via the + /* No owned resources to release - the key is fetched on demand via the * GetKey callback and never stored on the instance. */ (void) base; } @@ -75,11 +75,11 @@ static inline struct SolidSyslogMbedTlsHmacSha256Policy* MbedTlsHmacSha256Policy struct SolidSyslogSecurityPolicy* base ) { - /* Base is the first member of the instance struct — see Private.h. */ + /* Base is the first member of the instance struct - see Private.h. */ return (struct SolidSyslogMbedTlsHmacSha256Policy*) base; } -/* HMAC authenticates the whole content as one buffer — the header/body split +/* HMAC authenticates the whole content as one buffer - the header/body split * only matters to AEAD policies, so HeaderLength is ignored here. */ static bool MbedTlsHmacSha256Policy_SealRecord( struct SolidSyslogSecurityPolicy* self, @@ -87,7 +87,7 @@ static bool MbedTlsHmacSha256Policy_SealRecord( ) { /* Bind the trailer to a local before passing it as the writable tag - * destination — same shape the AES-GCM sibling uses for its nonce/tag. */ + * destination - same shape the AES-GCM sibling uses for its nonce/tag. */ uint8_t* tag = record->Trailer; return MbedTlsHmacSha256Policy_ComputeTag( MbedTlsHmacSha256Policy_SelfFromBase(self), @@ -99,7 +99,7 @@ static bool MbedTlsHmacSha256Policy_SealRecord( } /* Fetches the key on demand into a transient buffer, computes HMAC-SHA256 over - * `data` into `tagOut`, then wipes the key buffer — the key never lingers + * `data` into `tagOut`, then wipes the key buffer - the key never lingers * beyond a single computation. Returns false (fail closed) and reports the * reason if the key is unavailable or the HMAC computation fails. Shared by * seal (writes the record tag) and verify (recomputes for comparison). */ @@ -130,8 +130,8 @@ static bool MbedTlsHmacSha256Policy_ComputeTag( ); } } - /* Wipe the whole key buffer — the full region GetKey was handed, not just - * the bytes written — so no key material lingers on the stack. */ + /* Wipe the whole key buffer - the full region GetKey was handed, not just + * the bytes written - so no key material lingers on the stack. */ mbedtls_platform_zeroize(key, sizeof key); return computed; } @@ -202,7 +202,7 @@ static bool MbedTlsHmacSha256Policy_OpenRecord( static inline bool MbedTlsHmacSha256Policy_ConstantTimeEquals(const uint8_t* a, const uint8_t* b, size_t length) { /* Accumulate every byte difference so the loop runs the full length - * regardless of where a mismatch occurs — no early exit, no timing oracle + * regardless of where a mismatch occurs - no early exit, no timing oracle * on the tag comparison. */ uint8_t difference = 0U; for (size_t index = 0; index < length; index++) diff --git a/Platform/MbedTls/Source/SolidSyslogMbedTlsStream.c b/Platform/MbedTls/Source/SolidSyslogMbedTlsStream.c index 2b72016c..1fc2da56 100644 --- a/Platform/MbedTls/Source/SolidSyslogMbedTlsStream.c +++ b/Platform/MbedTls/Source/SolidSyslogMbedTlsStream.c @@ -61,7 +61,7 @@ void MbedTlsStream_Initialise(struct SolidSyslogStream* base, const struct Solid self->Config.GetHandshakeTimeoutMs = MbedTlsStream_NullHandshakeTimeoutGetter; self->Config.HandshakeTimeoutContext = NULL; } - /* Eager init so mbedtls_*_free in Close is always safe — whether Open + /* Eager init so mbedtls_*_free in Close is always safe - whether Open * was ever reached, whether it succeeded, or whether Close is being * called twice in a row. mbedTLS guarantees a freed struct is left in * the same zeroed state an init produces, so re-Open after Close also @@ -71,7 +71,7 @@ void MbedTlsStream_Initialise(struct SolidSyslogStream* base, const struct Solid } /* Null Object substituted in Initialise when the integrator does not install a - * getter — returns the compile-time tunable so the bounded-handshake path is a + * getter - returns the compile-time tunable so the bounded-handshake path is a * single code path regardless of whether the integrator wired runtime tuning. */ static uint32_t MbedTlsStream_NullHandshakeTimeoutGetter(void* context) { @@ -161,7 +161,7 @@ static inline bool MbedTlsStream_ApplySslConfigDefaults(struct SolidSyslogMbedTl return ok; } -/* TLS policy owned by the library — set per-ssl_config so it cannot leak +/* TLS policy owned by the library - set per-ssl_config so it cannot leak * into the integrator's other ssl_configs (per coexistence contract). */ static inline void MbedTlsStream_ApplyTlsPolicy(struct SolidSyslogMbedTlsStream* self) { @@ -201,7 +201,7 @@ static inline bool MbedTlsStream_ConfigureExpectedHostname(struct SolidSyslogMbe const char* serverName = self->Config.ServerName; if (serverName == NULL) { - /* No expected identity supplied — the handshake will accept any cert that + /* No expected identity supplied - the handshake will accept any cert that * chains to a trusted CA, so the peer is unverified. Surface it as a * WARNING (still connect, preserving the IP-pinned / closed-network case) * rather than swallowing the MITM-class default silently. S12.28. */ @@ -304,8 +304,8 @@ static int MbedTlsStream_BioSend(void* ctx, const unsigned char* buf, size_t len /* Translate the non-blocking transport's Read contract into mbedTLS's BIO * recv contract: - * transport > 0 → bytes available, return the same positive count. - * transport = 0 → would-block. Must return MBEDTLS_ERR_SSL_WANT_READ so + * transport > 0 -> bytes available, return the same positive count. + * transport = 0 -> would-block. Must return MBEDTLS_ERR_SSL_WANT_READ so * the handshake retry loop polls; returning 0 or -1 would * abort the handshake on the first non-blocking read. */ static int MbedTlsStream_BioRecv(void* ctx, unsigned char* buf, size_t len) @@ -323,13 +323,13 @@ static int MbedTlsStream_BioRecv(void* ctx, unsigned char* buf, size_t len) } else { - /* n < 0 — transport-level error; keep result = -1 to signal a + /* n < 0 - transport-level error; keep result = -1 to signal a hard failure to mbedTLS so the handshake / read aborts. */ } return result; } -/* TLS-level write failure means the session state is unrecoverable — close +/* TLS-level write failure means the session state is unrecoverable - close * so the StreamSender reconnect path runs on the next tick. Fail-fast is the * contract every TLS stream adapter honours. */ static inline bool MbedTlsStream_Send(struct SolidSyslogStream* base, const void* buffer, size_t size) @@ -345,11 +345,11 @@ static inline bool MbedTlsStream_Send(struct SolidSyslogStream* base, const void } /* mbedtls_ssl_read has two distinct outcomes worth keeping straight: - * 1. Steady-state read: bytes available → positive count; nothing to read - * right now → WANT_READ → return 0, mirroring the transport contract. + * 1. Steady-state read: bytes available -> positive count; nothing to read + * right now -> WANT_READ -> return 0, mirroring the transport contract. * 2. Any other negative return (alerts, renegotiation surfacing as * WANT_WRITE, hard transport error) is fatal under fail-fast semantics - * — close internally; the caller reopens and store-and-forward replays. */ + * - close internally; the caller reopens and store-and-forward replays. */ static inline SolidSyslogSsize MbedTlsStream_Read(struct SolidSyslogStream* base, void* buffer, size_t size) { struct SolidSyslogMbedTlsStream* self = MbedTlsStream_SelfFromBase(base); diff --git a/Platform/OpenSsl/Interface/SolidSyslogOpenSslAesGcmPolicy.h b/Platform/OpenSsl/Interface/SolidSyslogOpenSslAesGcmPolicy.h index 1643d42a..11300e28 100644 --- a/Platform/OpenSsl/Interface/SolidSyslogOpenSslAesGcmPolicy.h +++ b/Platform/OpenSsl/Interface/SolidSyslogOpenSslAesGcmPolicy.h @@ -1,15 +1,15 @@ /** @file * A keyed AES-256-GCM security policy (OpenSSL reference integration) that - * encrypts and authenticates each stored record — confidentiality plus + * encrypts and authenticates each stored record - confidentiality plus * tamper-detection for store-and-forward. * * What the policy does through its vtable is the substance: * * - SealRecord encrypts the body in place and authenticates the header as * associated data (the header stays in clear), writing a fresh random nonce - * and the GCM tag into the record trailer (nonce ‖ tag, 28 bytes). The key is - * fetched on demand via GetKey and wiped before returning. It fails closed — - * returns false so nothing is stored — if the key is unavailable or not + * and the GCM tag into the record trailer (nonce || tag, 28 bytes). The key is + * fetched on demand via GetKey and wiped before returning. It fails closed - + * returns false so nothing is stored - if the key is unavailable or not * exactly 32 bytes (AES-256 admits no other length), if nonce generation * fails, or on any encrypt error. * - OpenRecord decrypts the body and verifies the tag over header + ciphertext. @@ -40,8 +40,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogSecurityPolicy* SolidSyslogOpenSslAesGcmPolicy_Create( const struct SolidSyslogOpenSslAesGcmPolicyConfig* config ); - /** Release the pool slot. The policy owns no resources — the key is never - * stored on the instance — so this only frees the slot. */ + /** Release the pool slot. The policy owns no resources - the key is never + * stored on the instance - so this only frees the slot. */ void SolidSyslogOpenSslAesGcmPolicy_Destroy(struct SolidSyslogSecurityPolicy * base); SOLIDSYSLOG_EXTERN_C_END diff --git a/Platform/OpenSsl/Interface/SolidSyslogOpenSslHmacSha256Policy.h b/Platform/OpenSsl/Interface/SolidSyslogOpenSslHmacSha256Policy.h index b7d40d0d..0e220198 100644 --- a/Platform/OpenSsl/Interface/SolidSyslogOpenSslHmacSha256Policy.h +++ b/Platform/OpenSsl/Interface/SolidSyslogOpenSslHmacSha256Policy.h @@ -1,6 +1,6 @@ /** @file * A keyed HMAC-SHA256 security policy (OpenSSL reference integration) that - * authenticates each stored record — tamper-detection for store-and-forward + * authenticates each stored record - tamper-detection for store-and-forward * without encryption. * * What the policy does through its vtable is the substance: @@ -11,7 +11,7 @@ * via GetKey and wiped after the computation. * - OpenRecord recomputes the tag and compares it to the stored trailer in * constant time (no early exit, no timing oracle); a mismatch returns false. - * - It fails closed — returns false, so nothing is sealed / verified — if the + * - It fails closed - returns false, so nothing is sealed / verified - if the * key is unavailable, shorter than 32 bytes (RFC 2104 / NIST SP 800-107: an * HMAC key should be at least the hash output length), or the HMAC computation * fails. */ @@ -39,8 +39,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogSecurityPolicy* SolidSyslogOpenSslHmacSha256Policy_Create( const struct SolidSyslogOpenSslHmacSha256PolicyConfig* config ); - /** Release the pool slot. The policy owns no resources — the key is never - * stored on the instance — so this only frees the slot. */ + /** Release the pool slot. The policy owns no resources - the key is never + * stored on the instance - so this only frees the slot. */ void SolidSyslogOpenSslHmacSha256Policy_Destroy(struct SolidSyslogSecurityPolicy * base); SOLIDSYSLOG_EXTERN_C_END diff --git a/Platform/OpenSsl/Interface/SolidSyslogOpenSslStream.h b/Platform/OpenSsl/Interface/SolidSyslogOpenSslStream.h index b4a6f8a4..8e3fef0b 100644 --- a/Platform/OpenSsl/Interface/SolidSyslogOpenSslStream.h +++ b/Platform/OpenSsl/Interface/SolidSyslogOpenSslStream.h @@ -6,7 +6,7 @@ * What the stream does through its vtable is the substance: * * - Open opens the transport, then builds a fresh SSL_CTX every call (the - * cert-rotation contract — a reconnect re-reads the cert/key files), pins the + * cert-rotation contract - a reconnect re-reads the cert/key files), pins the * TLS 1.2 floor, loads CaBundlePath as the trust anchors with SSL_VERIFY_PEER, * wires the transport as a custom BIO, sets SNI + the expected peer identity * from ServerName, and drives the handshake. Any step failing closes the whole @@ -19,7 +19,7 @@ * - Send is all-or-nothing over SSL_write: a short write or any error is taken * as a dead connection, so the stream closes itself and the sender reconnects. * - Read returns the bytes read, 0 for would-block (WANT_READ, connection kept), - * or closes on anything else — including a mid-stream WANT_WRITE (renegotiation) + * or closes on anything else - including a mid-stream WANT_WRITE (renegotiation) * which fail-fast semantics treat as a transport failure; store-and-forward * replays after the reopen. */ #ifndef SOLIDSYSLOGOPENSSLSTREAM_H @@ -36,7 +36,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /** Wires SolidSyslogOpenSslStream to its transport, trust anchors, and identity. */ struct SolidSyslogOpenSslStreamConfig { - /** Underlying byte stream carrying the ciphertext. Borrowed — this stream + /** Underlying byte stream carrying the ciphertext. Borrowed - this stream * may Close it but never destroys it; the caller owns it and must keep it * valid until SolidSyslogOpenSslStream_Destroy. */ struct SolidSyslogStream* Transport; @@ -49,14 +49,14 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void* HandshakeTimeoutContext; /**< Passed back to GetHandshakeTimeoutMs unchanged; NULL is fine. */ const char* CaBundlePath; /**< PEM file of trust anchors the peer cert must chain to. */ /** SNI plus the expected peer identity. A non-empty name is verified against - * the cert (SAN/CN). NULL connects chain-only but emits a WARNING — the peer + * the cert (SAN/CN). NULL connects chain-only but emits a WARNING - the peer * is unverified (MITM-class). "" is the no-name-check opt-out (closed network * / private CA): still chain-verified against CaBundlePath, endpoint identity * unchecked; no diagnostic. */ const char* ServerName; const char* CipherList; /**< TLS 1.2 cipher list; NULL uses the OpenSSL default. */ const char* ClientCertChainPath; /**< PEM leaf cert (+ intermediates) for mTLS; NULL = no mTLS. Cert and - * key are all-or-nothing — supplying one without the other is a setup + * key are all-or-nothing - supplying one without the other is a setup * error. */ const char* ClientKeyPath; /**< PEM private key matching ClientCertChainPath; NULL = no mTLS. */ }; diff --git a/Platform/OpenSsl/Source/SolidSyslogOpenSslAesGcmPolicy.c b/Platform/OpenSsl/Source/SolidSyslogOpenSslAesGcmPolicy.c index aeaec437..28acb2d7 100644 --- a/Platform/OpenSsl/Source/SolidSyslogOpenSslAesGcmPolicy.c +++ b/Platform/OpenSsl/Source/SolidSyslogOpenSslAesGcmPolicy.c @@ -23,7 +23,7 @@ enum AES_256_KEY_SIZE = 32, GCM_NONCE_SIZE = 12, GCM_TAG_SIZE = 16, - /* Trailer is nonce ‖ tag — fits SOLIDSYSLOG_MAX_INTEGRITY_SIZE (32). */ + /* Trailer is nonce || tag - fits SOLIDSYSLOG_MAX_INTEGRITY_SIZE (32). */ AES_GCM_TRAILER_SIZE = GCM_NONCE_SIZE + GCM_TAG_SIZE }; @@ -72,7 +72,7 @@ void OpenSslAesGcmPolicy_Initialise( void OpenSslAesGcmPolicy_Cleanup(struct SolidSyslogSecurityPolicy* base) { - /* No owned resources to release — the key is fetched on demand via the + /* No owned resources to release - the key is fetched on demand via the * GetKey callback and never stored on the instance. */ (void) base; } @@ -81,7 +81,7 @@ static inline struct SolidSyslogOpenSslAesGcmPolicy* OpenSslAesGcmPolicy_SelfFro struct SolidSyslogSecurityPolicy* base ) { - /* Base is the first member of the instance struct — see Private.h. */ + /* Base is the first member of the instance struct - see Private.h. */ return (struct SolidSyslogOpenSslAesGcmPolicy*) base; } @@ -141,7 +141,7 @@ static bool OpenSslAesGcmPolicy_SealRecord( } /* Fetches the AES-256 key on demand. Fails closed (and reports) if the key is - * unavailable or not exactly 32 bytes — AES-256 admits no other key length. */ + * unavailable or not exactly 32 bytes - AES-256 admits no other key length. */ static bool OpenSslAesGcmPolicy_FetchKey(struct SolidSyslogOpenSslAesGcmPolicy* policy, uint8_t* keyOut) { size_t keyLength = 0; @@ -222,12 +222,12 @@ static bool OpenSslAesGcmPolicy_GcmDecrypt( const uint8_t* tagIn ) { - /* Copy the expected tag into a non-const buffer — EVP_CIPHER_CTX_ctrl's + /* Copy the expected tag into a non-const buffer - EVP_CIPHER_CTX_ctrl's * SET_TAG parameter is void*, and copying avoids casting away const. */ uint8_t tag[GCM_TAG_SIZE]; (void) memcpy(tag, tagIn, sizeof tag); - /* A tag mismatch is the expected tamper-detected outcome — return false + /* A tag mismatch is the expected tamper-detected outcome - return false * silently, like the HMAC verify. Only a genuine OpenSSL failure (context * allocation or any setup step) is reported. */ bool opened = false; diff --git a/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256Policy.c b/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256Policy.c index d9650723..e0a2ab66 100644 --- a/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256Policy.c +++ b/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256Policy.c @@ -67,7 +67,7 @@ void OpenSslHmacSha256Policy_Initialise( void OpenSslHmacSha256Policy_Cleanup(struct SolidSyslogSecurityPolicy* base) { - /* No owned resources to release — the key is fetched on demand via the + /* No owned resources to release - the key is fetched on demand via the * GetKey callback and never stored on the instance. */ (void) base; } @@ -76,11 +76,11 @@ static inline struct SolidSyslogOpenSslHmacSha256Policy* OpenSslHmacSha256Policy struct SolidSyslogSecurityPolicy* base ) { - /* Base is the first member of the instance struct — see Private.h. */ + /* Base is the first member of the instance struct - see Private.h. */ return (struct SolidSyslogOpenSslHmacSha256Policy*) base; } -/* HMAC authenticates the whole content as one buffer — the header/body split +/* HMAC authenticates the whole content as one buffer - the header/body split * only matters to AEAD policies, so HeaderLength is ignored here. */ static bool OpenSslHmacSha256Policy_SealRecord( struct SolidSyslogSecurityPolicy* self, @@ -88,7 +88,7 @@ static bool OpenSslHmacSha256Policy_SealRecord( ) { /* Bind the trailer to a local before passing it as the writable tag - * destination — same shape the AES-GCM sibling uses for its nonce/tag. */ + * destination - same shape the AES-GCM sibling uses for its nonce/tag. */ uint8_t* tag = record->Trailer; return OpenSslHmacSha256Policy_ComputeTag( OpenSslHmacSha256Policy_SelfFromBase(self), @@ -100,7 +100,7 @@ static bool OpenSslHmacSha256Policy_SealRecord( } /* Fetches the key on demand into a transient buffer, computes HMAC-SHA256 over - * `data` into `tagOut`, then wipes the key buffer — the key never lingers + * `data` into `tagOut`, then wipes the key buffer - the key never lingers * beyond a single computation. Returns false (fail closed) and reports the * reason if the key is unavailable or the HMAC computation fails. Shared by * seal (writes the record tag) and verify (recomputes for comparison). */ @@ -130,15 +130,15 @@ static bool OpenSslHmacSha256Policy_ComputeTag( ); } } - /* Wipe the whole key buffer — the full region GetKey was handed, not just - * the bytes written — so no key material lingers on the stack. */ + /* Wipe the whole key buffer - the full region GetKey was handed, not just + * the bytes written - so no key material lingers on the stack. */ OPENSSL_cleanse(key, sizeof key); return computed; } /* Fetches the key on demand and validates its length. Fails closed (and * reports) if the key is unavailable, or if its length falls outside - * [HMAC_SHA256_MIN_KEY_SIZE, sizeof buffer] — the upper bound also closes the + * [HMAC_SHA256_MIN_KEY_SIZE, sizeof buffer] - the upper bound also closes the * (int) keyLength negative-wrap on the HMAC() call above. */ static bool OpenSslHmacSha256Policy_FetchKey( struct SolidSyslogOpenSslHmacSha256Policy* policy, @@ -203,7 +203,7 @@ static bool OpenSslHmacSha256Policy_OpenRecord( static inline bool OpenSslHmacSha256Policy_ConstantTimeEquals(const uint8_t* a, const uint8_t* b, size_t length) { /* Accumulate every byte difference so the loop runs the full length - * regardless of where a mismatch occurs — no early exit, no timing oracle + * regardless of where a mismatch occurs - no early exit, no timing oracle * on the tag comparison. */ uint8_t difference = 0U; for (size_t index = 0; index < length; index++) diff --git a/Platform/OpenSsl/Source/SolidSyslogOpenSslStream.c b/Platform/OpenSsl/Source/SolidSyslogOpenSslStream.c index 4cda27bf..f023b048 100644 --- a/Platform/OpenSsl/Source/SolidSyslogOpenSslStream.c +++ b/Platform/OpenSsl/Source/SolidSyslogOpenSslStream.c @@ -95,7 +95,7 @@ void OpenSslStream_Cleanup(struct SolidSyslogStream* base) * leak the underlying transport. Close now releases the SSL, BIO_METHOD * and SSL_CTX, and is idempotent (the TLS-side teardown guards on Ssl / * Ctx != NULL; transport Close is itself idempotent on every Stream - * impl), so the normal Open → Close → Destroy lifecycle is unaffected. */ + * impl), so the normal Open -> Close -> Destroy lifecycle is unaffected. */ OpenSslStream_Close(base); /* Overwrite the abstract base with the shared NullStream vtable so * use-after-destroy is a safe no-op rather than a NULL-fn-pointer crash. */ @@ -210,7 +210,7 @@ static inline bool OpenSslStream_ConfigureClientIdentity( bool ok = true; if (hasCert != hasKey) { - ok = false; /* mTLS is all-or-nothing — partial config is a setup error */ + ok = false; /* mTLS is all-or-nothing - partial config is a setup error */ } else if (hasCert) { @@ -220,7 +220,7 @@ static inline bool OpenSslStream_ConfigureClientIdentity( } else { - /* neither cert nor key supplied — server-auth-only TLS, ok stays true */ + /* neither cert nor key supplied - server-auth-only TLS, ok stays true */ } return ok; } @@ -325,11 +325,11 @@ static inline int OpenSslStream_TransportBioCreate(BIO* bio) /* Translate the non-blocking transport's Read contract into the OpenSSL BIO * contract: - * transport > 0 → bytes available, BIO returns the same positive count. - * transport = 0 → would-block. BIO must signal retry via BIO_set_retry_read + * transport > 0 -> bytes available, BIO returns the same positive count. + * transport = 0 -> would-block. BIO must signal retry via BIO_set_retry_read * and return -1; without this, OpenSSL treats the 0 as EOF * and aborts the handshake on the first poll. - * transport < 0 → EOF or error. BIO returns -1 with retry flags cleared so + * transport < 0 -> EOF or error. BIO returns -1 with retry flags cleared so * OpenSSL surfaces the failure rather than spinning. */ static inline int OpenSslStream_TransportBioRead(BIO* bio, char* buffer, int size) { @@ -398,7 +398,7 @@ static inline bool OpenSslStream_ConfigureExpectedHostname(struct SolidSyslogOpe const char* serverName = self->Config.ServerName; if (serverName == NULL) { - /* No expected identity supplied — the handshake will accept any cert that + /* No expected identity supplied - the handshake will accept any cert that * chains to a trusted CA, so the peer is unverified. Surface it as a * WARNING (still connect, preserving the IP-pinned / closed-network case) * rather than swallowing the MITM-class default silently. S12.28. */ @@ -440,7 +440,7 @@ static inline bool OpenSslStream_IsHandshakeBudgetExhausted(uint32_t totalSleptM } /* Null Object substituted at Initialise when the integrator does not install a - * getter — returns the compile-time tunable so the bounded-handshake path is a + * getter - returns the compile-time tunable so the bounded-handshake path is a * single code path regardless of whether the integrator wired runtime tuning. */ static uint32_t OpenSslStream_NullHandshakeTimeoutGetter(void* context) { @@ -527,12 +527,12 @@ static inline bool OpenSslStream_Send(struct SolidSyslogStream* base, const void } /* SSL_read has two distinct modes worth keeping straight: - * 1. Steady-state application read: bytes available → return them; nothing - * to read right now → SSL_ERROR_WANT_READ → return 0 mirrors the transport + * 1. Steady-state application read: bytes available -> return them; nothing + * to read right now -> SSL_ERROR_WANT_READ -> return 0 mirrors the transport * Read contract. * 2. Renegotiation or alerts mid-stream: SSL_read may need to write (server * requested re-key), surfacing as SSL_ERROR_WANT_WRITE. Under fail-fast - * semantics this is a transport failure — close internally; the caller + * semantics this is a transport failure - close internally; the caller * reopens, store-and-forward replays. Same rule for any other SSL error. * Anything below the WANT_READ branch therefore takes the Close path. */ static inline SolidSyslogSsize OpenSslStream_Read(struct SolidSyslogStream* base, void* buffer, size_t size) diff --git a/Platform/PlusFat/Interface/SolidSyslogPlusFatFile.h b/Platform/PlusFat/Interface/SolidSyslogPlusFatFile.h index 4388d006..00035512 100644 --- a/Platform/PlusFat/Interface/SolidSyslogPlusFatFile.h +++ b/Platform/PlusFat/Interface/SolidSyslogPlusFatFile.h @@ -2,14 +2,14 @@ * FreeRTOS-Plus-FAT file I/O behind the SolidSyslogFile vtable, for a * file-backed BlockDevice or Store on FreeRTOS targets. Open uses ff_fopen * "r+" (opens an existing file without truncating), falling back to the - * file-creating "w+" only when the "r+" failure was ENOENT (file absent) — a + * file-creating "w+" only when the "r+" failure was ENOENT (file absent) - a * non-truncating open-or-create. Because "w+" truncates, an "r+" failure from * any other cause (media/I/O error) on an existing file fails the Open rather * than emptying it. Every complete Write flushes the IO-manager cache to the * media before returning, which persists the record's data sectors; the file's * recorded size is committed by Close, so a power loss can leave data on the * medium that the directory entry excludes. - * Open-state is carried by the FF_FILE* sentinel — no separate flag. + * Open-state is carried by the FF_FILE* sentinel - no separate flag. * Plus-FAT is FreeRTOS-coupled; the integrator supplies the FF_Disk_t media * driver and FreeRTOSFATConfig.h. */ #ifndef SOLIDSYSLOGPLUSFATFILE_H diff --git a/Platform/PlusFat/Source/SolidSyslogPlusFatFile.c b/Platform/PlusFat/Source/SolidSyslogPlusFatFile.c index 350f0889..33c28201 100644 --- a/Platform/PlusFat/Source/SolidSyslogPlusFatFile.c +++ b/Platform/PlusFat/Source/SolidSyslogPlusFatFile.c @@ -78,7 +78,7 @@ static bool PlusFatFile_Open(struct SolidSyslogFile* base, const char* path) struct SolidSyslogPlusFatFile* self = PlusFatFile_SelfFromBase(base); /* "r+" opens an existing file without truncating. Fall back to the * file-creating "w+" only when the "r+" failure was specifically "file does - * not exist" — "w+" truncates, so an "r+" failure from any other cause + * not exist" - "w+" truncates, so an "r+" failure from any other cause * (media/I/O error) on an existing file must never reach it, or it would * empty a record file the BlockStore believes is durably stored. The exact * reason lives in the task errno ff_fopen just set; ENOENT is the only code @@ -116,7 +116,7 @@ static bool PlusFatFile_Write(struct SolidSyslogFile* base, const void* buf, siz { struct SolidSyslogPlusFatFile* self = PlusFatFile_SelfFromBase(base); /* Flush the IO-manager cache after every complete write so the record's - * data sectors reach the media. Plus-FAT has no per-file flush — + * data sectors reach the media. Plus-FAT has no per-file flush - * ff_stdio.h declares ff_fflush but the library never defines it; * FF_FlushCache against the file's IO manager is the real durability * primitive. It does not commit the directory entry: FF_Close writes the diff --git a/Platform/PlusTcp/Interface/SolidSyslogPlusTcpDatagram.h b/Platform/PlusTcp/Interface/SolidSyslogPlusTcpDatagram.h index 03ccac9a..56c6b44a 100644 --- a/Platform/PlusTcp/Interface/SolidSyslogPlusTcpDatagram.h +++ b/Platform/PlusTcp/Interface/SolidSyslogPlusTcpDatagram.h @@ -4,7 +4,7 @@ * SendTo wraps FreeRTOS_sendto (unconnected, destination per call) and reports * SENT when the stack accepts the whole datagram, else FAILED. On an ARP-cache * miss it first issues an ARP probe and yields once (~50 ms) for the reply, - * because FreeRTOS-Plus-TCP does not queue datagrams while ARP resolves — the + * because FreeRTOS-Plus-TCP does not queue datagrams while ARP resolves - the * cold-start packet would otherwise be dropped at the IP layer; if the reply * is late the send is left to fail, since UDP is best-effort and retry belongs * in the store-and-forward layer above. MaxPayload is the fixed IPv6-safe diff --git a/Platform/PlusTcp/Source/SolidSyslogPlusTcpAddressStatic.c b/Platform/PlusTcp/Source/SolidSyslogPlusTcpAddressStatic.c index 57f96830..59d50f90 100644 --- a/Platform/PlusTcp/Source/SolidSyslogPlusTcpAddressStatic.c +++ b/Platform/PlusTcp/Source/SolidSyslogPlusTcpAddressStatic.c @@ -25,7 +25,7 @@ struct SolidSyslogAddress* SolidSyslogPlusTcpAddress_Create(void) { /* TU-private fallback returned when the pool is exhausted. Sized as * a real SolidSyslogPlusTcpAddress so a Resolver overwrite at the - * exhausted-fallback call site is bounded — same freertos_sockaddr + * exhausted-fallback call site is bounded - same freertos_sockaddr * storage as any pooled slot. Not a per-Sender slot: multi-overflow * integrators share this storage and race on it. Bumping * SOLIDSYSLOG_ADDRESS_POOL_SIZE removes the race. */ diff --git a/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagram.c b/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagram.c index 45b87acc..e6ee67e4 100644 --- a/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagram.c +++ b/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagram.c @@ -112,7 +112,7 @@ static enum SolidSyslogDatagramSendResult PlusTcpDatagram_SendTo( * an unresolved peer drops at the IP layer. Host-class kernels mask this * with internal ARP queuing; this stack does not. So on cache miss we issue a * probe and yield once for the reply to land. If the reply hasn't arrived in - * time the sendto is allowed to fail or be dropped — UDP is best-effort and + * time the sendto is allowed to fail or be dropped - UDP is best-effort and * retry belongs in the store-and-forward layer above, not here. */ static inline void PlusTcpDatagram_PrimeArpIfMissing(uint32_t ip) { @@ -121,7 +121,7 @@ static inline void PlusTcpDatagram_PrimeArpIfMissing(uint32_t ip) * attempt FreeRTOS_sendto. 50 ms is generous against typical * sub-millisecond LAN ARP RTT but short enough that the first send * latency stays tolerable. If the reply hasn't arrived in time the - * sendto is allowed to fail or be dropped — UDP semantics. */ + * sendto is allowed to fail or be dropped - UDP semantics. */ static const TickType_t ARP_RESOLUTION_WAIT_TICKS = pdMS_TO_TICKS(50); if (xIsIPInARPCache(ip) == pdFALSE) diff --git a/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStream.c b/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStream.c index 81877111..927aa676 100644 --- a/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStream.c +++ b/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStream.c @@ -38,7 +38,7 @@ enum * SOL_SOCKET vs IPPROTO_TCP split; option codes are flat); pass 0 by * convention. */ SETSOCKOPT_LEVEL_DEFAULT = 0, - /* No MSG_PEEK / MSG_DONTWAIT / zero-copy — the timeouts cleared after + /* No MSG_PEEK / MSG_DONTWAIT / zero-copy - the timeouts cleared after * connect already give us the non-blocking single-call behaviour * SolidSyslogStream requires. */ SEND_RECV_FLAGS_DEFAULT = 0 @@ -108,7 +108,7 @@ static inline bool PlusTcpTcpStream_ConfigProvidesGetter(const struct SolidSyslo return (config != NULL) && (config->GetConnectTimeoutMs != NULL); } -/* Null Object substituted when the integrator does not install a getter — +/* Null Object substituted when the integrator does not install a getter - * returns the compile-time tunable so the bounded-wait path has a single * code path regardless of whether the integrator wired runtime tuning. */ static uint32_t PlusTcpTcpStream_NullConnectTimeoutGetter(void* context) @@ -186,7 +186,7 @@ static void PlusTcpTcpStream_ConnectOrCloseOnFailure( static bool PlusTcpTcpStream_TryConnect(struct SolidSyslogPlusTcpTcpStream* self, const struct SolidSyslogAddress* addr) { - /* Both SO_SNDTIMEO and SO_RCVTIMEO are set before FreeRTOS_connect — + /* Both SO_SNDTIMEO and SO_RCVTIMEO are set before FreeRTOS_connect - * upstream gates connect on SO_RCVTIMEO, but we set both as belt-and- * braces against an upstream change. After connect both timeouts go * back to 0 so subsequent Send/Read follow the non-blocking single- @@ -221,7 +221,7 @@ static inline void PlusTcpTcpStream_PrimeArpIfMissing(uint32_t ip) /* Yield window for the IP task to receive an ARP reply and populate * the cache before we attempt FreeRTOS_connect. Mirrors the * established SolidSyslogPlusTcpDatagram pattern (see - * [[freertos-arp-first-packet]]) — without this, a cold-start TCP + * [[freertos-arp-first-packet]]) - without this, a cold-start TCP * connect fires SYN before ARP resolves, the SYN is dropped at the * IP layer, and the bounded 200 ms RCV-timeout connect expires * before the retransmit ARP-and-resend cycle completes. */ @@ -290,7 +290,7 @@ static bool PlusTcpTcpStream_AllBytesSent(BaseType_t sentCount, size_t expected) /* FreeRTOS_recv with RCVTIMEO=0 returns 0 when no data is available (would * block); the Service thread treats that as "nothing to read right now". - * Negative returns are real errors — close the socket and surface failure. */ + * Negative returns are real errors - close the socket and surface failure. */ static SolidSyslogSsize PlusTcpTcpStream_Read(struct SolidSyslogStream* base, void* buffer, size_t size) { struct SolidSyslogPlusTcpTcpStream* self = PlusTcpTcpStream_SelfFromBase(base); diff --git a/Platform/Posix/Interface/SolidSyslogPosixMutex.h b/Platform/Posix/Interface/SolidSyslogPosixMutex.h index 683cd4ca..fbddb5f0 100644 --- a/Platform/Posix/Interface/SolidSyslogPosixMutex.h +++ b/Platform/Posix/Interface/SolidSyslogPosixMutex.h @@ -10,8 +10,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct SolidSyslogMutex; - /** Create takes no config; an exhausted pool — or a failed pthread_mutex_init - * — falls back to the shared NullMutex, whose Lock and Unlock are no-ops. */ + /** Create takes no config; an exhausted pool - or a failed pthread_mutex_init + * - falls back to the shared NullMutex, whose Lock and Unlock are no-ops. */ struct SolidSyslogMutex* SolidSyslogPosixMutex_Create(void); /** Release the pool slot; destroys the underlying pthread_mutex_t (only if it * was successfully initialised). */ diff --git a/Platform/Posix/Source/SolidSyslogPosixAddressStatic.c b/Platform/Posix/Source/SolidSyslogPosixAddressStatic.c index be7d2793..a81a8f28 100644 --- a/Platform/Posix/Source/SolidSyslogPosixAddressStatic.c +++ b/Platform/Posix/Source/SolidSyslogPosixAddressStatic.c @@ -25,7 +25,7 @@ struct SolidSyslogAddress* SolidSyslogPosixAddress_Create(void) { /* TU-private fallback returned when the pool is exhausted. Sized as * a real SolidSyslogPosixAddress so a Resolver overwrite at the - * exhausted-fallback call site is bounded — same sockaddr_in storage + * exhausted-fallback call site is bounded - same sockaddr_in storage * as any pooled slot. Not a per-Sender slot: multi-overflow integrators * share this storage and race on it. Bumping SOLIDSYSLOG_ADDRESS_POOL_SIZE * removes the race. */ diff --git a/Platform/Posix/Source/SolidSyslogPosixDatagram.c b/Platform/Posix/Source/SolidSyslogPosixDatagram.c index 6e0b806c..12d5fe02 100644 --- a/Platform/Posix/Source/SolidSyslogPosixDatagram.c +++ b/Platform/Posix/Source/SolidSyslogPosixDatagram.c @@ -100,7 +100,7 @@ static enum SolidSyslogDatagramSendResult PosixDatagram_SendTo( const struct sockaddr_in* sin = SolidSyslogPosixAddress_AsConstSockaddrIn(addr); ssize_t sent = sendto(self->Fd, buffer, size, 0, (const struct sockaddr*) sin, sizeof(*sin)); /* Capture errno immediately after sendto so the EMSGSIZE test below - * satisfies MISRA 22.10 — no intervening C-library calls between + * satisfies MISRA 22.10 - no intervening C-library calls between * the errno-setting function and the read. */ int sendErrno = (sent < 0) ? errno : 0; if (sent >= 0) @@ -113,7 +113,7 @@ static enum SolidSyslogDatagramSendResult PosixDatagram_SendTo( } else { - /* generic send failure — result stays Failed */ + /* generic send failure - result stays Failed */ } } return result; diff --git a/Platform/Posix/Source/SolidSyslogPosixMessageQueueBuffer.c b/Platform/Posix/Source/SolidSyslogPosixMessageQueueBuffer.c index 1b5d2997..745a620d 100644 --- a/Platform/Posix/Source/SolidSyslogPosixMessageQueueBuffer.c +++ b/Platform/Posix/Source/SolidSyslogPosixMessageQueueBuffer.c @@ -23,7 +23,7 @@ const struct SolidSyslogErrorSource PosixMessageQueueBufferErrorSource = {"Posix enum { - /* 0600 in octal — owner read/write, equivalent to S_IRUSR | S_IWUSR. Hex form avoids MISRA 7.1. */ + /* 0600 in octal - owner read/write, equivalent to S_IRUSR | S_IWUSR. Hex form avoids MISRA 7.1. */ OWNER_READ_WRITE = 0x180U }; @@ -96,7 +96,7 @@ static bool PosixMessageQueueBuffer_Read(struct SolidSyslogBuffer* base, void* d /* Capture errno immediately after mq_receive so the EAGAIN test below * stays a pure predicate and is decoupled from errno's lifetime * between the errno-setting call and the read (MISRA C:2012 Rule 22.10). - * EAGAIN is the empty-queue poll signal — part of the happy path and + * EAGAIN is the empty-queue poll signal - part of the happy path and * must stay silent. Any other errno is a real failure worth surfacing. */ int receiveErrno = success ? 0 : errno; if (!success && (receiveErrno != EAGAIN)) diff --git a/Platform/Posix/Source/SolidSyslogPosixTcpStream.c b/Platform/Posix/Source/SolidSyslogPosixTcpStream.c index e3c6367f..16bb3ac6 100644 --- a/Platform/Posix/Source/SolidSyslogPosixTcpStream.c +++ b/Platform/Posix/Source/SolidSyslogPosixTcpStream.c @@ -28,7 +28,7 @@ struct SolidSyslogAddress; enum { INVALID_FD = -1, - /* Keepalive parameters — bound the dead-peer detection window when the + /* Keepalive parameters - bound the dead-peer detection window when the socket is idle. Worst case: 45 + 4 * 10 = 85 s before ETIMEDOUT. TCP_USER_TIMEOUT covers the pending-write case (where keepalive does not fire) by capping how long unacked data can sit in the send queue. */ @@ -90,7 +90,7 @@ static inline bool PosixTcpStream_ConfigProvidesGetter(const struct SolidSyslogP return (config != NULL) && (config->GetConnectTimeoutMs != NULL); } -/* Null Object substituted when the integrator does not install a getter — +/* Null Object substituted when the integrator does not install a getter - * returns the compile-time tunable so the bounded-wait path has a single * code path regardless of whether the integrator wired runtime tuning. */ static uint32_t PosixTcpStream_NullConnectTimeoutGetter(void* context) @@ -166,7 +166,7 @@ static void PosixTcpStream_EnableTcpNoDelay(int fd) /* Enable kernel TCP keepalive so a dead peer is surfaced as ETIMEDOUT during * idle periods, not on the next PosixTcpStream_Send. TCP_USER_TIMEOUT covers the orthogonal * pending-write case (keepalive only fires on a fully idle socket). Linux is - * the POSIX target — TCP_KEEP* and TCP_USER_TIMEOUT are all available there; + * the POSIX target - TCP_KEEP* and TCP_USER_TIMEOUT are all available there; * other POSIX targets are out of scope until we actually port to one. */ static void PosixTcpStream_EnableKeepalive(int fd) { @@ -214,17 +214,17 @@ static long PosixTcpStream_ResolveConnectTimeoutMicros(struct SolidSyslogPosixTc } /* Non-blocking connect with bounded wait. connect() returns immediately: - * 0 — connected (loopback success path). - * -1 EINPROGRESS — connect started; wait via select() up to + * 0 - connected (loopback success path). + * -1 EINPROGRESS - connect started; wait via select() up to * CONNECT_TIMEOUT_MICROSECONDS, then read SO_ERROR to * distinguish completed-success from deferred-failure. - * -1 other — immediate fail-fast (refused, unreachable, etc.). */ + * -1 other - immediate fail-fast (refused, unreachable, etc.). */ static bool PosixTcpStream_Connect(int fd, const struct sockaddr_in* sin, long timeoutMicros) { bool connected = false; int rc = connect(fd, (const struct sockaddr*) sin, sizeof(*sin)); /* Capture errno immediately after connect so the EINPROGRESS test - * below satisfies MISRA 22.10 — no intervening C-library calls + * below satisfies MISRA 22.10 - no intervening C-library calls * between the errno-setting function and the read. */ int connectErrno = (rc < 0) ? errno : 0; @@ -239,7 +239,7 @@ static bool PosixTcpStream_Connect(int fd, const struct sockaddr_in* sin, long t } else { - /* immediate fail-fast (refused, unreachable, etc.) — connected stays false */ + /* immediate fail-fast (refused, unreachable, etc.) - connected stays false */ } return connected; } @@ -294,7 +294,7 @@ static SolidSyslogSsize PosixTcpStream_Read(struct SolidSyslogStream* base, void struct SolidSyslogPosixTcpStream* self = PosixTcpStream_SelfFromBase(base); ssize_t n = recv(self->Fd, buffer, size, 0); /* Capture errno immediately after recv so the WouldBlock test below - * satisfies MISRA 22.10 — passing the captured value into the helper + * satisfies MISRA 22.10 - passing the captured value into the helper * keeps the predicate pure and decouples it from errno's lifetime. */ int recvErrno = (n < 0) ? errno : 0; SolidSyslogSsize result = -1; diff --git a/Platform/Windows/Interface/SolidSyslogWindowsFile.h b/Platform/Windows/Interface/SolidSyslogWindowsFile.h index 80dfcae9..9130ec92 100644 --- a/Platform/Windows/Interface/SolidSyslogWindowsFile.h +++ b/Platform/Windows/Interface/SolidSyslogWindowsFile.h @@ -4,7 +4,7 @@ * or Store. * * Files open in binary mode (_O_BINARY) so the CRT's CR/LF translation never - * corrupts arbitrary bytes — BlockStore frames round-trip unchanged. A write is + * corrupts arbitrary bytes - BlockStore frames round-trip unchanged. A write is * not flushed to the medium, so durability past a power cut belongs to the * volume rather than to this adapter. */ #ifndef SOLIDSYSLOGWINDOWSFILE_H diff --git a/Platform/Windows/Source/SolidSyslogWinsockAddressStatic.c b/Platform/Windows/Source/SolidSyslogWinsockAddressStatic.c index f99e25a9..e27a858d 100644 --- a/Platform/Windows/Source/SolidSyslogWinsockAddressStatic.c +++ b/Platform/Windows/Source/SolidSyslogWinsockAddressStatic.c @@ -25,7 +25,7 @@ struct SolidSyslogAddress* SolidSyslogWinsockAddress_Create(void) { /* TU-private fallback returned when the pool is exhausted. Sized as * a real SolidSyslogWinsockAddress so a Resolver overwrite at the - * exhausted-fallback call site is bounded — same sockaddr_in storage + * exhausted-fallback call site is bounded - same sockaddr_in storage * as any pooled slot. Not a per-Sender slot: multi-overflow integrators * share this storage and race on it. Bumping SOLIDSYSLOG_ADDRESS_POOL_SIZE * removes the race. */ diff --git a/Platform/Windows/Source/SolidSyslogWinsockDatagram.c b/Platform/Windows/Source/SolidSyslogWinsockDatagram.c index 36b8529e..202f45dd 100644 --- a/Platform/Windows/Source/SolidSyslogWinsockDatagram.c +++ b/Platform/Windows/Source/SolidSyslogWinsockDatagram.c @@ -155,7 +155,7 @@ static enum SolidSyslogDatagramSendResult WinsockDatagram_SendTo( } else { - /* generic send failure — result stays Failed */ + /* generic send failure - result stays Failed */ } } return result; diff --git a/Platform/Windows/Source/SolidSyslogWinsockTcpStream.c b/Platform/Windows/Source/SolidSyslogWinsockTcpStream.c index 5f05c168..202b6977 100644 --- a/Platform/Windows/Source/SolidSyslogWinsockTcpStream.c +++ b/Platform/Windows/Source/SolidSyslogWinsockTcpStream.c @@ -168,7 +168,7 @@ static inline bool WinsockTcpStream_ConfigProvidesGetter(const struct SolidSyslo return (config != NULL) && (config->GetConnectTimeoutMs != NULL); } -/* Null Object substituted when the integrator does not install a getter — +/* Null Object substituted when the integrator does not install a getter - * returns the compile-time tunable so the bounded-wait path has a single * code path regardless of whether the integrator wired runtime tuning. */ static uint32_t WinsockTcpStream_NullConnectTimeoutGetter(void* context) @@ -287,7 +287,7 @@ static uint32_t WinsockTcpStream_ResolveConnectTimeoutMs(struct SolidSyslogWinso /* Non-blocking connect with bounded wait. Windows' default blocking connect() * to a refused loopback port retries internally for ~2 s before returning - * WSAECONNREFUSED — slow enough that the BlockStore service thread's drain + * WSAECONNREFUSED - slow enough that the BlockStore service thread's drain * rate during an outage is throttled to ~0.5 records/s, preventing the * discard policy from firing in BDD outage scenarios. The non-blocking path * bounds each connect attempt to CONNECT_TIMEOUT_MILLISECONDS; the socket @@ -308,7 +308,7 @@ static bool WinsockTcpStream_Connect(SOCKET fd, const struct sockaddr_in* sin, u } else { - /* immediate fail-fast (refused, unreachable, etc.) — connected stays false */ + /* immediate fail-fast (refused, unreachable, etc.) - connected stays false */ } return connected; } diff --git a/Tests/AddressFake.h b/Tests/AddressFake.h index 0b9b38af..5f85a844 100644 --- a/Tests/AddressFake.h +++ b/Tests/AddressFake.h @@ -8,7 +8,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* * Returns an opaque SolidSyslogAddress* suitable for tests that treat * Address as a pure pass-through token (StreamFakeTest, OpenSslStreamTest) - * — they never read the platform sockaddr inside. Platform-agnostic so + * - they never read the platform sockaddr inside. Platform-agnostic so * the same test executable builds on POSIX, Winsock, and FreeRTOS hosts * without conditional compilation. */ diff --git a/Tests/Bdd/Targets/BddTargetInteractiveTest.cpp b/Tests/Bdd/Targets/BddTargetInteractiveTest.cpp index 0cce3e3d..16a7a5eb 100644 --- a/Tests/Bdd/Targets/BddTargetInteractiveTest.cpp +++ b/Tests/Bdd/Targets/BddTargetInteractiveTest.cpp @@ -73,7 +73,7 @@ void RunWithInput(const char* input, BddTargetInteractiveSetHandler onSet) FILE* in = fmemopen(const_cast(input), strlen(input), "r"); struct SolidSyslogMessage message = {}; /* These tests only exercise the set/switch/quit input paths, never `send`, - so the SolidSyslog handle is never dereferenced — nullptr is safe. */ + so the SolidSyslog handle is never dereferenced - nullptr is safe. */ BddTargetInteractive_Run(nullptr, &message, in, nullptr, onSet); // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) -- fclose is POSIX C; no owning memory concern fclose(in); diff --git a/Tests/FileFake.c b/Tests/FileFake.c index 3196b3c5..dfef31e7 100644 --- a/Tests/FileFake.c +++ b/Tests/FileFake.c @@ -33,7 +33,7 @@ static void FileFake_Truncate(struct SolidSyslogFile* self); static bool FileFake_Exists(struct SolidSyslogFile* self, const char* path); static bool FileFake_Delete(struct SolidSyslogFile* self, const char* path); -/* poisoned vtable — installed by Destroy to catch use-after-destroy */ +/* poisoned vtable - installed by Destroy to catch use-after-destroy */ static bool FileFake_DestroyedOpen(struct SolidSyslogFile* self, const char* path); static void FileFake_DestroyedClose(struct SolidSyslogFile* self); static bool FileFake_DestroyedIsOpen(struct SolidSyslogFile* self); @@ -49,7 +49,7 @@ struct FileFake; /* openOwner pins the FileFake instance that currently has the entry open. NULL * when no instance holds it. A second Open by any other instance trips - * TestAssert_Fail — that is the single-handle-per-path invariant the store + * TestAssert_Fail - that is the single-handle-per-path invariant the store * layer relies on (see S27.01 / E27 #345). Ownership clears on the owner's * Close; Delete leaves it intact because the original holder is still the * only one who can legitimately Close its (now-zombie) handle. */ @@ -82,7 +82,7 @@ SOLIDSYSLOG_STATIC_ASSERT( /* shared in-memory filesystem */ static struct FileEntry filesystem[FILEFAKE_MAX_FILES]; -/* pointer to most recently created instance — used by FailNext* and inspection helpers */ +/* pointer to most recently created instance - used by FailNext* and inspection helpers */ static struct FileFake* lastCreated; /* helpers */ @@ -155,7 +155,7 @@ void FileFake_Destroy(void) /* filesystem is zeroed wholesale on Destroy, which also clears each * entry's openOwner. Tests creating multiple FileFakes in one group - * must Close before relying on Destroy to tear down — the assertion + * must Close before relying on Destroy to tear down - the assertion * in Open detects ownership leaks across instances. */ memset(filesystem, 0, sizeof(filesystem)); } @@ -500,11 +500,11 @@ static inline void ClearEntry(struct FileEntry* entry) memset(entry->content, 0, sizeof(entry->content)); entry->fileSize = 0; entry->path[0] = '\0'; - /* inUse stays true — prevents slot reuse while stale handles may reference this entry */ + /* inUse stays true - prevents slot reuse while stale handles may reference this entry */ } /* ------------------------------------------------------------------ - * Poisoned vtable — installed by Destroy + * Poisoned vtable - installed by Destroy * ----------------------------------------------------------------*/ static bool FileFake_DestroyedOpen(struct SolidSyslogFile* self, const char* path) diff --git a/Tests/FileFakeTest.cpp b/Tests/FileFakeTest.cpp index 695d4447..ffcda030 100644 --- a/Tests/FileFakeTest.cpp +++ b/Tests/FileFakeTest.cpp @@ -267,7 +267,7 @@ TEST(FileFake, TwoInstancesShareFilesystem) { SolidSyslogFile_Open(api, "shared.dat"); SolidSyslogFile_Write(api, "hello", 5); - /* Close before the second instance opens the same path — the S27.01 + /* Close before the second instance opens the same path - the S27.01 * single-handle-per-path invariant forbids overlap. The point of this * test is the shared in-memory filesystem, not concurrent opens. */ SolidSyslogFile_Close(api); @@ -434,7 +434,7 @@ TEST(FileFakeStaleHandle, ReadFailsOnStaleHandleAfterDeleteAndSlotReuse) const char newData[] = "replaced"; SolidSyslogFile_Write(handleB, newData, sizeof(newData)); - /* handleA still points at the old slot — read must fail, not return new file's data */ + /* handleA still points at the old slot - read must fail, not return new file's data */ SolidSyslogFile_SeekTo(handleA, 0); char buf[16] = {}; bool success = SolidSyslogFile_Read(handleA, buf, sizeof(data)); diff --git a/Tests/FreeRtos/CmsdkUartFake.c b/Tests/FreeRtos/CmsdkUartFake.c index f162cffe..ba9c1758 100644 --- a/Tests/FreeRtos/CmsdkUartFake.c +++ b/Tests/FreeRtos/CmsdkUartFake.c @@ -98,7 +98,7 @@ static void Fake_Write32(uintptr_t address, uint32_t value) } else if (offset == STATE_OFFSET) { - /* W1C — only the overrun bits are software-clearable. */ + /* W1C - only the overrun bits are software-clearable. */ fake.state &= ~(value & (TX_OVRE_BIT | 0x08U)); } else if (offset == CTRL_OFFSET) diff --git a/Tests/FreeRtos/CmsdkUartFake.h b/Tests/FreeRtos/CmsdkUartFake.h index c01e966c..36c5cd2c 100644 --- a/Tests/FreeRtos/CmsdkUartFake.h +++ b/Tests/FreeRtos/CmsdkUartFake.h @@ -26,7 +26,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * Models the per-character drain delay the QEMU stdio backend hides. */ void CmsdkUartFake_SetReadsBeforeTxReady(int reads); - /* True when the driver wrote to DATA while STATE.TX_FULL was set — i.e. + /* True when the driver wrote to DATA while STATE.TX_FULL was set - i.e. * the spin loop was missing or broken. Mirrors STATE.TX_OVRE on silicon. */ bool CmsdkUartFake_TxOverrunOccurred(void); @@ -40,7 +40,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void CmsdkUartFake_SetReceivedByte(char byte); /* Number of STATE reads after SetReceivedByte before the fake asserts - * STATE.RXFULL. Default is 0 — RXFULL set immediately. Use a positive + * STATE.RXFULL. Default is 0 - RXFULL set immediately. Use a positive * value to force the driver to spin on STATE before reading DATA. */ void CmsdkUartFake_SetReadsBeforeRxReady(int reads); diff --git a/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp b/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp index 6c1ab67c..b93dbf0a 100644 --- a/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp +++ b/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp @@ -50,7 +50,7 @@ uint32_t FakeGetConnectTimeoutMs_ReturnValue = SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_M void FakeGetConnectTimeoutMs_Reset() { FakeGetConnectTimeoutMs_CallCount = 0; - FakeGetConnectTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel — overwritten on first call */ + FakeGetConnectTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel - overwritten on first call */ FakeGetConnectTimeoutMs_ReturnValue = SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS; } diff --git a/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp b/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp index d4dea8e5..8fea1b3d 100644 --- a/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp @@ -52,7 +52,7 @@ static const uint16_t TEST_PORT = 514; /* Shared fixture: every Datagram lifecycle test needs the fake reset, a fresh * datagram + address handle pair, teardown of both, and the leak invariant - * — every udp_pcb handed out by udp_new must come back via udp_remove by the + * - every udp_pcb handed out by udp_new must come back via udp_remove by the * end of the test. TEST_GROUP_BASE keeps Created-only vs Opened groups * sharing this boilerplate. */ // clang-format off @@ -62,7 +62,7 @@ TEST_BASE(LwipRawDatagramTestBase) struct SolidSyslogAddress* address = nullptr; /* Shared scratch buffer for SendTo tests. Sized to MaxPayload so the * largest-length test (sendBytes(SOLIDSYSLOG_UDP_IPV6_SAFE_PAYLOAD)) - * stays in-bounds. Content is irrelevant — payload-pointer-identity + * stays in-bounds. Content is irrelevant - payload-pointer-identity * and length are the observable surface. */ char sendBuffer[SOLIDSYSLOG_UDP_IPV6_SAFE_PAYLOAD] = {}; @@ -89,7 +89,7 @@ TEST_BASE(LwipRawDatagramTestBase) SolidSyslogLwipRaw_SetMarshal(nullptr); } - /* SendTo against the shared buffer + address. Default length 1 — most + /* SendTo against the shared buffer + address. Default length 1 - most * tests don't care; tests asserting length pass it explicitly. */ enum SolidSyslogDatagramSendResult sendBytes(size_t length = 1U) { diff --git a/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp b/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp index c2625f40..e927cdd8 100644 --- a/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp @@ -52,7 +52,7 @@ unsigned FakeSleep_CallCount = 0; int FakeSleep_LastMs = 0; // When armed, FakeSleep fires the pending dns_found_callback the first time it -// is called with a callback outstanding — the host stand-in for the tcpip +// is called with a callback outstanding - the host stand-in for the tcpip // thread completing the lookup while the caller spins. Delivers &FakeSleep_FireIp // when FakeSleep_FireWithAddr, else NULL (lookup failure). bool FakeSleep_FireArmed = false; @@ -82,7 +82,7 @@ extern "C" void FakeSleep(int milliseconds) // each callback (same contract as LwipFakeMarshalGuard_TrackingMarshal, so the // teardown breach check still holds). Used to pin that the async-completion // result is read under a SECOND marshal hop (DoPublishResult) rather than off -// the volatile Done flag on the caller's thread — the cross-thread data-race fix. +// the volatile Done flag on the caller's thread - the cross-thread data-race fix. unsigned Marshal_CallCount = 0; extern "C" void CountingTrackingMarshal(SolidSyslogLwipRawCallback callback, void* context) @@ -246,7 +246,7 @@ TEST(SolidSyslogLwipRawDnsResolver, ResolveSpinsUntilAsyncCallbackFires) TEST(SolidSyslogLwipRawDnsResolver, SynchronousHitTakesExactlyOneMarshalHop) { // ERR_OK publishes inline (read-after-marshal is ordered by the hop return), - // so only the dns_gethostbyname hop runs — no separate publish hop. + // so only the dns_gethostbyname hop runs - no separate publish hop. LwipDnsFake_SetResult(ERR_OK); Resolve(); @@ -258,7 +258,7 @@ TEST(SolidSyslogLwipRawDnsResolver, AsyncSuccessReadsResultUnderASecondMarshalHo { // The cross-thread fix: after the spin observes the volatile Done flag, the // non-volatile ResolvedIp / ResolvedOk are read back on the lwIP thread via a - // SECOND marshal hop (DoPublishResult) — never off the flag on the caller's + // SECOND marshal hop (DoPublishResult) - never off the flag on the caller's // thread. Two hops total: dns_gethostbyname + publish. LwipDnsFake_SetResult(ERR_INPROGRESS); FakeSleep_FireArmed = true; @@ -272,7 +272,7 @@ TEST(SolidSyslogLwipRawDnsResolver, AsyncSuccessReadsResultUnderASecondMarshalHo TEST(SolidSyslogLwipRawDnsResolver, TimeoutDoesNotTakeThePublishHop) { - // No completion → no publish hop; only the dns_gethostbyname hop ran. + // No completion -> no publish hop; only the dns_gethostbyname hop ran. LwipDnsFake_SetResult(ERR_INPROGRESS); // callback never fires Resolve(); @@ -284,7 +284,7 @@ TEST(SolidSyslogLwipRawDnsResolver, ResolveReturnsFalseWhenAsyncCallbackDelivers { LwipDnsFake_SetResult(ERR_INPROGRESS); FakeSleep_FireArmed = true; - FakeSleep_FireWithAddr = false; // deliver NULL — lookup failed + FakeSleep_FireWithAddr = false; // deliver NULL - lookup failed CHECK_FALSE(Resolve()); } @@ -353,7 +353,7 @@ TEST(SolidSyslogLwipRawDnsResolver, ResolveInvokesDnsGetHostByNameUnderMarshal) TEST(SolidSyslogLwipRawDnsResolver, UdpTransportResolvesIdenticallyToTcp) { - // Locks in that the DNS resolver does not dispatch on transport — a future + // Locks in that the DNS resolver does not dispatch on transport - a future // reader must not add transport-typed lookup behaviour here. ip_addr_t hit = Ipv4(10, 0, 2, 2); LwipDnsFake_SetResult(ERR_OK); @@ -372,7 +372,7 @@ TEST(SolidSyslogLwipRawDnsResolver, UdpTransportResolvesIdenticallyToTcp) TEST(SolidSyslogLwipRawDnsResolver, ResolveAcceptsNumericLiteralAsSynchronousHit) { // Superset of the numeric resolver: a dotted-quad is handed to - // dns_gethostbyname, which resolves it synchronously (ERR_OK) — so numeric + // dns_gethostbyname, which resolves it synchronously (ERR_OK) - so numeric // hosts still resolve through this class. Here the fake stands in for that // ERR_OK return; the contract under test is that the literal host string // flows through unchanged and the resolve succeeds. diff --git a/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp b/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp index bf6faf04..15161dea 100644 --- a/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp @@ -116,7 +116,7 @@ TEST(SolidSyslogLwipRawResolver, ResolveReturnsFalseOnNonLiteralHost) TEST(SolidSyslogLwipRawResolver, ResolveReturnsFalseWhenIpaddrAtonRejectsHost) { - // We defer to lwIP's ipaddr_aton — whatever the parser accepts, we accept; + // We defer to lwIP's ipaddr_aton - whatever the parser accepts, we accept; // whatever it rejects, we reject. We do not enforce any specific shape on // top of the parser (no dotted-quad-only check) so the tests assert only // the rejection contract for clearly non-numeric inputs (DNS names, @@ -281,7 +281,7 @@ TEST(SolidSyslogLwipRawResolverPool, DestroyOfStaleHandleReportsWarning) TEST(SolidSyslogLwipRawResolver, UdpTransportResolvesIdenticallyToTcp) { - // Locks in that the literal-IPv4 resolver does not dispatch on transport — + // Locks in that the literal-IPv4 resolver does not dispatch on transport - // a future reader must not add transport-typed pcb selection here. Resolve(TEST_HOST, TEST_PORT, SOLIDSYSLOG_TRANSPORT_UDP); uint32_t udpIp = ip4_addr_get_u32(ip_2_ip4(&SolidSyslogLwipRawAddress_AsConst(addr)->Ip)); diff --git a/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp b/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp index e8b8299e..3c523302 100644 --- a/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp @@ -54,7 +54,7 @@ static const uint16_t TEST_PORT = 514; } // Asserts the lwIP API call recorded the pcb the wrapper got back from -// tcp_new — proves the wrapper forwarded the right handle. `getter` is +// tcp_new - proves the wrapper forwarded the right handle. `getter` is // the LwipTcpFake_LastXxxPcb accessor function (zero-arg). // clang-format off #define CHECK_FORWARDED_PCB(getter) POINTERS_EQUAL(LwipTcpFake_LastTcpNewReturned(), getter()) @@ -98,7 +98,7 @@ extern "C" uint32_t FakeGetConnectTimeoutMs(void* context) /* Shared fixture: every TcpStream lifecycle test needs the fakes reset, a * fresh stream + address handle pair, teardown of both, and the leak - * invariant — every tcp_pcb handed out by tcp_new must come back via + * invariant - every tcp_pcb handed out by tcp_new must come back via * tcp_close / tcp_abort / null-via-tcp_err by the end of the test. */ // clang-format off TEST_BASE(LwipRawTcpStreamTestBase) @@ -154,7 +154,7 @@ TEST_BASE(LwipRawTcpStreamTestBase) /* Drive the wrapper's tcp_recv callback with a fabricated incoming * pbuf. Caller supplies stack storage for the pbuf so multi-pbuf * tests can verify queue head advancement by pointer identity. - * Returns the err_t the wrapper's callback returned — ERR_OK means + * Returns the err_t the wrapper's callback returned - ERR_OK means * the wrapper took ownership of the pbuf (leak counter bumped here); * non-ERR_OK means lwIP retains the pbuf and the counter stays put, * so backpressure tests can pin the contract without imbalance. */ @@ -207,7 +207,7 @@ TEST_BASE(LwipRawTcpStreamTestBase) return result; } - /* Drive the wrapper's tcp_recv callback with NULL p — peer half-close + /* Drive the wrapper's tcp_recv callback with NULL p - peer half-close * (FIN). lwIP retains the pcb; only the receive half is gone. */ static void pushPeerFin() { @@ -215,7 +215,7 @@ TEST_BASE(LwipRawTcpStreamTestBase) (void) recvCb(LwipTcpFake_LastCallbackArg(), LwipTcpFake_LastTcpNewReturned(), nullptr, ERR_OK); } - /* Drive the wrapper's tcp_err callback — lwIP releases the pcb + /* Drive the wrapper's tcp_err callback - lwIP releases the pcb * upstream before this fires, so the leak invariant needs the * matching NotePcbReleasedByErr. */ static void pushTcpErr(int8_t err) @@ -340,8 +340,8 @@ TEST(SolidSyslogLwipRawTcpStream, OpenSetsKeepaliveOnPcb) CHECK((LwipTcpFake_LastTcpNewReturned()->so_options & SOF_KEEPALIVE) != 0); } -// Nagle is disabled (TF_NODELAY set) so small, un-pipelined writes — octet-framed -// records, and the multi-segment handshake flights of a stacked TLS layer — go out +// Nagle is disabled (TF_NODELAY set) so small, un-pipelined writes - octet-framed +// records, and the multi-segment handshake flights of a stacked TLS layer - go out // immediately instead of being held until the previous segment is ACKed (which // deadlocks a TLS handshake mid-flight against a peer that ACKs per-flight). TEST(SolidSyslogLwipRawTcpStream, OpenDisablesNagleOnPcb) @@ -409,7 +409,7 @@ TEST(SolidSyslogLwipRawTcpStream, OpenSleepsBetweenPollsDuringTimeoutPath) SolidSyslogStream_Open(stream, address); - /* timeout / poll periods → exactly that many sleeps before giving up. */ + /* timeout / poll periods -> exactly that many sleeps before giving up. */ LONGS_EQUAL(SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS / SOLIDSYSLOG_LWIP_RAW_TCP_CONNECT_POLL_MS, FakeSleep_CallCount); LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_TCP_CONNECT_POLL_MS, FakeSleep_LastMs); } @@ -499,7 +499,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, DestroyAfterCloseDoesNotCloseAgain) TEST(SolidSyslogLwipRawTcpStreamConnected, TcpErrCallbackReleasesPcbWithoutCallingTcpClose) { /* Drive the err callback the wrapper registered. lwIP releases the - * pcb upstream before invoking err — the wrapper must null its Pcb + * pcb upstream before invoking err - the wrapper must null its Pcb * field and NOT call tcp_close (use-after-free). */ pushTcpErr(ERR_RST); @@ -510,7 +510,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, TcpErrCallbackReleasesPcbWithoutCalli TEST(SolidSyslogLwipRawTcpStreamConnected, SentCallbackReturnsErrOkAsNoOpStub) { - /* TCP_WRITE_FLAG_COPY means caller buffers are released at Send return — + /* TCP_WRITE_FLAG_COPY means caller buffers are released at Send return - * no per-ACK accounting needed. The slot exists because lwIP wants the * callback set when the pcb is wired. */ tcp_sent_fn sentCb = LwipTcpFake_LastSentFn(); @@ -569,7 +569,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, SendReturnsFalseAndClosesOnTcpWriteFa TEST(SolidSyslogLwipRawTcpStreamConnected, SendReturnsTrueWhenTcpOutputDefersWithErrMem) { - /* tcp_write succeeded → data is in pcb->snd_buf; ERR_MEM from + /* tcp_write succeeded -> data is in pcb->snd_buf; ERR_MEM from * tcp_output just means lwIP will retry on the next tcp_tmr tick. * lwIP owns the bytes, so the wrapper reports success (mirrors POSIX's * "kernel accepted into send buffer" semantics). */ @@ -601,7 +601,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, SendAfterTcpErrReturnsFalse) TEST(SolidSyslogLwipRawTcpStreamConnected, ReadReturnsZeroWhenQueueEmpty) { - /* Would-block semantic — keeps the connection alive. */ + /* Would-block semantic - keeps the connection alive. */ LONGS_EQUAL(0, readBytes()); CALLED_FAKE(LwipTcpFake_TcpClose, NEVER); } @@ -642,7 +642,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, ReadReturnsPartialWhenBufferSmallerTh LONGS_EQUAL(2, first); MEMCMP_EQUAL("ab", readBuffer, 2); - /* Head not yet drained — pbuf still queued. */ + /* Head not yet drained - pbuf still queued. */ CALLED_FAKE(LwipPbufFake_PbufFree, NEVER); SolidSyslogSsize second = readBytes(); @@ -688,8 +688,8 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, ReadAcrossChainedPbufLinkBoundaryPres struct pbuf link2 = {}; pushIncomingChain(&link1, "AB", 2, &link2, "CD", 2); - /* A 3-byte read straddles the link boundary — two bytes from link1, one - * from link2 — and the chain is not yet fully drained. */ + /* A 3-byte read straddles the link boundary - two bytes from link1, one + * from link2 - and the chain is not yet fully drained. */ SolidSyslogSsize first = readBytes(3); LONGS_EQUAL(3, first); @@ -708,7 +708,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, ReadReportsOnlyBytesActuallyCopiedWhe { /* A malformed pbuf: tot_len claims 4 bytes but the single link holds only * 2 and there is no next link. The drain must report what lwIP actually - * copied (2), never the phantom tail the overstated tot_len implies — + * copied (2), never the phantom tail the overstated tot_len implies - * advancing past un-copied bytes would feed stale buffer content to a * stacked TLS record stream. */ struct pbuf link = {}; @@ -733,7 +733,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, SendReturnsFalseAfterPeerFin) pushPeerFin(); /* A peer half-close (FIN) leaves the pcb alive but the connection doomed. - * Send must report failure — without it the StreamSender keeps writing into + * Send must report failure - without it the StreamSender keeps writing into * the dead connection and never reconnects after the server recovers. */ CHECK_FALSE(sendBytes()); CALLED_FAKE(LwipTcpFake_TcpWrite, NEVER); @@ -759,7 +759,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, ReadReturnsMinusOneAfterTcpErrWithout pushTcpErr(ERR_RST); LONGS_EQUAL(-1, readBytes()); - /* Pcb already nulled by tcp_err — no tcp_close. */ + /* Pcb already nulled by tcp_err - no tcp_close. */ CALLED_FAKE(LwipTcpFake_TcpClose, NEVER); } @@ -771,7 +771,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, RecvCallbackBackpressuresWhenQueueFul pushIncomingPbuf(&p, "1", 1); } - /* Next pbuf — queue is full, callback returns non-ERR_OK and + /* Next pbuf - queue is full, callback returns non-ERR_OK and * pushIncomingPbuf's auto-balancing leaves the outstanding count * untouched so teardown's leak invariant still passes. */ struct pbuf overflow = {}; @@ -809,7 +809,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, CloseDrainsRxQueueBeforeTcpClose) } /* ------------------------------------------------------------------ - * Pool tests — handed-out handles never call lwIP, so they don't need + * Pool tests - handed-out handles never call lwIP, so they don't need * the fake state. Same TEST_GROUP shape as Commit 1. * ----------------------------------------------------------------*/ diff --git a/Tests/MbedTls/SolidSyslogMbedTlsAesGcmPolicyTest.cpp b/Tests/MbedTls/SolidSyslogMbedTlsAesGcmPolicyTest.cpp index 4ddeb83e..fc489ab4 100644 --- a/Tests/MbedTls/SolidSyslogMbedTlsAesGcmPolicyTest.cpp +++ b/Tests/MbedTls/SolidSyslogMbedTlsAesGcmPolicyTest.cpp @@ -41,7 +41,7 @@ enum static const uint8_t* lastGetKeyBuffer = nullptr; static size_t lastGetKeyCapacity = 0; -/* Settable key accessor. `keyAvailable` false → GetKey fails; `keyByte` sets the +/* Settable key accessor. `keyAvailable` false -> GetKey fails; `keyByte` sets the * key contents (vary it to forge a wrong key); `keyLengthToReport` lets a test * report a non-32-byte key. */ static bool keyAvailable = true; @@ -331,7 +331,7 @@ TEST(SolidSyslogMbedTlsAesGcmPolicySeal, SealRecordGeneratesAFreshNonceIntoTheTr LONGS_EQUAL(GCM_NONCE_SIZE, MbedTlsFake_LastCtrDrbgRandomLen()); POINTERS_EQUAL(trailer, MbedTlsFake_LastCtrDrbgRandomBuf()); POINTERS_EQUAL(&rng, MbedTlsFake_LastCtrDrbgRandomContext()); - /* The fake's CTR-DRBG fills 0xA0, 0xA1, … — assert it reached the trailer. */ + /* The fake's CTR-DRBG fills 0xA0, 0xA1, ... - assert it reached the trailer. */ static const uint8_t expectedNonce[GCM_NONCE_SIZE] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB}; MEMCMP_EQUAL(expectedNonce, trailer, GCM_NONCE_SIZE); @@ -342,7 +342,7 @@ TEST(SolidSyslogMbedTlsAesGcmPolicySeal, SealRecordPassesTheBodyAsPlaintextToEnc CHECK_TRUE(seal()); /* Production hands mbedTLS the body region (Content past HeaderLength), not - * the header — that the body region is what gets encrypted is the wiring + * the header - that the body region is what gets encrypted is the wiring * under test. Whether the ciphertext genuinely differs is the integration * suite's concern. */ LONGS_EQUAL(TEST_BODY_LEN, MbedTlsFake_LastGcmPlaintextLen()); @@ -391,7 +391,7 @@ TEST(SolidSyslogMbedTlsAesGcmPolicySeal, OpenReturnsTrueWhenDecryptionSucceeds) /* A tag mismatch (tamper or wrong key) surfaces as mbedtls_gcm_auth_decrypt * returning MBEDTLS_ERR_GCM_AUTH_FAILED. Production must fail closed but stay - * silent — that is the expected outcome, not a library error. Real tamper / + * silent - that is the expected outcome, not a library error. Real tamper / * wrong-key rejection lives in the integration suite; here we only prove the * adapter's verdict-propagation and silence. */ TEST(SolidSyslogMbedTlsAesGcmPolicySeal, OpenReturnsFalseWithoutReportingWhenAuthenticationFails) @@ -469,7 +469,7 @@ TEST(SolidSyslogMbedTlsAesGcmPolicySeal, SealReportsErrorWhenEncryptingFails) } /* Open's setkey failure and a genuine (non-auth) auth_decrypt error both report - * DECRYPT_FAILED. The auth-mismatch verdict is separate — that fail-closed-but- + * DECRYPT_FAILED. The auth-mismatch verdict is separate - that fail-closed-but- * silent path is OpenReturnsFalseWithoutReporting... above. */ TEST(SolidSyslogMbedTlsAesGcmPolicySeal, OpenReportsErrorWhenSettingKeyFails) { diff --git a/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp b/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp index e8395f36..72df9466 100644 --- a/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp +++ b/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp @@ -35,7 +35,7 @@ enum * not. */ static uint8_t TEST_RECORD[] = {0x10, 0x20, 0x30, 0x40}; -/* The buffer + capacity the policy handed to GetKey on the most recent fetch — +/* The buffer + capacity the policy handed to GetKey on the most recent fetch - * lets a test assert the key buffer is wiped at exactly that pointer and size. */ static const uint8_t* lastGetKeyBuffer = nullptr; static size_t lastGetKeyCapacity = 0; @@ -426,7 +426,7 @@ TEST(SolidSyslogMbedTlsHmacSha256PolicySeal, OpenRecordFailsClosedWhenKeyUnavail } // An HMAC computation failure during verify is an OPEN failure, not a SEAL -// failure — the same ComputeTag helper serves both paths, so the category must +// failure - the same ComputeTag helper serves both paths, so the category must // be chosen by the caller. TEST(SolidSyslogMbedTlsHmacSha256PolicySeal, OpenRecordReportsHmacFailureAsOpenFailed) { diff --git a/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp b/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp index ce53b28d..299ac361 100644 --- a/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp +++ b/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp @@ -40,7 +40,7 @@ TEST_GROUP(SolidSyslogMbedTlsStreamPool) void setup() override { - /* A real transport handle keeps Destroy → Cleanup → Close on the + /* A real transport handle keeps Destroy -> Cleanup -> Close on the * vtable-routed transport safe; mirrors the OpenSslStream * pool-test pattern. */ transport = StreamFake_Create(); diff --git a/Tests/MbedTls/SolidSyslogMbedTlsStreamTest.cpp b/Tests/MbedTls/SolidSyslogMbedTlsStreamTest.cpp index 5f3f04fa..33ca124c 100644 --- a/Tests/MbedTls/SolidSyslogMbedTlsStreamTest.cpp +++ b/Tests/MbedTls/SolidSyslogMbedTlsStreamTest.cpp @@ -58,7 +58,7 @@ uint32_t FakeGetHandshakeTimeoutMs_ReturnValue = SOLIDSYSLOG_TLS_HANDSHAKE_TIMEO void FakeGetHandshakeTimeoutMs_Reset() { FakeGetHandshakeTimeoutMs_CallCount = 0; - FakeGetHandshakeTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel — overwritten on first call */ + FakeGetHandshakeTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel - overwritten on first call */ FakeGetHandshakeTimeoutMs_ReturnValue = SOLIDSYSLOG_TLS_HANDSHAKE_TIMEOUT_MS; } @@ -109,11 +109,11 @@ TEST_GROUP(SolidSyslogMbedTlsStream) StreamFake_Destroy(transport); } - /* Tests needing config tweaks (CaChain, Rng, ServerName, …) call this + /* Tests needing config tweaks (CaChain, Rng, ServerName, ...) call this * to release setup()'s pool slot, mutate `config`, then re-Create. * Fully resets the fixture (transport, MbedTls fake counters, error * handler) so the test body observes counts from this Open onwards - * only — matters for assertions like CHECK_OPEN_UNWOUND_WITH_ERROR + * only - matters for assertions like CHECK_OPEN_UNWOUND_WITH_ERROR * that pin counts at == 1. */ void ReCreateHandleWithUpdatedConfig() { @@ -127,7 +127,7 @@ TEST_GROUP(SolidSyslogMbedTlsStream) } /* Arrange mbedtls_ssl_handshake to first emit `wantError`, then succeed on - * the next call — exercises the bounded handshake retry loop's progress + * the next call - exercises the bounded handshake retry loop's progress * path. mbedTLS returns the error code directly (no get_error indirection). */ static void ArrangeHandshakeRetryThenSucceed(int wantError) { @@ -135,7 +135,7 @@ TEST_GROUP(SolidSyslogMbedTlsStream) MbedTlsFake_SetSslHandshakeReturnSequence(seq, 2); } - /* Arrange mbedtls_ssl_handshake to fail with `errorCode` on every call — + /* Arrange mbedtls_ssl_handshake to fail with `errorCode` on every call - * used both for the persistent-WANT (budget-exhausted) and hard-error paths. */ static void ArrangePersistentHandshakeError(int errorCode) { @@ -159,7 +159,7 @@ TEST(SolidSyslogMbedTlsStream, CreateInitialisesSslConfigForSafeFree) { /* Init happens eagerly in Create (via MbedTlsStream_Initialise) so the - * symmetric *_free in Close is always safe — whether Open was reached, + * symmetric *_free in Close is always safe - whether Open was reached, * whether it succeeded, or whether Close is called more than once. */ LONGS_EQUAL(1, MbedTlsFake_SslConfigInitCallCount()); } @@ -278,7 +278,7 @@ TEST(SolidSyslogMbedTlsStream, OpenClosesTransportAndFreesSslStateWhenHandshakeB { /* ServerName set so the handshake timeout is the only error source (a NULL * ServerName would also emit the unverified-peer WARNING). - * mbedtls_ssl_handshake always returns WANT_READ — handshake never makes + * mbedtls_ssl_handshake always returns WANT_READ - handshake never makes * progress, so the bounded budget should expire and Open returns false. */ config.ServerName = "syslog.example.com"; ReCreateHandleWithUpdatedConfig(); @@ -305,7 +305,7 @@ TEST(SolidSyslogMbedTlsStream, OpenInvokesConfiguredHandshakeTimeoutGetter) TEST(SolidSyslogMbedTlsStream, OpenUsesGetterReturnValueAsHandshakeBudget) { - /* 5 ms budget against the 1 ms poll interval → loop should sleep 5 times + /* 5 ms budget against the 1 ms poll interval -> loop should sleep 5 times before declaring HANDSHAKE_TIMEOUT and unwinding. */ FakeGetHandshakeTimeoutMs_ReturnValue = 5U; RecreateHandleWithFakeHandshakeGetter(); @@ -330,7 +330,7 @@ TEST(SolidSyslogMbedTlsStream, SecondOpenAfterFailedFirstOpenSucceeds) { /* The recovery contract that the per-failure-point unwinds enable: once * Open's failure tail Closes the transport and frees the SSL state, the - * next Open is a clean Open-Close-Open cycle on the transport — Connected + * next Open is a clean Open-Close-Open cycle on the transport - Connected * goes false, StreamSender's next reconnect tick re-enters, and the * second handshake completes. Without the unwind, the inner transport * would stay open and PosixTcpStream_Open would clobber its fd. */ @@ -347,7 +347,7 @@ TEST(SolidSyslogMbedTlsStream, OpenClosesTransportAndFreesSslStateWhenHandshakeF { /* ServerName set so the handshake hard error is the only error source. - * Non-WANT error (e.g. a verify/connection failure) is fail-fast — no + * Non-WANT error (e.g. a verify/connection failure) is fail-fast - no * retry budget burn, no Sleep. */ config.ServerName = "syslog.example.com"; ReCreateHandleWithUpdatedConfig(); @@ -400,7 +400,7 @@ TEST(SolidSyslogMbedTlsStream, OpenClosesTransportAndFreesSslStateWhenSetHostnam { /* ServerName must be set for ConfigureExpectedHostname to invoke - * mbedtls_ssl_set_hostname — otherwise the helper short-circuits to true. */ + * mbedtls_ssl_set_hostname - otherwise the helper short-circuits to true. */ config.ServerName = "syslog.example.com"; ReCreateHandleWithUpdatedConfig(); MbedTlsFake_SetSslSetHostnameReturn(-1); @@ -457,7 +457,7 @@ TEST(SolidSyslogMbedTlsStream, SendClosesSslAndTransportOnWriteFailure) { /* Fail-fast: a TLS-level write failure means the session state is - * unrecoverable. Mirror the OpenSslStream contract — close internally + * unrecoverable. Mirror the OpenSslStream contract - close internally * so the StreamSender reconnect path runs on the next tick. */ const unsigned char payload[] = {0x10, 0x20, 0x30}; MbedTlsFake_SetSslWriteReturn(-1); @@ -472,7 +472,7 @@ TEST(SolidSyslogMbedTlsStream, SendClosesSslAndTransportOnShortWrite) { /* mbedtls_ssl_write returning fewer bytes than requested is treated the - * same as outright failure — the application boundary requires + * same as outright failure - the application boundary requires * all-or-nothing writes (syslog framing). */ const unsigned char payload[] = {0x10, 0x20, 0x30}; MbedTlsFake_SetSslWriteReturn(2); /* asked for 3, got 2 */ @@ -541,7 +541,7 @@ TEST(SolidSyslogMbedTlsStream, ReadClosesSslAndTransportOnHardError) TEST(SolidSyslogMbedTlsStream, ReadDoesNotCloseOnWantRead) { - /* WANT_READ is steady-state would-block, not a connection failure — + /* WANT_READ is steady-state would-block, not a connection failure - * leave the session intact so the caller can retry. */ unsigned char buffer[8]; MbedTlsFake_SetSslReadReturn(MBEDTLS_ERR_SSL_WANT_READ); @@ -562,7 +562,7 @@ TEST(SolidSyslogMbedTlsStream, CloseAfterInternalCloseFromSendFailureDoesNotDoub MbedTlsFake_SetSslWriteReturn(-1); SolidSyslogStream_Send(handle, payload, sizeof(payload)); /* internal close */ - SolidSyslogStream_Close(handle); /* second close — must be safe */ + SolidSyslogStream_Close(handle); /* second close - must be safe */ /* Exactly one of each free per real session. The teardown's Destroy * will add a third pair when this test ends, but that's outside the @@ -681,7 +681,7 @@ TEST(SolidSyslogMbedTlsStream, OpenSetsAuthmodeRequired) LONGS_EQUAL(MBEDTLS_SSL_VERIFY_REQUIRED, MbedTlsFake_LastSslConfAuthmodeArg()); } -// Parity with the OpenSSL adapter's explicit TLS 1.2 floor — the mbedTLS default +// Parity with the OpenSSL adapter's explicit TLS 1.2 floor - the mbedTLS default // preset can otherwise negotiate down to TLS 1.0/1.1 on permissive builds. TEST(SolidSyslogMbedTlsStream, OpenPinsMinimumTlsVersionToTls12) @@ -744,7 +744,7 @@ TEST(SolidSyslogMbedTlsStream, OpenSkipsHostnameWhenServerNameIsNull) TEST(SolidSyslogMbedTlsStream, OpenWarnsWhenServerNameIsNull) { - /* setup() left config.ServerName at NULL — peer identity is unverified, which + /* setup() left config.ServerName at NULL - peer identity is unverified, which * the library must surface rather than swallow (S12.28). */ SolidSyslogStream_Open(handle, addr); @@ -758,7 +758,7 @@ TEST(SolidSyslogMbedTlsStream, OpenWarnsWhenServerNameIsNull) TEST(SolidSyslogMbedTlsStream, OpenStillConnectsWhenServerNameIsNull) { - /* The unverified-peer WARNING is observable but non-fatal — the IP-pinned / + /* The unverified-peer WARNING is observable but non-fatal - the IP-pinned / * closed-network use case must still connect. */ CHECK_TRUE(SolidSyslogStream_Open(handle, addr)); LONGS_EQUAL(0, StreamFake_CloseCallCount(transport)); @@ -767,7 +767,7 @@ TEST(SolidSyslogMbedTlsStream, OpenStillConnectsWhenServerNameIsNull) TEST(SolidSyslogMbedTlsStream, OpenDoesNotWarnWhenServerNameIsEmpty) { - /* Empty string is the deliberate opt-out — no diagnostic. */ + /* Empty string is the deliberate opt-out - no diagnostic. */ config.ServerName = ""; ReCreateHandleWithUpdatedConfig(); SolidSyslogStream_Open(handle, addr); @@ -798,7 +798,7 @@ TEST(SolidSyslogMbedTlsStream, OpenConnectsWhenServerNameIsEmpty) * mTLS client identity wiring. When the integrator supplies both a * ClientCertChain and a ClientKey, Open must call mbedtls_ssl_conf_own_cert * so the client presents its cert during the handshake. Either pointer - * being NULL means "server-auth only" — skip the wiring. + * being NULL means "server-auth only" - skip the wiring. * ------------------------------------------------------------------------- */ TEST(SolidSyslogMbedTlsStream, OpenWiresOwnCertWhenClientCertAndKeyProvided) @@ -820,7 +820,7 @@ TEST(SolidSyslogMbedTlsStream, OpenWiresOwnCertWhenClientCertAndKeyProvided) TEST(SolidSyslogMbedTlsStream, OpenSkipsOwnCertWhenClientCertChainIsNull) { - /* Key provided, cert NULL — caller hasn't fully opted in to mTLS, so + /* Key provided, cert NULL - caller hasn't fully opted in to mTLS, so * the adapter must not tell mbedTLS anything. setup() leaves * ClientCertChain at NULL; supplying just a Key is the incomplete case. */ static mbedtls_pk_context clientKeyMarker; @@ -834,7 +834,7 @@ TEST(SolidSyslogMbedTlsStream, OpenSkipsOwnCertWhenClientCertChainIsNull) TEST(SolidSyslogMbedTlsStream, OpenSkipsOwnCertWhenClientKeyIsNull) { - /* Cert provided, key NULL — still incomplete; same skip. */ + /* Cert provided, key NULL - still incomplete; same skip. */ static mbedtls_x509_crt clientCertMarker; config.ClientCertChain = &clientCertMarker; ReCreateHandleWithUpdatedConfig(); diff --git a/Tests/MbedTlsIntegration/MbedTlsTestCert.c b/Tests/MbedTlsIntegration/MbedTlsTestCert.c index b46d6123..76b4ed43 100644 --- a/Tests/MbedTlsIntegration/MbedTlsTestCert.c +++ b/Tests/MbedTlsIntegration/MbedTlsTestCert.c @@ -20,7 +20,7 @@ enum DER_BUFFER_BYTES = 4096 }; -/* Obviously-fake test validity window — well outside any realistic clock skew +/* Obviously-fake test validity window - well outside any realistic clock skew * and far enough out that the integration tests don't need wall-clock-aware * regeneration. Named per the TEST_* convention. */ static const char* const TEST_CERT_VALIDITY_FROM = "20240101000000"; @@ -92,7 +92,7 @@ static void WriteCertToDer( mbedtls_x509write_crt_set_subject_key(&crt, subjectKey); mbedtls_x509write_crt_set_subject_name(&crt, config->SubjectName); - /* Self-signed when Issuer == NULL — issuer name + key match the subject. */ + /* Self-signed when Issuer == NULL - issuer name + key match the subject. */ const char* issuerName = (config->Issuer != NULL) ? config->Issuer->SubjectName : config->SubjectName; mbedtls_pk_context* issuerKey = (config->Issuer != NULL) ? (mbedtls_pk_context*) &config->Issuer->Key : subjectKey; mbedtls_x509write_crt_set_issuer_name(&crt, issuerName); diff --git a/Tests/MbedTlsIntegration/MbedTlsTestServer.c b/Tests/MbedTlsIntegration/MbedTlsTestServer.c index afb69ac0..b92a0d3a 100644 --- a/Tests/MbedTlsIntegration/MbedTlsTestServer.c +++ b/Tests/MbedTlsIntegration/MbedTlsTestServer.c @@ -40,7 +40,7 @@ struct MbedTlsTestServer* MbedTlsTestServer_Create(const struct MbedTlsTestServe MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT ); - /* Pin TLS 1.2 — mirrors the rationale in the OpenSSL TlsTestServer + /* Pin TLS 1.2 - mirrors the rationale in the OpenSSL TlsTestServer * (Tests/OpenSslIntegration/TlsTestServer.c:37). In TLS 1.3 the server * sends Certificate/CertVerify/Finished in one flight and then blocks * in recv waiting for ClientFinished. On the negative paths the client's @@ -60,7 +60,7 @@ struct MbedTlsTestServer* MbedTlsTestServer_Create(const struct MbedTlsTestServe } else { - /* Server-auth only — no client cert requested. */ + /* Server-auth only - no client cert requested. */ mbedtls_ssl_conf_authmode(&self->SslConfig, MBEDTLS_SSL_VERIFY_NONE); } mbedtls_ssl_conf_own_cert( @@ -105,7 +105,7 @@ void MbedTlsTestServer_Destroy(struct MbedTlsTestServer* self) bool MbedTlsTestServer_JoinAndHandshakeSucceeded(struct MbedTlsTestServer* self) { /* RunServer exits naturally once the client closes its end (recv returns - * 0 → handshake or read sees EOF). Tests should close the client side + * 0 -> handshake or read sees EOF). Tests should close the client side * before calling Join so this returns promptly. */ if (!self->ThreadJoined) { @@ -115,7 +115,7 @@ bool MbedTlsTestServer_JoinAndHandshakeSucceeded(struct MbedTlsTestServer* self) return self->HandshakeSucceeded; } -/* The thread exits as soon as the handshake settles — the tests pin +/* The thread exits as soon as the handshake settles - the tests pin * handshake outcome only. Reading application bytes after handshake (and * the blocking that implies) is intentionally not implemented. */ static void* RunServer(void* arg) diff --git a/Tests/MbedTlsIntegration/MbedTlsTestServer.h b/Tests/MbedTlsIntegration/MbedTlsTestServer.h index 0cb2caeb..ce22bf5f 100644 --- a/Tests/MbedTlsIntegration/MbedTlsTestServer.h +++ b/Tests/MbedTlsIntegration/MbedTlsTestServer.h @@ -18,7 +18,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN const struct MbedTlsTestCert* ServerCert; /* server's cert + matching key */ mbedtls_ctr_drbg_context* Rng; /* shared with the test fixture */ /* Non-NULL switches the server to require + verify a client cert - * against this CA — drives the mTLS scenarios. NULL = server-auth only. */ + * against this CA - drives the mTLS scenarios. NULL = server-auth only. */ const struct MbedTlsTestCert* TrustedClientCa; }; diff --git a/Tests/MbedTlsIntegration/SocketStream.c b/Tests/MbedTlsIntegration/SocketStream.c index 4365a263..66882920 100644 --- a/Tests/MbedTlsIntegration/SocketStream.c +++ b/Tests/MbedTlsIntegration/SocketStream.c @@ -72,7 +72,7 @@ static SolidSyslogSsize SocketStream_Read(struct SolidSyslogStream* self, void* { /* Distinguish EOF (peer closed: recv == 0) from would-block (the Stream * contract reserves 0 for "no data available, try again"). The MbedTls - * BIO recv callback maps a transport 0 to MBEDTLS_ERR_SSL_WANT_READ — + * BIO recv callback maps a transport 0 to MBEDTLS_ERR_SSL_WANT_READ - * forwarding a real EOF as 0 would loop the handshake until the budget * exhausts. Map EOF to -1 (fatal) instead. */ struct SocketStream* stream = (struct SocketStream*) self; diff --git a/Tests/MbedTlsIntegration/SolidSyslogMbedTlsStreamIntegrationTest.cpp b/Tests/MbedTlsIntegration/SolidSyslogMbedTlsStreamIntegrationTest.cpp index 4eb64f57..a1d7a8a6 100644 --- a/Tests/MbedTlsIntegration/SolidSyslogMbedTlsStreamIntegrationTest.cpp +++ b/Tests/MbedTlsIntegration/SolidSyslogMbedTlsStreamIntegrationTest.cpp @@ -54,7 +54,7 @@ TEST_GROUP(SolidSyslogMbedTlsStreamIntegration) * tests use an in-memory BIO pair that never blocks; our socketpair * harness inherently can deadlock on negative-path handshakes (one * side waits for a message the other won't send). The cap matches - * the production handshake retry budget — generous for any real + * the production handshake retry budget - generous for any real * handshake (sub-second), tight enough that a stuck test fails fast. */ struct timeval rcvTimeout = {5, 0}; setsockopt(fds[0], SOL_SOCKET, SO_RCVTIMEO, &rcvTimeout, sizeof(rcvTimeout)); @@ -238,7 +238,7 @@ TEST(SolidSyslogMbedTlsStreamIntegration, MutualTlsHandshakeRejectedWhenClientSe { /* Server requires a client cert but the integrator hasn't opted in to - * mTLS — ClientCertChain / ClientKey are NULL. Server-side verify must + * mTLS - ClientCertChain / ClientKey are NULL. Server-side verify must * fail and the client's Open must return false. */ struct MbedTlsTestCert clientCa = {}; struct MbedTlsTestCertConfig clientCaConfig = {}; @@ -274,7 +274,7 @@ TEST(SolidSyslogMbedTlsStreamIntegration, MutualTlsHandshakeRejectedWhenClientCe untrustedConfig.IsCa = 1; MbedTlsTestCert_Create(&untrustedConfig, &untrustedClientCa, &rng); - /* Client cert is signed by the *untrusted* CA — server only trusts + /* Client cert is signed by the *untrusted* CA - server only trusts * trustedClientCa, so verify will reject this chain. */ struct MbedTlsTestCert clientCert = {}; CreateClientIdentitySignedBy(&untrustedClientCa, &clientCert); @@ -298,7 +298,7 @@ TEST(SolidSyslogMbedTlsStreamIntegration, BinaryLinksAgainstRealLibMbedTls) { /* mbedtls_version_get_number() is a constant, side-effect-free symbol - * present in every mbedTLS build — a successful link plus a return + * present in every mbedTLS build - a successful link plus a return * value matching the expected major version (3.x) confirms the * integration scaffold pulls in the real library, not a fake. */ const unsigned int major = (mbedtls_version_get_number() >> 24) & 0xFFU; diff --git a/Tests/MqFakeTest.cpp b/Tests/MqFakeTest.cpp index bd53fed6..caca48d8 100644 --- a/Tests/MqFakeTest.cpp +++ b/Tests/MqFakeTest.cpp @@ -106,7 +106,7 @@ TEST(MqFake, FailNextSendReturnsMinusOneAndSetsErrno) LONGS_EQUAL(EMSGSIZE, errno); } -/* Natural overflow — sending past mq_attr.mq_maxmsg must surface as +/* Natural overflow - sending past mq_attr.mq_maxmsg must surface as * -1/EAGAIN per POSIX, not silently succeed. */ TEST(MqFake, SendBeyondMaxMessagesReturnsMinusOneEagain) { @@ -118,7 +118,7 @@ TEST(MqFake, SendBeyondMaxMessagesReturnsMinusOneEagain) LONGS_EQUAL(EAGAIN, errno); } -/* Natural oversize — POSIX requires -1/EMSGSIZE, not truncation. */ +/* Natural oversize - POSIX requires -1/EMSGSIZE, not truncation. */ TEST(MqFake, SendLargerThanMaxMessageSizeReturnsMinusOneEmsgsize) { mqd_t mqd = OpenTestQueue("/test", /*maxMessages=*/4, /*maxMessageSize=*/4); diff --git a/Tests/OpenSslFakeTest.cpp b/Tests/OpenSslFakeTest.cpp index ca1e85dd..9ccf6455 100644 --- a/Tests/OpenSslFakeTest.cpp +++ b/Tests/OpenSslFakeTest.cpp @@ -324,7 +324,7 @@ TEST(OpenSslFake, CtxFreeIncrementsCount) } /* ------------------------------------------------------------------------- - * Arg captures — prove each fake function records the args its callers pass. + * Arg captures - prove each fake function records the args its callers pass. * ------------------------------------------------------------------------- */ TEST(OpenSslFake, CtxNewCapturesMethodArg) @@ -450,7 +450,7 @@ TEST(OpenSslFake, CtxFreeCapturesCtxArg) } /* ------------------------------------------------------------------------- - * Failure-mode switches — tests opt into failure returns via SetXxxFails. + * Failure-mode switches - tests opt into failure returns via SetXxxFails. * ------------------------------------------------------------------------- */ TEST(OpenSslFake, SetConnectFailsMakesConnectReturnNegative) diff --git a/Tests/OpenSslIntegration/SolidSyslogOpenSslStreamIntegrationTest.cpp b/Tests/OpenSslIntegration/SolidSyslogOpenSslStreamIntegrationTest.cpp index 02d1dc47..e8ebe1bf 100644 --- a/Tests/OpenSslIntegration/SolidSyslogOpenSslStreamIntegrationTest.cpp +++ b/Tests/OpenSslIntegration/SolidSyslogOpenSslStreamIntegrationTest.cpp @@ -15,7 +15,7 @@ #include "TlsTestServer.h" #include "CppUTest/TestHarness.h" -/* BioPairStream pumps synchronously — SSL_connect completes in one call so +/* BioPairStream pumps synchronously - SSL_connect completes in one call so * the handshake retry loop never sleeps. Provide a NoOp to satisfy the * required config field without taking a platform dependency on the * integration tests (these run on both POSIX and Windows). */ @@ -193,7 +193,7 @@ TEST(OpenSslStreamIntegration, HandshakeRejectedWhenCipherListIsUnsupported) } /* ------------------------------------------------------------------------- - * Mutual TLS — client cert + private key (S03.09). + * Mutual TLS - client cert + private key (S03.09). * ------------------------------------------------------------------------- */ TEST(OpenSslStreamIntegration, MutualTlsHandshakeSucceedsWithClientCertSignedByTrustedCa) @@ -255,7 +255,7 @@ TEST(OpenSslStreamIntegration, MutualTlsHandshakeRejectedWhenClientCertSignedByU createClientCa(); /* Client cert is signed by a throwaway CA that the server never learns - * about — the server's trust store only has `clientCa`. */ + * about - the server's trust store only has `clientCa`. */ struct TlsTestCertConfig untrustedCaConfig = {}; untrustedCaConfig.commonName = "Untrusted Client CA"; struct TlsTestCert untrustedCa = {}; diff --git a/Tests/OpenSslIntegration/TlsTestCert.c b/Tests/OpenSslIntegration/TlsTestCert.c index d7bb53e1..561f2ad5 100644 --- a/Tests/OpenSslIntegration/TlsTestCert.c +++ b/Tests/OpenSslIntegration/TlsTestCert.c @@ -116,7 +116,7 @@ static void AddSubjectAltNames(X509* cert, const char* const * dnsNames) } /* OpenSSL 3 chain validation requires issuer certs to carry - * basicConstraints=CA:TRUE. All test certs get it — it's harmless on leaves + * basicConstraints=CA:TRUE. All test certs get it - it's harmless on leaves * for our purposes and lets any generated cert act as an issuer if needed. */ static void AddBasicConstraintsCa(X509* cert) { diff --git a/Tests/OpenSslIntegration/TlsTestServer.c b/Tests/OpenSslIntegration/TlsTestServer.c index 94ce04f1..97e19e0c 100644 --- a/Tests/OpenSslIntegration/TlsTestServer.c +++ b/Tests/OpenSslIntegration/TlsTestServer.c @@ -34,7 +34,7 @@ struct TlsTestServer* TlsTestServer_Create(const struct TlsTestServerConfig* con X509_STORE* store = SSL_CTX_get_cert_store(self->Ctx); X509_STORE_add_cert(store, config->ClientCaCert->cert); SSL_CTX_set_verify(self->Ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); - /* Pin TLS 1.2 for mTLS tests — in TLS 1.3 the client's SSL_connect + /* Pin TLS 1.2 for mTLS tests - in TLS 1.3 the client's SSL_connect * can return before the server's verify completes, so a cert rejection * on the server shows up on the client only on the next read. * TLS 1.2 keeps rejection synchronous within the handshake. */ diff --git a/Tests/SolidSyslogBlockSequenceTest.cpp b/Tests/SolidSyslogBlockSequenceTest.cpp index 908f66da..31dccfc2 100644 --- a/Tests/SolidSyslogBlockSequenceTest.cpp +++ b/Tests/SolidSyslogBlockSequenceTest.cpp @@ -32,8 +32,8 @@ struct ScanFake { struct SolidSyslogBlockDevice Base; std::set* existing; - std::vector* calls; /* optional — tests that don't care leave nullptr */ - std::map* sizes; /* optional — tests that need realistic Size readings populate */ + std::vector* calls; /* optional - tests that don't care leave nullptr */ + std::map* sizes; /* optional - tests that need realistic Size readings populate */ bool failNextDispose; }; @@ -255,7 +255,7 @@ TEST_GROUP(BlockSequenceRotation) sequence = SolidSyslogBlockSequence_Create(&config); SolidSyslogBlockSequence_Open(sequence); /* cold start: Acquire(0) */ - /* Simulate one record's worth of data in block 0 — production rotation + /* Simulate one record's worth of data in block 0 - production rotation * never seals an empty block, and the dispose-on-empty trigger uses * device.Size to decide drained-ness. */ SolidSyslogBlockSequence_NoteRecordWritten(sequence, SIMULATED_RECORD_SIZE); @@ -319,7 +319,7 @@ TEST(BlockSequenceRotation, RotationSkipsDisposeWhenTargetBlockEmpty) TEST(BlockSequenceRotation, RotationFailsWhenStaleBlockDisposeFails) { - /* If the stale block can't be Disposed, we must NOT proceed to Acquire — + /* If the stale block can't be Disposed, we must NOT proceed to Acquire - * a flash "verify-and-use" driver would reject the stale block anyway, * and surfacing the failure here matches the slice-3 retry contract. */ existing.insert(1); diff --git a/Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp b/Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp index fb6c6fde..0ded0900 100644 --- a/Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp +++ b/Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp @@ -2,7 +2,7 @@ * RecordStore + FileBlockDevice stack, with FileFake at the bottom. * * Motivated by S08.05's discard-newest BDD failure on freertos-cross - * (#270): oracle received sequenceIds [1, 11, 2, 3, 4, 5, 6] — sequence + * (#270): oracle received sequenceIds [1, 11, 2, 3, 4, 5, 6] - sequence * id 11 (the newest, which discard-newest should drop) appearing * mid-drain between 1 and 2 says the drain ordering is wrong, not the * record-packing math. This harness reproduces drain sequences host-side @@ -10,8 +10,8 @@ * (maxBlocks / maxBlockSize / payload) without round-tripping QEMU. * * Tests drive the SolidSyslogStore interface (Write / HasUnsent / - * ReadNextUnsent / MarkSent) directly — no Service task, no Sender, no - * Buffer — because the drain order lives in BlockSequence/RecordStore. */ + * ReadNextUnsent / MarkSent) directly - no Service task, no Sender, no + * Buffer - because the drain order lives in BlockSequence/RecordStore. */ #include "CppUTest/TestHarness.h" @@ -41,10 +41,10 @@ extern "C" static const char* const TEST_PATH_PREFIX = "/tmp/draintest_"; -/* SenderSpy — sticky outage mode (every Send returns false until cleared) +/* SenderSpy - sticky outage mode (every Send returns false until cleared) * and a vector of every *successful* send. Bigger than SenderFake's * last-only capture and one-shot FailNextSend; the BDD reproducer needs - * to see the full successful-send sequence to spot the [1, 11, 2, ...] + * to see the full successful-send sequence to spot the [1, 11, 2...] * interleave. */ struct SenderSpy { @@ -103,7 +103,7 @@ struct DrainTestConfig /* Shared block-device / null-security-policy fixture (the underlying FileFake is * an implementation detail of the BlockDevice). Lifted out of - * the two TEST_GROUPs below so each can focus on its own moving parts — + * the two TEST_GROUPs below so each can focus on its own moving parts - * BlockStoreDrainOrdering adds a BlockStore directly; ServiceDrainInterleave * adds Buffer + Mutex + SenderSpy + the SolidSyslog facade. Matches the * established TEST_BASE / TEST_GROUP_BASE pattern from @@ -125,7 +125,7 @@ TEST_BASE(DrainTestFixtureBase) /* Block size is a property of the device; re-point it (pool size 1, so * destroy-then-recreate on the same FileFake) at the scenario's size. - * Idempotent — unchanged size reuses the existing device. */ + * Idempotent - unchanged size reuses the existing device. */ void ensureDeviceBlockSize(size_t blockSize) { if (SolidSyslogBlockDevice_GetBlockSize(device) != blockSize) @@ -215,10 +215,10 @@ TEST_GROUP_BASE(BlockStoreDrainOrdering, DrainTestFixtureBase) // clang-format on -/* Service-level reproducer — wires the real Buffer drain logic from +/* Service-level reproducer - wires the real Buffer drain logic from * SolidSyslog_Service against a real BlockStore and a SenderSpy that * simulates oracle outage / recovery. This is the harness where the - * [1, 11, 2, 3, ...] BDD shape actually arises — DrainBufferIntoStore + * [1, 11, 2, 3...] BDD shape actually arises - DrainBufferIntoStore * falls back to Sender_Send when Store_Write rejects (NullStore path), * which on a full BlockStore in discard-newest mode lets the *latest* * buffered message bypass *older* stored messages once the oracle @@ -226,7 +226,7 @@ TEST_GROUP_BASE(BlockStoreDrainOrdering, DrainTestFixtureBase) // clang-format off TEST_GROUP_BASE(ServiceDrainInterleave, DrainTestFixtureBase) { - /* Sized to hold 16 max-sized messages — plenty for the outage + /* Sized to hold 16 max-sized messages - plenty for the outage * reproducer; CircularBuffer is FIFO so all messages are retained * until Service drains them (unlike BufferFake which only keeps * the last one). */ @@ -277,7 +277,7 @@ TEST_GROUP_BASE(ServiceDrainInterleave, DrainTestFixtureBase) } /* Push one record into the buffer with sequenceId encoded in the first - * 4 bytes — bypasses SolidSyslog_Log so we control exact bytes and + * 4 bytes - bypasses SolidSyslog_Log so we control exact bytes and * don't pull in clock / hostname / SD plumbing. */ // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) -- sequenceId and payloadSize are distinct concepts; both numeric is incidental void Enqueue(uint32_t sequenceId, size_t payloadSize) const @@ -307,7 +307,7 @@ TEST(ServiceDrainInterleave, DiscardNewestDoesNotLetNewestBypassOldestOnRecovery * maxBlockSize bottoms out at ~MAX+overhead and each block holds * exactly one record. MAX-relative keeps the test portable across * SOLIDSYSLOG_MAX_MESSAGE_SIZE tunable overrides. With maxBlocks=2 - * the store fits 2 records — small enough for the outage to overflow + * the store fits 2 records - small enough for the outage to overflow * with just a couple of messages. */ DrainTestConfig cfg = { /*maxBlocks=*/2, @@ -330,7 +330,7 @@ TEST(ServiceDrainInterleave, DiscardNewestDoesNotLetNewestBypassOldestOnRecovery Enqueue(3, cfg.PayloadSize); SolidSyslog_Service(solidSyslog); - /* Message 11 arrives still in outage — it lands in the buffer but + /* Message 11 arrives still in outage - it lands in the buffer but * hasn't been pulled by Service yet at the moment the oracle resumes. */ Enqueue(11, cfg.PayloadSize); @@ -350,7 +350,7 @@ TEST(ServiceDrainInterleave, DiscardNewestDoesNotLetNewestBypassOldestOnRecovery /* Structural assertion: successful sends must be in non-descending * order. ANY descent (e.g. 11 followed by 2) means a newer message - * jumped ahead of older ones — exactly the bug the BDD scenario + * jumped ahead of older ones - exactly the bug the BDD scenario * pins. */ for (size_t i = 1; i < ids.size(); ++i) { @@ -374,11 +374,11 @@ TEST(ServiceDrainInterleave, DiscardNewestDoesNotLetNewestBypassOldestOnRecovery /* Reproducer for the BDD discard-newest failure shape. With max-blocks=2 * and a small max-block-size relative to the payload, an "outage" of 10 - * messages should produce *some* drain order — what matters is that the + * messages should produce *some* drain order - what matters is that the * ids drained are strictly ascending (oldest-first), regardless of which * ones got discarded by the policy. * - * BDD on freertos-cross saw [1, 11, 2, 3, 4, 5, 6] — sequenceId 11 + * BDD on freertos-cross saw [1, 11, 2, 3, 4, 5, 6] - sequenceId 11 * interleaved between 1 and 2, which is structurally impossible for a * correct oldest-first drain. If this test reproduces that interleave, * we have the bug in our hands. */ @@ -388,7 +388,7 @@ TEST(BlockStoreDrainOrdering, OutageDrainProducesAscendingSequenceIds) {/*maxBlocks=*/2, /*maxBlockSize=*/200, /*payloadSize=*/64, SOLIDSYSLOG_DISCARD_POLICY_NEWEST}; CreateStore(cfg); - /* Pre-outage send + drain — mirrors `When the client sends a message` + /* Pre-outage send + drain - mirrors `When the client sends a message` * + `Then the syslog oracle receives 1 message` in the BDD scenario. */ CHECK_TRUE(WriteMessage(1, cfg.PayloadSize)); LONGS_EQUAL(1U, DrainOne()); diff --git a/Tests/SolidSyslogBlockStorePosixTest.cpp b/Tests/SolidSyslogBlockStorePosixTest.cpp index 7980a5f7..3f4f77c3 100644 --- a/Tests/SolidSyslogBlockStorePosixTest.cpp +++ b/Tests/SolidSyslogBlockStorePosixTest.cpp @@ -28,7 +28,7 @@ static void CleanStoreFiles() } /* Integration tests using real POSIX files instead of FileFake. - * These catch issues that only surface with real file handles — + * These catch issues that only surface with real file handles - * e.g. reading from a deleted file, handle reuse after close, * or cursor state surviving across rotate/discard cycles. */ @@ -88,13 +88,13 @@ TEST(SolidSyslogBlockStorePosix, DiscardOldestDrainYieldsOnlySurvivingRecords) char firstMsg[SOLIDSYSLOG_MAX_MESSAGE_SIZE]; std::memset(firstMsg, 'B', sizeof(firstMsg)); - SolidSyslogStore_Write(store, firstMsg, sizeof(firstMsg)); /* block 00 — will be discarded */ + SolidSyslogStore_Write(store, firstMsg, sizeof(firstMsg)); /* block 00 - will be discarded */ char secondMsg[SOLIDSYSLOG_MAX_MESSAGE_SIZE]; std::memset(secondMsg, 'C', sizeof(secondMsg)); - SolidSyslogStore_Write(store, secondMsg, sizeof(secondMsg)); /* block 01 — survives */ + SolidSyslogStore_Write(store, secondMsg, sizeof(secondMsg)); /* block 01 - survives */ - WriteMaxMsg(); /* block 02 — triggers discard of block 00 */ + WriteMaxMsg(); /* block 02 - triggers discard of block 00 */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; @@ -133,14 +133,14 @@ TEST(SolidSyslogBlockStorePosix, DiscardOldestWhenReadIsPartwayThroughOldestBloc SolidSyslogStore_Write(store, msgC, sizeof(msgC)); SolidSyslogStore_Write(store, msgD, sizeof(msgD)); - /* Read and send first record from block 00 — read cursor is now partway through */ + /* Read and send first record from block 00 - read cursor is now partway through */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; CHECK_TRUE(SolidSyslogStore_ReadNextUnsent(store, buf, sizeof(buf), &bytesRead)); BYTES_EQUAL('A', buf[0]); SolidSyslogStore_MarkSent(store); - /* Write one more — triggers rotation to block 02 and discard of block 00 */ + /* Write one more - triggers rotation to block 02 and discard of block 00 */ WriteMaxMsg(); /* Record B is lost (discarded with block 00); drain yields C, D from block 01, then maxMsg from block 02 */ diff --git a/Tests/SolidSyslogBlockStoreTest.cpp b/Tests/SolidSyslogBlockStoreTest.cpp index 0ee13c14..10e94dc8 100644 --- a/Tests/SolidSyslogBlockStoreTest.cpp +++ b/Tests/SolidSyslogBlockStoreTest.cpp @@ -33,7 +33,7 @@ enum * MAGIC_SIZE(2) + RECORD_LENGTH_SIZE(2) + SENT_FLAG_SIZE(1). */ TEST_RECORD_OVERHEAD = 5, TEST_RECORDS_PER_BLOCK = 2, - /* Sized to fit TEST_RECORDS_PER_BLOCK worst-case records — the worst + /* Sized to fit TEST_RECORDS_PER_BLOCK worst-case records - the worst * case being max-size data plus max-integrity bytes. Auto-adapts * when SOLIDSYSLOG_MAX_MESSAGE_SIZE or the integrity policy bound * are tuned. */ @@ -61,7 +61,7 @@ static struct SolidSyslogBlockStoreConfig MakeConfig(struct SolidSyslogBlockDevi return config; } -/* Shared fixture — every BlockStore test group needs one FileFake backing the +/* Shared fixture - every BlockStore test group needs one FileFake backing the * BlockDevice, the BlockDevice itself, and a teardown that closes them in the * right order. TEST_BASE / TEST_GROUP_BASE lifts that boilerplate out of every * group. Test bodies still reference `file`, `device` directly because they @@ -570,7 +570,7 @@ TEST(SolidSyslogBlockStoreConfig, FilenameExactlyAtMaxPath) TEST(SolidSyslogBlockStoreConfig, FilenameTruncatedWhenPrefixTooLong) { /* SOLIDSYSLOG_MAX_PATH_SIZE=128. A 127-char prefix leaves 1 byte for digits and - suffix. FormatFilename must not write past the buffer — prior to + suffix. FormatFilename must not write past the buffer - prior to the fix, SolidSyslogFormat_Character wrote 2 bytes unconditionally (char + null), overflowing filename[128]. ASan detects this. */ char prefix[128]; @@ -639,7 +639,7 @@ TEST(SolidSyslogBlockStoreErrors, OpenFailureStillReturnsNonNull) TEST(SolidSyslogBlockStoreErrors, TransientOpenFailureRecoversOnNextWrite) { - /* BlockDevice opens lazily — a one-shot Open failure during Create heals + /* BlockDevice opens lazily - a one-shot Open failure during Create heals * on the next operation that needs the file. */ struct SolidSyslogBlockStoreConfig config = MakeConfig(device); FileFake_FailNextOpen(file); @@ -813,8 +813,8 @@ TEST(SolidSyslogBlockStoreRotation, DiscardOldestDeletesOldestBlockWhenAtMaxBloc { CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ - WriteMaxMsg(); /* block 02 — must discard 00 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ + WriteMaxMsg(); /* block 02 - must discard 00 */ CHECK_FALSE(SolidSyslogFile_Exists(file, "/tmp/test_store00.log")); CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store02.log")); @@ -832,7 +832,7 @@ TEST(SolidSyslogBlockStoreRotation, DiscardOldestSurvivingDataIsReadable) memset(secondMsg, 'C', sizeof(secondMsg)); SolidSyslogStore_Write(store, secondMsg, sizeof(secondMsg)); /* block 01 */ - WriteMaxMsg(); /* block 02 — discards 00 */ + WriteMaxMsg(); /* block 02 - discards 00 */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; @@ -848,13 +848,13 @@ TEST(SolidSyslogBlockStoreRotation, DiscardOldestDrainYieldsOnlySurvivingRecords char firstMsg[SOLIDSYSLOG_MAX_MESSAGE_SIZE]; memset(firstMsg, 'B', sizeof(firstMsg)); - SolidSyslogStore_Write(store, firstMsg, sizeof(firstMsg)); /* block 00 — will be discarded */ + SolidSyslogStore_Write(store, firstMsg, sizeof(firstMsg)); /* block 00 - will be discarded */ char secondMsg[SOLIDSYSLOG_MAX_MESSAGE_SIZE]; memset(secondMsg, 'C', sizeof(secondMsg)); - SolidSyslogStore_Write(store, secondMsg, sizeof(secondMsg)); /* block 01 — survives */ + SolidSyslogStore_Write(store, secondMsg, sizeof(secondMsg)); /* block 01 - survives */ - WriteMaxMsg(); /* block 02 — triggers discard of block 00 */ + WriteMaxMsg(); /* block 02 - triggers discard of block 00 */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; @@ -877,7 +877,7 @@ TEST(SolidSyslogBlockStoreRotation, DiscardNewestReturnsFalseWhenAtMaxBlocks) { CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD, SOLIDSYSLOG_DISCARD_POLICY_NEWEST); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); } @@ -896,7 +896,7 @@ TEST(SolidSyslogBlockStoreRotation, HaltInvokesCallbackWhenStoreFull) CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD, SOLIDSYSLOG_DISCARD_POLICY_HALT, 2, StoreFullCallback); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); CALLED_FUNCTION(StoreFullCallback, ONCE); @@ -907,7 +907,7 @@ TEST(SolidSyslogBlockStoreRotation, HaltWithNullCallbackDoesNotCrash) CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD, SOLIDSYSLOG_DISCARD_POLICY_HALT); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); } @@ -917,7 +917,7 @@ TEST(SolidSyslogBlockStoreRotation, HaltSetsIsHaltedTrue) CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD, SOLIDSYSLOG_DISCARD_POLICY_HALT); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ CHECK_FALSE(SolidSyslogStore_IsHalted(store)); SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* triggers halt */ @@ -930,7 +930,7 @@ TEST(SolidSyslogBlockStoreRotation, DiscardNewestDoesNotInvokeCallback) CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD, SOLIDSYSLOG_DISCARD_POLICY_NEWEST, 2, StoreFullCallback); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); CALLED_FUNCTION(StoreFullCallback, NEVER); @@ -950,9 +950,9 @@ TEST(SolidSyslogBlockStoreRotation, HaltOnStoreFullFiresOncePerRisingEdge) CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD, SOLIDSYSLOG_DISCARD_POLICY_HALT, 2, CountStoreFullInvocations); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — now at maxBlocks=2 */ + WriteMaxMsg(); /* block 01 - now at maxBlocks=2 */ - /* Three consecutive failed Writes — callback must fire on the first only. */ + /* Three consecutive failed Writes - callback must fire on the first only. */ CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); @@ -984,7 +984,7 @@ TEST(SolidSyslogBlockStoreRotation, OnStoreFullReceivesConfiguredContext) ); WriteMaxMsg(); /* block 00 */ - WriteMaxMsg(); /* block 01 — at maxBlocks */ + WriteMaxMsg(); /* block 01 - at maxBlocks */ SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* triggers halt callback */ @@ -1010,7 +1010,7 @@ TEST(SolidSyslogBlockStoreRotation, ResumeDrainsAcrossBlocksInOrder) memset(firstMsg, 'B', sizeof(firstMsg)); SolidSyslogStore_Write(store, firstMsg, sizeof(firstMsg)); /* block 00 */ - WriteMaxMsg(); /* block 01 — 'A' */ + WriteMaxMsg(); /* block 01 - 'A' */ SolidSyslogBlockStore_Destroy(store); CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD); @@ -1056,7 +1056,7 @@ TEST(SolidSyslogBlockStoreRotation, ResumeWithMultipleBlocksCanWriteNewMessage) memset(newMsg, 'N', sizeof(newMsg)); CHECK_TRUE(SolidSyslogStore_Write(store, newMsg, sizeof(newMsg))); - /* Should have rotated to block 02 — block 01 was full */ + /* Should have rotated to block 02 - block 01 was full */ CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store02.log")); } @@ -1066,8 +1066,8 @@ TEST(SolidSyslogBlockStoreRotation, ResumeWriteAppendsToPartiallyFilledWriteBloc CreateWithMaxBlockSize(TWO_MAX_MSG_RECORDS); WriteMaxMsg(); /* block 00, record 1 */ - WriteMaxMsg(); /* block 00, record 2 — block 00 full */ - WriteMaxMsg(); /* block 01, record 1 — block 01 partially filled */ + WriteMaxMsg(); /* block 00, record 2 - block 00 full */ + WriteMaxMsg(); /* block 01, record 1 - block 01 partially filled */ SolidSyslogBlockStore_Destroy(store); CreateWithMaxBlockSize(TWO_MAX_MSG_RECORDS); @@ -1140,7 +1140,7 @@ TEST(SolidSyslogBlockStoreRotation, WriteAfterDrainRotatesToNextBlock) CHECK_FALSE(SolidSyslogStore_HasUnsent(store)); - /* Drained block still occupies space — next write rotates */ + /* Drained block still occupies space - next write rotates */ WriteMaxMsg(); CHECK_TRUE(SolidSyslogStore_HasUnsent(store)); CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store01.log")); @@ -1154,9 +1154,9 @@ TEST(SolidSyslogBlockStoreRotation, MixedMessageSizesDrainCorrectlyAcrossBlocks) char shortMsg[SHORT_LEN]; memset(shortMsg, 'S', SHORT_LEN); - SolidSyslogStore_Write(store, shortMsg, SHORT_LEN); /* block 00 — small record */ + SolidSyslogStore_Write(store, shortMsg, SHORT_LEN); /* block 00 - small record */ - WriteMaxMsg(); /* block 01 — max record */ + WriteMaxMsg(); /* block 01 - max record */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; @@ -1179,7 +1179,7 @@ TEST(SolidSyslogBlockStoreRotation, ContinuousDiscardWithoutReadingSurvivorsCorr { CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD); - /* Write 5 messages across 5 blocks — maxBlocks=2 means 3 are discarded */ + /* Write 5 messages across 5 blocks - maxBlocks=2 means 3 are discarded */ char msgs[5][SOLIDSYSLOG_MAX_MESSAGE_SIZE]; // NOLINTBEGIN(cppcoreguidelines-pro-bounds-constant-array-index) -- loop index is bounded by literal 5 for (int i = 0; i < 5; i++) @@ -1196,7 +1196,7 @@ TEST(SolidSyslogBlockStoreRotation, ContinuousDiscardWithoutReadingSurvivorsCorr CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store03.log")); CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store04.log")); - /* Drain — should get msg3 ('D') then msg4 ('E') */ + /* Drain - should get msg3 ('D') then msg4 ('E') */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; @@ -1227,12 +1227,12 @@ TEST(SolidSyslogBlockStoreRotation, MaxBlocksAtUpperLimit) WriteMaxMsg(); } - /* All 99 blocks should exist (00–98) */ + /* All 99 blocks should exist (00-98) */ CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store00.log")); CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store98.log")); CHECK_FALSE(SolidSyslogFile_Exists(file, "/tmp/test_store99.log")); - /* One more write — should discard block 00 and create block 99 */ + /* One more write - should discard block 00 and create block 99 */ WriteMaxMsg(); CHECK_FALSE(SolidSyslogFile_Exists(file, "/tmp/test_store00.log")); @@ -1253,7 +1253,7 @@ TEST(SolidSyslogBlockStoreRotation, MultipleRecordsPerBlockDrainAcrossRotation) memset(msg1, 'Y', sizeof(msg1)); SolidSyslogStore_Write(store, msg1, sizeof(msg1)); /* block 00, record 2 */ - WriteMaxMsg(); /* block 01, record 1 — 'A' */ + WriteMaxMsg(); /* block 01, record 1 - 'A' */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE] = {}; size_t bytesRead = 0; @@ -1292,7 +1292,7 @@ TEST(SolidSyslogBlockStoreRotation, MarkSentDisposesOlderBlockWhenDrained) TEST(SolidSyslogBlockStoreRotation, MarkSentDoesNotDisposeActiveWriteBlock) { CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD); - WriteMaxMsg(); /* block 00 — also the active write block */ + WriteMaxMsg(); /* block 00 - also the active write block */ char buf[SOLIDSYSLOG_MAX_MESSAGE_SIZE]; size_t bytesRead = 0; @@ -1307,7 +1307,7 @@ TEST(SolidSyslogBlockStoreRotation, RotationDisposesPriorBlockWhenAlreadyDrained /* Interleaved drain pattern: MarkSent fires for the only record in block 00 * while it is still the active write block, so dispose-on-empty cannot fire * yet. The trigger must re-evaluate after the next Write rotates writeSequence - * to 01 — otherwise the just-filled-and-drained block lingers until capacity + * to 01 - otherwise the just-filled-and-drained block lingers until capacity * pressure forces discard. This pattern is what the threaded service thread * does in practice. */ CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD); @@ -1340,7 +1340,7 @@ TEST(SolidSyslogBlockStoreRotation, RotationRetriesAfterTransientAcquireFailure) WriteMaxMsg(); /* block 00 */ FileFake_FailNextOpen(file); - CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); /* fails — Acquire on block 01 rejected */ + CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); /* fails - Acquire on block 01 rejected */ CHECK_TRUE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); /* retry succeeds */ CHECK_TRUE(SolidSyslogFile_Exists(file, "/tmp/test_store01.log")); @@ -1351,7 +1351,7 @@ TEST(SolidSyslogBlockStoreRotation, DiscardRetriesAfterTransientDisposeFailure) /* Without this guarantee the oldest pointer would advance past a still-on-disk * block, leaving it orphaned forever. Force a Dispose failure on the discard * during block-02 rotation, then trigger another rotation: the next discard - * cycle must re-attempt block 00 — not skip past it to block 01. Both Writes + * cycle must re-attempt block 00 - not skip past it to block 01. Both Writes * succeed (rotation acquires the new block; only the discard silently fails). */ CreateWithMaxBlockSize(ONE_MAX_MSG_RECORD); WriteMaxMsg(); /* block 00 */ @@ -1359,9 +1359,9 @@ TEST(SolidSyslogBlockStoreRotation, DiscardRetriesAfterTransientDisposeFailure) FileFake_FailNextDelete(file); CHECK_TRUE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)) - ); /* block 02 — discard of 00 fails; oldest must stay at 0 */ + ); /* block 02 - discard of 00 fails; oldest must stay at 0 */ CHECK_TRUE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)) - ); /* block 03 — next discard cycle re-attempts and removes 00 */ + ); /* block 03 - next discard cycle re-attempts and removes 00 */ CHECK_FALSE(SolidSyslogFile_Exists(file, "/tmp/test_store00.log")); } @@ -1626,7 +1626,7 @@ TEST(SolidSyslogBlockStoreCorruption, IntegrityFailureReadReturnsFalse) TEST(SolidSyslogBlockStoreCorruption, InvalidLengthReadReturnsFalse) { /* Write many records to make the file large enough that a bogus length - * doesn't hit EOF — the length check must reject it explicitly */ + * doesn't hit EOF - the length check must reject it explicitly */ struct SolidSyslogBlockStoreConfig config = MakeConfig(device); store = SolidSyslogBlockStore_Create(&config); @@ -1724,19 +1724,19 @@ TEST(SolidSyslogBlockStoreCorruptionRecovery, ReadSkipsCorruptOlderBlockToNextBl TEST(SolidSyslogBlockStoreCorruptionRecovery, CorruptWriteBlockRotatesOnNextWrite) { - /* Use a block size that fits two records — the first write leaves space, + /* Use a block size that fits two records - the first write leaves space, * so rotation on the second write proves corruption forced it */ static const size_t TWO_MAX_MSG_RECORDS = 2 * ONE_MAX_MSG_RECORD; CreateWithMaxBlockSize(TWO_MAX_MSG_RECORDS); - WriteMaxMsg(); /* block 00 — partially filled */ + WriteMaxMsg(); /* block 00 - partially filled */ SolidSyslogBlockStore_Destroy(store); CorruptFirstRecordBody("/tmp/test_store00.log"); CreateWithMaxBlockSize(TWO_MAX_MSG_RECORDS); - /* Block 00 has space but is corrupt — write should rotate to block 01 */ + /* Block 00 has space but is corrupt - write should rotate to block 01 */ char newMsg[SOLIDSYSLOG_MAX_MESSAGE_SIZE]; memset(newMsg, 'N', sizeof(newMsg)); CHECK_TRUE(SolidSyslogStore_Write(store, newMsg, sizeof(newMsg))); @@ -1788,7 +1788,7 @@ TEST_GROUP_BASE(SolidSyslogBlockStoreCapacity, BlockDeviceTestBase) // clang-format on -/* Given maxBlocks × maxBlockSize configured, +/* Given maxBlocks x maxBlockSize configured, * When GetTotalBytes is queried, * Then it returns the product. */ TEST(SolidSyslogBlockStoreCapacity, GetTotalBytesReturnsMaxBlocksTimesMaxBlockSize) @@ -1868,7 +1868,7 @@ TEST(SolidSyslogBlockStoreCapacity, GetUsedBytesIsStickyAtTotalAfterSizeFailure) WriteMaxMsg(); /* block 0: SLACK bytes slack */ WriteMaxMsg(); /* block 1: SLACK bytes slack, at maxBlocks */ - /* The next write needs to rotate but can't (HALT, at maxBlocks) — fails for size. */ + /* The next write needs to rotate but can't (HALT, at maxBlocks) - fails for size. */ CHECK_FALSE(SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg))); /* Sticky: GetUsedBytes returns total even though the active blocks have slack. */ @@ -1966,9 +1966,9 @@ TEST(SolidSyslogBlockStoreCapacityThreshold, ReArmsAfterFallingEdgeOnDiscardOlde SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* block 0: 1 record */ SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* block 0: 2 records (full) */ SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* rotate; block 1: 1 record (3 total) */ - SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* block 1: 2 records (4 total) — fires */ - SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* rotate+discard block 0 → 3 records (below) */ - SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* block 2: 2 records (4 total) — fires again */ + SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* block 1: 2 records (4 total) - fires */ + SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* rotate+discard block 0 -> 3 records (below) */ + SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* block 2: 2 records (4 total) - fires again */ CALLED_FUNCTION(CountThresholdCrossings, TWICE); } @@ -2107,9 +2107,9 @@ TEST(SolidSyslogBlockStoreCapacityThreshold, StickyHundredPercentDoesNotRefireTh SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fills block 0 partially */ SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fills block 1 partially */ - SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fails, sticky engages — fires once */ - SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fails again — must not refire */ - SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fails again — must not refire */ + SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fails, sticky engages - fires once */ + SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fails again - must not refire */ + SolidSyslogStore_Write(store, maxMsg, sizeof(maxMsg)); /* fails again - must not refire */ CALLED_FUNCTION(CountThresholdCrossings, ONCE); } @@ -2144,14 +2144,14 @@ TEST(SolidSyslogBlockStoreCapacityThreshold, FiresOnCreateWhenResumedUsageAboveT SolidSyslogBlockStore_Destroy(preStore); } - /* setup() reset CountThresholdCrossingsCallCount to 0 — any fire here is from this Create. */ + /* setup() reset CountThresholdCrossingsCallCount to 0 - any fire here is from this Create. */ CreateWithThreshold(TEST_DATA_LEN); CALLED_FUNCTION(CountThresholdCrossings, ONCE); } /* ------------------------------------------------------------------ - * Pool — prove SOLIDSYSLOG_BLOCK_STORE_POOL_SIZE caps live instances + * Pool - prove SOLIDSYSLOG_BLOCK_STORE_POOL_SIZE caps live instances * and overflow resolves to the shared SolidSyslogNullStore. Generic * pool mechanics (per-probe lock, stale-handle warning) are covered * by SolidSyslogPoolAllocatorTest.cpp. @@ -2217,7 +2217,7 @@ TEST(SolidSyslogBlockStorePool, FillingPoolThenOverflowResolvesToNullStore) overflow = MakeStore(); - /* Overflow resolves to the shared NullStore_Get() — distinct from every + /* Overflow resolves to the shared NullStore_Get() - distinct from every * pool slot, and the same singleton consumers of SolidSyslogConfig.Store * see when no store is wired. */ CHECK_TEXT(overflow == SolidSyslogNullStore_Get(), "overflow did not resolve to NullStore"); @@ -2236,12 +2236,12 @@ TEST(SolidSyslogBlockStorePool, UseAfterDestroyIsCrashSafeViaNullStoreVtable) * Pin the contract that Write drops, ReadNextUnsent reports nothing, * and the rest of the vtable doesn't crash. */ struct SolidSyslogStore* store = MakeStore(); - pooled[0] = store; /* keep the handle live so teardown's Destroy hits the same slot — second Destroy is the + pooled[0] = store; /* keep the handle live so teardown's Destroy hits the same slot - second Destroy is the known-issued-handle case */ SolidSyslogBlockStore_Destroy(store); pooled[0] = nullptr; - /* Vtable now matches NullStore — Write drops, ReadNextUnsent has nothing. */ + /* Vtable now matches NullStore - Write drops, ReadNextUnsent has nothing. */ CHECK_FALSE(SolidSyslogStore_Write(store, TEST_DATA, TEST_DATA_LEN)); char buf[TEST_BUF_SIZE] = {}; size_t bytesRead = 99; diff --git a/Tests/SolidSyslogCircularBufferTest.cpp b/Tests/SolidSyslogCircularBufferTest.cpp index 11547ea5..9029d378 100644 --- a/Tests/SolidSyslogCircularBufferTest.cpp +++ b/Tests/SolidSyslogCircularBufferTest.cpp @@ -315,9 +315,9 @@ TEST_GROUP_BASE(SolidSyslogCircularBufferSmallRing, CircularBufferFixture) // clang-format on // 32-byte ring, 2-byte header per record. -// recA(12)→ tail=14, recB(12)→ tail=28, read recA → head=14. +// recA(12)-> tail=14, recB(12)-> tail=28, read recA -> head=14. // recC(12) recordBytes=14: doesn't fit at tail (28+14=42>32); -// canWrap: recordBytes(14) vs head(14). With `<=` bug: wraps, tail=14=head → IsEmpty. +// canWrap: recordBytes(14) vs head(14). With `<=` bug: wraps, tail=14=head -> IsEmpty. // With `<` fix: drops; recB still readable. TEST(SolidSyslogCircularBufferSmallRing, WrapWriteFillingExactlyToHeadDoesNotCollapseToEmpty) { @@ -333,8 +333,8 @@ TEST(SolidSyslogCircularBufferSmallRing, WrapWriteFillingExactlyToHeadDoesNotCol } // 32-byte ring. Establish wrapped state (head=24, tail=3 after a, b, c, d), then -// write e of size 19 → recordBytes=21 = head-tail. With `<=` bug, fitsAtTail in -// wrapped state lets tail advance to head exactly → IsEmpty collapse. +// write e of size 19 -> recordBytes=21 = head-tail. With `<=` bug, fitsAtTail in +// wrapped state lets tail advance to head exactly -> IsEmpty collapse. TEST(SolidSyslogCircularBufferSmallRing, WriteInWrappedStateFillingExactlyToHeadDoesNotCollapseToEmpty) { char a[10]; @@ -375,7 +375,7 @@ TEST(SolidSyslogCircularBufferSmallRing, ReadIntoSmallerBufferReturnsFalseAndLea // Exercises the ConsumeWrapMarker branch of Read: write A, B, drain A, write // C, D (D forces a wrap), then drain in order. The fourth read must cross -// the wrap point — head reaches wrapPoint and jumps to 0 to read D. +// the wrap point - head reaches wrapPoint and jumps to 0 to read D. TEST(SolidSyslogCircularBufferSmallRing, WrappedBufferReadsAllRecordsInOrder) { char a[10]; diff --git a/Tests/SolidSyslogFileBlockDeviceTest.cpp b/Tests/SolidSyslogFileBlockDeviceTest.cpp index f4ff7bb1..e1858962 100644 --- a/Tests/SolidSyslogFileBlockDeviceTest.cpp +++ b/Tests/SolidSyslogFileBlockDeviceTest.cpp @@ -23,7 +23,7 @@ class TEST_SolidSyslogFileBlockDevice_WriteAtMutatesByteInPlace_Test; static const char* const TEST_PATH_PREFIX = "/tmp/blockdev_"; /* Reads `length` bytes from (blockIndex, offset) and asserts they equal `expected`. - * Mirrors the CHECK_PRIVAL family in SolidSyslogTest.cpp — names the intent so + * Mirrors the CHECK_PRIVAL family in SolidSyslogTest.cpp - names the intent so * tests read as "block N at offset O contains 'foo'" rather than buf+memcmp boilerplate. * Macro (not function) so test failures report the caller's __FILE__/__LINE__. */ #define CHECK_BLOCK_CONTAINS(blockIndex, offset, expected, length) \ @@ -190,7 +190,7 @@ TEST(SolidSyslogFileBlockDevice, BlockFilenameWithTwoDigitIndex) /* The on-disk sequence is two decimal digits: indices > 99 cannot be * represented uniquely. Without a guard, casting a wide blockIndex through - * uint8_t (256 → 0) would alias to an existing block and silently overwrite + * uint8_t (256 -> 0) would alias to an existing block and silently overwrite * its content. */ TEST(SolidSyslogFileBlockDevice, AcquireRejectsOverlargeBlockIndex) { @@ -290,7 +290,7 @@ TEST(SolidSyslogFileBlockDevice, UseAfterDestroyIsCrashSafeViaNullBlockDeviceVta device = nullptr; // teardown's nullptr guard skips the second Destroy } -// Pool tests — prove SOLIDSYSLOG_FILE_BLOCK_DEVICE_POOL_SIZE caps live +// Pool tests - prove SOLIDSYSLOG_FILE_BLOCK_DEVICE_POOL_SIZE caps live // instances and overflow falls back to the class-private no-op BlockDevice. // Generic pool mechanics (lock counts, per-probe locking, stale-handle warning) // are covered by SolidSyslogPoolAllocatorTest.cpp. diff --git a/Tests/SolidSyslogFormatterTest.cpp b/Tests/SolidSyslogFormatterTest.cpp index 39832ce9..fbfe03c7 100644 --- a/Tests/SolidSyslogFormatterTest.cpp +++ b/Tests/SolidSyslogFormatterTest.cpp @@ -159,7 +159,7 @@ TEST(SolidSyslogFormatter, AsciiCharacterSubstitutesHighBitByteWithQuestionMark) { /* A high-bit byte (like a UTF-8 lead) is not PRINTUSASCII; it must be * replaced with the substitute '?'. This keeps AsciiCharacter safe to - * hand to extension points — no way to smuggle non-ASCII in. */ + * hand to extension points - no way to smuggle non-ASCII in. */ formatAsciiCharacter('\xC3'); CHECK_FORMATTED("?"); @@ -185,7 +185,7 @@ TEST(SolidSyslogFormatter, AsciiCharacterSubstitutesDelWithQuestionMark) TEST(SolidSyslogFormatter, AsciiCharacterAcceptsSpace) { - /* Space (0x20) is outside PRINTUSASCII but must pass through — the + /* Space (0x20) is outside PRINTUSASCII but must pass through - the * library uses it as the structural separator between syslog header * fields. */ formatAsciiCharacter(' '); @@ -216,7 +216,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesSmallestContinuationByte) TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongTwoByteEncodingPerByte) { - /* \xC1\x81 — overlong 2-byte form of U+0041. Per RFC 3629 §10 and Unicode + /* \xC1\x81 - overlong 2-byte form of U+0041. Per RFC 3629 §10 and Unicode * §3.9, each invalid byte becomes its own U+FFFD substitution. */ formatBoundedString("\xC1\x81", 2); @@ -225,7 +225,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongTwoByteEncodingPerByte) TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongLeadC0) { - /* \xC0 — the other overlong 2-byte lead forbidden by RFC 3629 §4. */ + /* \xC0 - the other overlong 2-byte lead forbidden by RFC 3629 §4. */ formatBoundedString("\xC0", 1); CHECK_FORMATTED("\xEF\xBF\xBD"); @@ -243,7 +243,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesInvalidLeadsF5ToFF) TEST(SolidSyslogFormatter, BoundedStringReplacesInvalidLeadsInF8ToFFMid) { - /* Interior of the 5+ byte prefix range — drives a mask that covers F8-FF, + /* Interior of the 5+ byte prefix range - drives a mask that covers F8-FF, * rather than enumerating each value. */ formatBoundedString("\xF8\xFE", 2); @@ -302,7 +302,7 @@ TEST(SolidSyslogFormatter, BoundedStringPassesThreeByteCodepointWithE1LeadThroug TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongThreeByteEncodingPerByte) { - /* \xE0\x80\x80 — overlong 3-byte encoding of U+0000. The E0 lead + /* \xE0\x80\x80 - overlong 3-byte encoding of U+0000. The E0 lead * requires a continuation in A0-BF; \x80 is below that subrange, so the * sequence is ill-formed and each invalid byte becomes its own U+FFFD. */ formatBoundedString("\xE0\x80\x80", 3); @@ -312,7 +312,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongThreeByteEncodingPerByte TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongThreeByteEncodingAtSubrangeTop) { - /* \xE0\x9F\x80 — also overlong: \x9F is still below the E0 subrange + /* \xE0\x9F\x80 - also overlong: \x9F is still below the E0 subrange * lower bound of \xA0. Forces the exclusion to widen beyond a single * hardcoded continuation byte to the full 80-9F range. */ formatBoundedString("\xE0\x9F\x80", 3); @@ -322,7 +322,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongThreeByteEncodingAtSubra TEST(SolidSyslogFormatter, BoundedStringReplacesUtf16SurrogateEncodingPerByte) { - /* \xED\xA0\x80 — UTF-8 encoding of U+D800, a UTF-16 high surrogate. + /* \xED\xA0\x80 - UTF-8 encoding of U+D800, a UTF-16 high surrogate. * RFC 3629 §3 forbids encoding surrogates; the ED lead requires a * continuation in 80-9F, not A0-BF. */ formatBoundedString("\xED\xA0\x80", 3); @@ -370,7 +370,7 @@ TEST(SolidSyslogFormatter, BoundedStringPassesFourByteCodepointWithF1LeadThrough TEST(SolidSyslogFormatter, BoundedStringReplacesOverlongFourByteEncodingPerByte) { - /* \xF0\x80\x80\x80 — overlong 4-byte encoding of U+0000. The F0 lead + /* \xF0\x80\x80\x80 - overlong 4-byte encoding of U+0000. The F0 lead * requires a continuation in 90-BF; \x80 is below that subrange. */ formatBoundedString("\xF0\x80\x80\x80", 4); @@ -389,7 +389,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesFourByteEncodingBeyondUnicodeRan TEST(SolidSyslogFormatter, BoundedStringReplacesF5AsFourByteLead) { - /* \xF5 is not a valid 4-byte lead — any codepoint with a F5 lead would + /* \xF5 is not a valid 4-byte lead - any codepoint with a F5 lead would * exceed U+10FFFF. RFC 3629 §3 restricts 4-byte leads to F0-F4. */ formatBoundedString("\xF5\x80\x80\x80", 4); @@ -398,7 +398,7 @@ TEST(SolidSyslogFormatter, BoundedStringReplacesF5AsFourByteLead) TEST(SolidSyslogFormatter, BoundedStringReplacesF6AsFourByteLead) { - /* \xF6 is not a valid 4-byte lead either — same reason as F5. */ + /* \xF6 is not a valid 4-byte lead either - same reason as F5. */ formatBoundedString("\xF6\x80\x80\x80", 4); CHECK_FORMATTED("\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD"); @@ -610,7 +610,7 @@ TEST(SolidSyslogFormatter, AsFormattedBufferZerosOrphanContinuationWhenFourByteT TEST(SolidSyslogFormatter, AsFormattedBufferZerosBothOrphanContinuationsWhenFourByteTrimmedAtAntepenultimate) { - /* 4-byte codepoint clamped after 3 bytes — both trailing continuations + /* 4-byte codepoint clamped after 3 bytes - both trailing continuations * must be zeroed alongside the masked lead. */ CREATE_FORMATTER(4); @@ -920,7 +920,7 @@ TEST(SolidSyslogFormatter, EscapedStringReplacesStragglingMultiByteLeadWhenSourc { /* \xC2 is a 2-byte lead with no continuation available in the source * (NUL-terminator follows). The lead cannot complete a codepoint and - * is demoted to U+FFFD — the decoded budget must accommodate the + * is demoted to U+FFFD - the decoded budget must accommodate the * 3 decoded bytes of the replacement. */ SolidSyslogFormatter_EscapedString(formatter, "\xC2", 3); diff --git a/Tests/SolidSyslogMetaSdTest.cpp b/Tests/SolidSyslogMetaSdTest.cpp index 6621c8c3..24b890ff 100644 --- a/Tests/SolidSyslogMetaSdTest.cpp +++ b/Tests/SolidSyslogMetaSdTest.cpp @@ -172,7 +172,7 @@ TEST(SolidSyslogMetaSd, FormatAdvancesFormatterLength) TEST(SolidSyslogMetaSd, DestroyDoesNotCrash) { - // Covered by teardown — this test documents the intent + // Covered by teardown - this test documents the intent } TEST(SolidSyslogMetaSd, UseAfterDestroyIsCrashSafeViaNullSdVtable) @@ -310,7 +310,7 @@ TEST(SolidSyslogMetaSd, CreateWithNullCounterReportsCritical) UNSIGNED_LONGS_EQUAL(SOLIDSYSLOG_META_SD_ERROR_NULL_COUNTER, ErrorHandlerFake_LastDetail()); } -// Pool tests — prove SOLIDSYSLOG_META_SD_POOL_SIZE caps live instances +// Pool tests - prove SOLIDSYSLOG_META_SD_POOL_SIZE caps live instances // and overflow falls back to the shared SolidSyslogNullSd. // clang-format off diff --git a/Tests/SolidSyslogNullStoreTest.cpp b/Tests/SolidSyslogNullStoreTest.cpp index 43958303..82ba4aa8 100644 --- a/Tests/SolidSyslogNullStoreTest.cpp +++ b/Tests/SolidSyslogNullStoreTest.cpp @@ -32,7 +32,7 @@ TEST(SolidSyslogNullStore, ReadNextUnsentReturnsFalse) TEST(SolidSyslogNullStore, WriteReturnsFalseToSignalNotRetained) { /* The Store_Write contract reads "true = retained for later replay; false - * = not held". NullStore never retains, so reports false — the eager-drain + * = not held". NullStore never retains, so reports false - the eager-drain * loop in ProcessMessages then takes the direct-send fallback, preserving * the constrained-system "one attempt per message, no buffering" path. */ CHECK_FALSE(SolidSyslogStore_Write(store, "hello", 5)); diff --git a/Tests/SolidSyslogOpenSslAesGcmPolicyTest.cpp b/Tests/SolidSyslogOpenSslAesGcmPolicyTest.cpp index a3819117..984beb6a 100644 --- a/Tests/SolidSyslogOpenSslAesGcmPolicyTest.cpp +++ b/Tests/SolidSyslogOpenSslAesGcmPolicyTest.cpp @@ -37,7 +37,7 @@ enum static const uint8_t* lastGetKeyBuffer = nullptr; static size_t lastGetKeyCapacity = 0; -/* Settable key accessor. `keyAvailable` false → GetKey fails; `keyByte` sets the +/* Settable key accessor. `keyAvailable` false -> GetKey fails; `keyByte` sets the * key contents (vary it to forge a wrong key); `keyLengthToReport` lets a test * report a non-32-byte key. */ static bool keyAvailable = true; @@ -316,7 +316,7 @@ TEST(SolidSyslogOpenSslAesGcmPolicySeal, SealRecordGeneratesAFreshNonceIntoTheTr LONGS_EQUAL(1, OpenSslFake_RandBytesCallCount()); LONGS_EQUAL(GCM_NONCE_SIZE, OpenSslFake_LastRandBytesLen()); POINTERS_EQUAL(trailer, OpenSslFake_LastRandBytesBuf()); - /* The fake's RAND_bytes fills 0xA0, 0xA1, … — assert it reached the trailer. */ + /* The fake's RAND_bytes fills 0xA0, 0xA1, ... - assert it reached the trailer. */ static const uint8_t expectedNonce[GCM_NONCE_SIZE] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB}; MEMCMP_EQUAL(expectedNonce, trailer, GCM_NONCE_SIZE); @@ -327,7 +327,7 @@ TEST(SolidSyslogOpenSslAesGcmPolicySeal, SealRecordPassesTheBodyAsPlaintextToEnc CHECK_TRUE(seal()); /* Production hands EVP the body region (Content past HeaderLength), not the - * header — that the body region is what gets encrypted is the wiring under + * header - that the body region is what gets encrypted is the wiring under * test. Whether the ciphertext genuinely differs is the integration suite's * concern. */ LONGS_EQUAL(TEST_BODY_LEN, OpenSslFake_LastGcmPlaintextLen()); @@ -373,7 +373,7 @@ TEST(SolidSyslogOpenSslAesGcmPolicySeal, OpenReturnsTrueWhenDecryptionSucceeds) } /* A tag mismatch (tamper or wrong key) surfaces as EVP_DecryptFinal_ex returning - * 0. Production must fail closed but stay silent — that is the expected outcome, + * 0. Production must fail closed but stay silent - that is the expected outcome, * not a library error. Real tamper/wrong-key rejection lives in the integration * suite; here we only prove the adapter's verdict-propagation and silence. */ TEST(SolidSyslogOpenSslAesGcmPolicySeal, OpenReturnsFalseWithoutReportingWhenAuthenticationFails) @@ -481,7 +481,7 @@ TEST(SolidSyslogOpenSslAesGcmPolicySeal, SealReportsErrorWhenReadingTheTagFails) } /* Open's setup chain (everything up to and including SET_TAG) reports - * DECRYPT_FAILED on any non-1. The DecryptFinal verdict is separate — that + * DECRYPT_FAILED on any non-1. The DecryptFinal verdict is separate - that * fail-closed-but-silent path is OpenReturnsFalseWithoutReporting... above. */ TEST(SolidSyslogOpenSslAesGcmPolicySeal, OpenReportsErrorWhenContextAllocationFails) { diff --git a/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp b/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp index 96451b1c..4c096546 100644 --- a/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp +++ b/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp @@ -35,7 +35,7 @@ enum * not. */ static uint8_t TEST_RECORD[] = {0x10, 0x20, 0x30, 0x40}; -/* The buffer + capacity the policy handed to GetKey on the most recent fetch — +/* The buffer + capacity the policy handed to GetKey on the most recent fetch - * lets a test assert the key buffer is wiped at exactly that pointer and size. */ static const uint8_t* lastGetKeyBuffer = nullptr; static size_t lastGetKeyCapacity = 0; @@ -426,7 +426,7 @@ TEST(SolidSyslogOpenSslHmacSha256PolicySeal, OpenRecordFailsClosedWhenKeyUnavail } // An HMAC computation failure during verify is an OPEN failure, not a SEAL -// failure — the same ComputeTag helper serves both paths, so the category must +// failure - the same ComputeTag helper serves both paths, so the category must // be chosen by the caller. TEST(SolidSyslogOpenSslHmacSha256PolicySeal, OpenRecordReportsHmacFailureAsOpenFailed) { diff --git a/Tests/SolidSyslogOpenSslStreamTest.cpp b/Tests/SolidSyslogOpenSslStreamTest.cpp index 26e3d439..858c3044 100644 --- a/Tests/SolidSyslogOpenSslStreamTest.cpp +++ b/Tests/SolidSyslogOpenSslStreamTest.cpp @@ -57,7 +57,7 @@ uint32_t FakeGetHandshakeTimeoutMs_ReturnValue = SOLIDSYSLOG_TLS_HANDSHAKE_TIMEO void FakeGetHandshakeTimeoutMs_Reset() { FakeGetHandshakeTimeoutMs_CallCount = 0; - FakeGetHandshakeTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel — overwritten on first call */ + FakeGetHandshakeTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel - overwritten on first call */ FakeGetHandshakeTimeoutMs_ReturnValue = SOLIDSYSLOG_TLS_HANDSHAKE_TIMEOUT_MS; } @@ -108,10 +108,10 @@ TEST_GROUP(SolidSyslogOpenSslStream) StreamFake_Destroy(transport); } - /* Tests needing config tweaks (CipherList, ClientCertChainPath, ServerName, …) + /* Tests needing config tweaks (CipherList, ClientCertChainPath, ServerName, ...) * call this to release setup()'s pool slot, mutate `config`, then re-Create. * Fully resets the fixture (transport, OpenSslFake counters, error handler) - * so the test body observes counts from this Open onwards only — matters + * so the test body observes counts from this Open onwards only - matters * for assertions like CHECK_OPEN_UNWOUND_WITH_ERROR that pin counts at == 1. */ void ReCreateStreamWithUpdatedConfig() { @@ -124,7 +124,7 @@ TEST_GROUP(SolidSyslogOpenSslStream) stream = SolidSyslogOpenSslStream_Create(&config); } - /* Drive the registered BIO read callback with the given transport return — + /* Drive the registered BIO read callback with the given transport return - collapses the open + set-return + grab-callback + invoke boilerplate. */ [[nodiscard]] int InvokeBioReadWithTransportReturn(SolidSyslogSsize transportReturn) const { @@ -147,7 +147,7 @@ TEST_GROUP(SolidSyslogOpenSslStream) } /* Arrange SSL_connect to first emit `wantError`, then succeed on the next - call — exercises the bounded handshake retry loop's progress path. */ + call - exercises the bounded handshake retry loop's progress path. */ static void ArrangeHandshakeRetryThenSucceed(int wantError) { int seq[] = {-1, 1}; @@ -155,7 +155,7 @@ TEST_GROUP(SolidSyslogOpenSslStream) OpenSslFake_SetGetErrorReturn(wantError); } - /* Arrange SSL_connect to fail with `errorCode` on every call — used both + /* Arrange SSL_connect to fail with `errorCode` on every call - used both for the persistent-WANT (budget-exhausted) and hard-error paths. */ static void ArrangePersistentHandshakeError(int errorCode) { @@ -164,7 +164,7 @@ TEST_GROUP(SolidSyslogOpenSslStream) OpenSslFake_SetGetErrorReturn(errorCode); } - /* Open then arrange the next SSL_write to fail — exercises the Send fail-fast + /* Open then arrange the next SSL_write to fail - exercises the Send fail-fast teardown path that closes the SSL session and the underlying transport. */ void OpenThenCauseSslWriteFailure() const { @@ -179,7 +179,7 @@ TEST_GROUP(SolidSyslogOpenSslStream) } /* Open then arrange SSL_read to return the configured value while - SSL_get_error reports the configured SSL-level status — together they + SSL_get_error reports the configured SSL-level status - together they exercise each branch of the Read non-blocking contract. */ // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) -- both ints, but name + comment make role distinct [[nodiscard]] SolidSyslogSsize OpenThenReadWithSslReturnAndError(int sslReadReturn, int sslErrorCode) const @@ -373,7 +373,7 @@ TEST(SolidSyslogOpenSslStream, OpenSkipsHostnameSetupWhenServerNameIsNull) TEST(SolidSyslogOpenSslStream, OpenWarnsWhenServerNameIsNull) { - /* Default config.ServerName is NULL — peer identity is unverified, which the + /* Default config.ServerName is NULL - peer identity is unverified, which the * library must surface rather than swallow (S12.28). */ SolidSyslogStream_Open(stream, addr); CALLED_FAKE(ErrorHandlerFake_Handle, ONCE); @@ -385,7 +385,7 @@ TEST(SolidSyslogOpenSslStream, OpenWarnsWhenServerNameIsNull) TEST(SolidSyslogOpenSslStream, OpenStillConnectsWhenServerNameIsNull) { - /* The unverified-peer WARNING is observable but non-fatal — the IP-pinned / + /* The unverified-peer WARNING is observable but non-fatal - the IP-pinned / * closed-network use case must still connect. */ CHECK_TRUE(SolidSyslogStream_Open(stream, addr)); LONGS_EQUAL(0, StreamFake_CloseCallCount(transport)); @@ -393,7 +393,7 @@ TEST(SolidSyslogOpenSslStream, OpenStillConnectsWhenServerNameIsNull) TEST(SolidSyslogOpenSslStream, OpenDoesNotWarnWhenServerNameIsEmpty) { - /* Empty string is the deliberate opt-out — no diagnostic. */ + /* Empty string is the deliberate opt-out - no diagnostic. */ config.ServerName = ""; ReCreateStreamWithUpdatedConfig(); SolidSyslogStream_Open(stream, addr); @@ -598,7 +598,7 @@ TEST(SolidSyslogOpenSslStream, DestroyAfterCloseDoesNotDoubleFreeSsl) TEST(SolidSyslogOpenSslStream, ReopenAfterCloseDoesNotLeakSslContext) { - /* Each Open rebuilds the SSL_CTX (the cert-rotation contract — a fresh CTX + /* Each Open rebuilds the SSL_CTX (the cert-rotation contract - a fresh CTX per connection picks up trust-store / client-identity changes). The fail-fast reconnect model therefore drives Open -> Close -> Open on a single stream instance repeatedly; Close must free the CTX so the next @@ -731,7 +731,7 @@ TEST(SolidSyslogOpenSslStream, OpenReturnsFalseWhenHandshakeFails) /* ServerName set so the handshake stage is the only error source (a NULL * ServerName would also emit the unverified-peer WARNING). Default * OpenSslFake_SetConnectFails(true) returns -1 from SSL_connect and - * SSL_get_error reports SSL_ERROR_SSL (the default for SetGetErrorReturn) — + * SSL_get_error reports SSL_ERROR_SSL (the default for SetGetErrorReturn) - * a non-retryable hard error, which is the HANDSHAKE_REJECTED branch. */ config.ServerName = "logs.example"; ReCreateStreamWithUpdatedConfig(); @@ -858,7 +858,7 @@ TEST(SolidSyslogOpenSslStream, BioNewFailureFreesBioMethodInline) OpenSslFake_SetBioNewFails(true); SolidSyslogStream_Open(stream, addr); CALLED_FAKE(OpenSslFake_BioMethFree, ONCE); - /* teardown re-Destroys safely — bioMethod already cleared */ + /* teardown re-Destroys safely - bioMethod already cleared */ } TEST(SolidSyslogOpenSslStream, SendReturnsTrueOnHappyPath) @@ -934,7 +934,7 @@ TEST(SolidSyslogOpenSslStream, BioCreateCallbackMarksBioInitialised) } /* ------------------------------------------------------------------------- - * Mutual TLS — client certificate + private key (S03.09). + * Mutual TLS - client certificate + private key (S03.09). * ------------------------------------------------------------------------- */ TEST(SolidSyslogOpenSslStream, OpenSkipsClientIdentityWhenBothPathsAreNull) @@ -1214,7 +1214,7 @@ TEST(SolidSyslogOpenSslStream, OpenRetriesHandshakeOnWantWrite) TEST(SolidSyslogOpenSslStream, OpenFailsWhenHandshakeNeverCompletes) { /* ServerName set so the handshake timeout is the only error source. - SSL_connect always returns -1 with WANT_READ — handshake never makes + SSL_connect always returns -1 with WANT_READ - handshake never makes progress, so the bounded budget should expire and Open returns false. */ config.ServerName = "logs.example"; ReCreateStreamWithUpdatedConfig(); @@ -1238,7 +1238,7 @@ TEST(SolidSyslogOpenSslStream, OpenInvokesConfiguredHandshakeTimeoutGetter) TEST(SolidSyslogOpenSslStream, OpenUsesGetterReturnValueAsHandshakeBudget) { - /* 5 ms budget against the 1 ms poll interval → loop should sleep 5 times + /* 5 ms budget against the 1 ms poll interval -> loop should sleep 5 times before declaring HANDSHAKE_TIMEOUT and unwinding. */ FakeGetHandshakeTimeoutMs_ReturnValue = 5U; RecreateStreamWithFakeHandshakeGetter(); @@ -1260,7 +1260,7 @@ TEST(SolidSyslogOpenSslStream, GetterReceivesNullContextWhenContextNotConfigured TEST(SolidSyslogOpenSslStream, OpenFailsImmediatelyOnHardSslError) { /* ServerName set so the handshake hard error is the only error source. - Non-WANT error (e.g. SSL_ERROR_SSL) is fail-fast — no retry budget burn. */ + Non-WANT error (e.g. SSL_ERROR_SSL) is fail-fast - no retry budget burn. */ config.ServerName = "logs.example"; ReCreateStreamWithUpdatedConfig(); ArrangePersistentHandshakeError(SSL_ERROR_SSL); @@ -1337,7 +1337,7 @@ TEST(SolidSyslogOpenSslStream, ReadReturnsNegativeOneOnHardErrorAndClosesSsl) TEST(SolidSyslogOpenSslStream, ReadReturnsNegativeOneOnZeroReturnAndClosesSsl) { - /* SSL_read returns 0 → SSL_ERROR_ZERO_RETURN (clean shutdown by peer). */ + /* SSL_read returns 0 -> SSL_ERROR_ZERO_RETURN (clean shutdown by peer). */ LONGS_EQUAL(-1, OpenThenReadWithSslReturnAndError(0, SSL_ERROR_ZERO_RETURN)); CHECK_SSL_SESSION_CLOSED(); CHECK_TRANSPORT_CLOSED_ONCE(); @@ -1353,6 +1353,6 @@ TEST(SolidSyslogOpenSslStream, CloseAfterInternalCloseFromSendFailureDoesNotDoub { OpenThenCauseSslWriteFailure(); SendShortMessage(); /* internal close */ - SolidSyslogStream_Close(stream); /* second close — must be safe */ + SolidSyslogStream_Close(stream); /* second close - must be safe */ CHECK_SSL_SESSION_CLOSED(); } diff --git a/Tests/SolidSyslogOriginSdTest.cpp b/Tests/SolidSyslogOriginSdTest.cpp index 482fcdaa..0a959792 100644 --- a/Tests/SolidSyslogOriginSdTest.cpp +++ b/Tests/SolidSyslogOriginSdTest.cpp @@ -31,7 +31,7 @@ struct SolidSyslogStructuredData; enum { - /* Worst-case fully-escaped output is 337 bytes — see + /* Worst-case fully-escaped output is 337 bytes - see WorstCaseFullyEscapedInputFormatsCorrectly. IP params widen this further once they are appended. 512 leaves headroom. */ TEST_BUFFER_SIZE = 512, @@ -308,7 +308,7 @@ TEST(SolidSyslogOriginSd, BothNullProducesBareOriginElement) TEST(SolidSyslogOriginSd, DestroyDoesNotCrash) { - // Covered by teardown — this test documents the intent + // Covered by teardown - this test documents the intent } TEST(SolidSyslogOriginSd, SoftwareContainingSpecialsIsEscaped) @@ -541,7 +541,7 @@ TEST(SolidSyslogOriginSd, EnterpriseIdAndIpsNoSoftwareSwVersion) ); } -// Pool tests — prove SOLIDSYSLOG_ORIGIN_SD_POOL_SIZE caps live instances +// Pool tests - prove SOLIDSYSLOG_ORIGIN_SD_POOL_SIZE caps live instances // and overflow falls back to the shared SolidSyslogNullSd. // clang-format off diff --git a/Tests/SolidSyslogPassthroughBufferTest.cpp b/Tests/SolidSyslogPassthroughBufferTest.cpp index 551e3ca5..86f29d04 100644 --- a/Tests/SolidSyslogPassthroughBufferTest.cpp +++ b/Tests/SolidSyslogPassthroughBufferTest.cpp @@ -114,7 +114,7 @@ TEST(SolidSyslogPassthroughBuffer, UseAfterDestroyIsCrashSafeViaNullBufferVtable buffer = SolidSyslogPassthroughBuffer_Create(fakeSender); // for teardown } -// Pool tests — prove SOLIDSYSLOG_PASSTHROUGH_BUFFER_POOL_SIZE caps live +// Pool tests - prove SOLIDSYSLOG_PASSTHROUGH_BUFFER_POOL_SIZE caps live // instances and overflow falls back to a distinct no-op buffer. Generic // pool mechanics (lock counts, per-probe locking, stale-handle warning) // are covered by SolidSyslogPoolAllocatorTest.cpp. diff --git a/Tests/SolidSyslogPoolTest.cpp b/Tests/SolidSyslogPoolTest.cpp index 9765d8d9..4cd26e9d 100644 --- a/Tests/SolidSyslogPoolTest.cpp +++ b/Tests/SolidSyslogPoolTest.cpp @@ -143,7 +143,7 @@ TEST(SolidSyslogPool, DestroyOfPooledHandleLocksOnce) TEST(SolidSyslogPool, DestroyOfUnknownHandleDoesNotLock) { ConfigLockFake_Install(); - /* Any non-pool address — cast a stack byte, value never dereferenced. */ + /* Any non-pool address - cast a stack byte, value never dereferenced. */ char stackByte = 0; auto* stranger = reinterpret_cast(&stackByte); diff --git a/Tests/SolidSyslogPosixClockTest.cpp b/Tests/SolidSyslogPosixClockTest.cpp index 475c88d7..3718a100 100644 --- a/Tests/SolidSyslogPosixClockTest.cpp +++ b/Tests/SolidSyslogPosixClockTest.cpp @@ -160,7 +160,7 @@ TEST(SolidSyslogPosixClock, Max32BitEpochProduces2038) CHECK_SECOND(7); } -// 2066-01-01T00:00:00Z — well beyond 32-bit time_t limit +// 2066-01-01T00:00:00Z - well beyond 32-bit time_t limit TEST(SolidSyslogPosixClock, NoY2038LimitOnThisPlatform) { ClockFake_SetTime(3029529600, 0); diff --git a/Tests/SolidSyslogPosixMessageQueueBufferTest.cpp b/Tests/SolidSyslogPosixMessageQueueBufferTest.cpp index 354ffb70..623bf63c 100644 --- a/Tests/SolidSyslogPosixMessageQueueBufferTest.cpp +++ b/Tests/SolidSyslogPosixMessageQueueBufferTest.cpp @@ -160,7 +160,7 @@ TEST(SolidSyslogPosixMessageQueueBuffer, ReadFromEmptyQueueDoesNotEmitError) } /* A NULL bytesRead* would crash on `*bytesRead = 0`. Guard at the - * Read entry — invalid caller usage, not a runtime failure, so no + * Read entry - invalid caller usage, not a runtime failure, so no * error code is emitted; just a defensive false return. */ TEST(SolidSyslogPosixMessageQueueBuffer, ReadWithNullBytesReadDoesNotCrash) { @@ -299,7 +299,7 @@ TEST(SolidSyslogPosixMessageQueueBufferPool, CreateOnMqOpenFailureReleasesSlot) // Fill the pool *after* the failed Create; if the failed Create had leaked // its acquired slot, the pool would overflow into the fallback one slot - // sooner — and FillPool's last MakeBuffer would return the same NullBuffer + // sooner - and FillPool's last MakeBuffer would return the same NullBuffer // singleton as `overflow`, since both Creates would have run out of slots. FillPool(); for (auto* slot : pooled) @@ -382,7 +382,7 @@ TEST(SolidSyslogPosixMessageQueueBufferPool, DestroyOfUnknownHandleReportsWarnin /* Destroy(NULL) is reachable from any integrator who keeps a NullBuffer-fallback * handle and later releases it. The IndexFromHandle search returns POOL_SIZE * (no slot matches NULL), IndexIsValid returns false, so the FreeIfInUse branch - * is skipped — caller sees an UNKNOWN_DESTROY warning, no crash. */ + * is skipped - caller sees an UNKNOWN_DESTROY warning, no crash. */ TEST(SolidSyslogPosixMessageQueueBufferPool, DestroyOfNullHandleReportsWarningWithoutCrashing) { ErrorHandlerFake_Install(nullptr); diff --git a/Tests/SolidSyslogPosixTcpStreamTest.cpp b/Tests/SolidSyslogPosixTcpStreamTest.cpp index de1491a8..da43b303 100644 --- a/Tests/SolidSyslogPosixTcpStreamTest.cpp +++ b/Tests/SolidSyslogPosixTcpStreamTest.cpp @@ -33,7 +33,7 @@ uint32_t FakeGetConnectTimeoutMs_ReturnValue = 200U; void FakeGetConnectTimeoutMs_Reset() { FakeGetConnectTimeoutMs_CallCount = 0; - FakeGetConnectTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel — overwritten on first call */ + FakeGetConnectTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel - overwritten on first call */ FakeGetConnectTimeoutMs_ReturnValue = 200U; } @@ -178,7 +178,7 @@ TEST(SolidSyslogPosixTcpStream, OpenSetsNonBlockingFlagBeforeConnect) TEST(SolidSyslogPosixTcpStream, OpenFailsWhenFcntlSetFlFails) { /* If the kernel refuses to put the socket into non-blocking mode the - caller cannot bound the connect wait — fail fast. */ + caller cannot bound the connect wait - fail fast. */ SocketFake_SetFcntlSetFlFails(true); CHECK_FALSE(SolidSyslogStream_Open(stream, addr)); CALLED_FAKE(SocketFake_Close, ONCE); @@ -407,7 +407,7 @@ TEST(SolidSyslogPosixTcpStream, DefaultPortMatchesRfc6587) } /* ---------------------------------------------------------------------- - * Non-blocking connect with bounded wait — keeps the service-thread drain + * Non-blocking connect with bounded wait - keeps the service-thread drain * rate insensitive to a slow or refused peer. * -------------------------------------------------------------------- */ @@ -430,7 +430,7 @@ TEST(SolidSyslogPosixTcpStream, OpenPassesBoundedConnectTimeoutToSelect) { SocketFake_SetConnectFailsWithErrno(EINPROGRESS); SolidSyslogStream_Open(stream, addr); - /* Default tunable SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS = 200 → 0 s + 200 000 µs. */ + /* Default tunable SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS = 200 -> 0 s + 200 000 µs. */ LONGS_EQUAL(0, SocketFake_LastSelectTimeoutSec()); LONGS_EQUAL(200000, SocketFake_LastSelectTimeoutUsec()); } @@ -513,7 +513,7 @@ TEST(SolidSyslogPosixTcpStream, OpenReadsSO_ERRORAfterSelectWritable) TEST(SolidSyslogPosixTcpStream, OpenFailsWhenConnectFailsImmediatelyWithRefused) { - /* Non-EINPROGRESS errors are immediate failures — no select wait, no + /* Non-EINPROGRESS errors are immediate failures - no select wait, no SO_ERROR check, just fail fast. */ SocketFake_SetConnectFailsWithErrno(ECONNREFUSED); CHECK_FALSE(SolidSyslogStream_Open(stream, addr)); @@ -529,8 +529,8 @@ TEST(SolidSyslogPosixTcpStream, OpenFailsWhenSO_ERRORLookupFails) } /* ---------------------------------------------------------------------- - * Non-blocking Read contract: bytes → return them; nothing → 0; - * EOF/error → close internally and return -1. + * Non-blocking Read contract: bytes -> return them; nothing -> 0; + * EOF/error -> close internally and return -1. * -------------------------------------------------------------------- */ TEST(SolidSyslogPosixTcpStream, ReadReturnsZeroOnEagain) diff --git a/Tests/SolidSyslogSdElementTest.cpp b/Tests/SolidSyslogSdElementTest.cpp index 826db479..f5e0b7f1 100644 --- a/Tests/SolidSyslogSdElementTest.cpp +++ b/Tests/SolidSyslogSdElementTest.cpp @@ -95,7 +95,7 @@ TEST(SolidSyslogSdElement, SecondParamClosesThePreviousValueQuote) TEST(SolidSyslogSdElement, BeginWithNullNameSuppressesTheWholeElement) { /* A NULL SD-ID can never form a well-formed element, so the whole element - * is skipped — params and close emit nothing, writes are absorbed safely. */ + * is skipped - params and close emit nothing, writes are absorbed safely. */ SolidSyslogSdElement_Begin(&element, nullptr, 0); SolidSyslogSdValue_String(SolidSyslogSdElement_Param(&element, "p"), "v"); SolidSyslogSdElement_End(&element); @@ -125,7 +125,7 @@ TEST(SolidSyslogSdElement, SkippedParamDoesNotDisturbSurroundingParams) TEST(SolidSyslogSdElement, ParamValueIsEscapedThroughTheValueSink) { - /* The element owns no escaping path of its own — the value's '"' is escaped + /* The element owns no escaping path of its own - the value's '"' is escaped * by the reused SolidSyslogSdValue, so framing stays intact. */ SolidSyslogSdElement_Begin(&element, "meta", 0); SolidSyslogSdValue_String(SolidSyslogSdElement_Param(&element, "p"), "a\"b"); diff --git a/Tests/SolidSyslogSdValueTest.cpp b/Tests/SolidSyslogSdValueTest.cpp index 33e857e5..ae8e18c8 100644 --- a/Tests/SolidSyslogSdValueTest.cpp +++ b/Tests/SolidSyslogSdValueTest.cpp @@ -95,7 +95,7 @@ TEST(SolidSyslogSdValue, StringEscapesAllThreeSpecialsInOneValue) TEST(SolidSyslogSdValue, StringPassesValidUtf8CodepointThrough) { - /* U+00A9 COPYRIGHT SIGN, a valid two-byte sequence — passes byte-for-byte. */ + /* U+00A9 COPYRIGHT SIGN, a valid two-byte sequence - passes byte-for-byte. */ writeString("\xC2\xA9"); CHECK_VALUE("\xC2\xA9"); @@ -103,7 +103,7 @@ TEST(SolidSyslogSdValue, StringPassesValidUtf8CodepointThrough) TEST(SolidSyslogSdValue, StringSubstitutesIllFormedByteWithReplacementCharacter) { - /* A lone continuation byte is ill-formed UTF-8 — substituted with U+FFFD. */ + /* A lone continuation byte is ill-formed UTF-8 - substituted with U+FFFD. */ writeString("\x80"); CHECK_VALUE("\xEF\xBF\xBD"); @@ -119,7 +119,7 @@ TEST(SolidSyslogSdValue, Uint32EmitsDecimalDigits) TEST(SolidSyslogSdValue, ReassemblesTwoByteCodepointSplitAcrossStringCalls) { /* U+00A9 COPYRIGHT SIGN streamed as its lead byte then its continuation - * byte across two SolidSyslogSdValue_String calls — the value must + * byte across two SolidSyslogSdValue_String calls - the value must * reassemble the codepoint, not emit a U+FFFD per orphaned half. */ writeString("\xC2"); writeString("\xA9"); diff --git a/Tests/SolidSyslogStreamSenderTest.cpp b/Tests/SolidSyslogStreamSenderTest.cpp index 59f58606..543c7679 100644 --- a/Tests/SolidSyslogStreamSenderTest.cpp +++ b/Tests/SolidSyslogStreamSenderTest.cpp @@ -70,7 +70,7 @@ static const char* SpyGetHost() return TEST_HOST; } -// Endpoint stubs — delegate to per-test function pointers so existing +// Endpoint stubs - delegate to per-test function pointers so existing // callback-spy tests in TEST_GROUP(SolidSyslogStreamSenderConfig) keep counting // callback invocations through the new endpoint path. endpointVersion is the // per-test version reported by TestEndpointVersion; bump it between Sends to @@ -646,7 +646,7 @@ TEST(SolidSyslogStreamSenderFailure, SendRecoversAfterTransientResolveFailure) TEST(SolidSyslogStreamSenderFailure, NoEndpointConfiguredConnectsToPortZero) { - /* Drop the setup-built sender so the pool slot is free for the no-endpoint variant — + /* Drop the setup-built sender so the pool slot is free for the no-endpoint variant - * with pool semantics a second live Create on a SIZE=1 pool would otherwise overflow * to NullSender. Reassigning to `sender` lets teardown release the no-endpoint sender. */ SolidSyslogStreamSender_Destroy(sender); @@ -657,7 +657,7 @@ TEST(SolidSyslogStreamSenderFailure, NoEndpointConfiguredConnectsToPortZero) LONGS_EQUAL(0, SocketFake_LastConnectPort()); } -// Pool tests — prove SOLIDSYSLOG_STREAM_SENDER_POOL_SIZE caps live instances +// Pool tests - prove SOLIDSYSLOG_STREAM_SENDER_POOL_SIZE caps live instances // and overflow falls back to the shared SolidSyslogNullSender. Generic // pool mechanics (lock counts, per-probe locking, stale-handle warning) // are covered by SolidSyslogPoolAllocatorTest.cpp. @@ -746,9 +746,9 @@ TEST(SolidSyslogStreamSenderPool, FillingPoolThenOverflowReturnsDistinctFallback } } -// Bad-setup tests — SolidSyslogStreamSender_Create rejects NULL config / +// Bad-setup tests - SolidSyslogStreamSender_Create rejects NULL config / // Resolver / Stream / Address by emitting a CRITICAL SolidSyslog_Error (fatal -// bad-config — the integrator must fix it in code) and returning the shared +// bad-config - the integrator must fix it in code) and returning the shared // SolidSyslogNullSender without consuming a pool slot. Matches the // SolidSyslogUdpSenderBadSetup contract from S12.06 (severity raised // ERROR->CRITICAL in S12.33). @@ -836,7 +836,7 @@ TEST(SolidSyslogStreamSenderBadSetup, DisconnectOnBadSetupSenderDoesNotCrash) SolidSyslogSender_Disconnect(sender); } -// Delivery-health tests — the sender holds one DeliveryHealthy edge bit +// Delivery-health tests - the sender holds one DeliveryHealthy edge bit // (initial true). It emits one DELIVERY_FAILED (ERR) event on the // healthy->down transition and one DELIVERY_RESTORED (NOTICE) event on the // down->healthy transition; staying down stays silent (anti-flood). The diff --git a/Tests/SolidSyslogSwitchingSenderTest.cpp b/Tests/SolidSyslogSwitchingSenderTest.cpp index 0fd213b9..80dcc3ac 100644 --- a/Tests/SolidSyslogSwitchingSenderTest.cpp +++ b/Tests/SolidSyslogSwitchingSenderTest.cpp @@ -14,7 +14,7 @@ using namespace CososoTesting; -/* Selector return values — named for the inner sender they select, so tests +/* Selector return values - named for the inner sender they select, so tests * read as `selectorReturn = INNER_B`. */ enum { @@ -105,7 +105,7 @@ TEST(SolidSyslogSwitchingSender, DestroyDoesNotSendToInnerSenders) CALLED_FAKE_ON(SenderFake_Send, innerA, NEVER); CALLED_FAKE_ON(SenderFake_Send, innerB, NEVER); - // Re-create so teardown's Destroy(sender) targets a live handle — + // Re-create so teardown's Destroy(sender) targets a live handle - // the destroy under test has already freed the original slot. CreateSwitchingSender(2); } @@ -118,7 +118,7 @@ TEST(SolidSyslogSwitchingSender, DestroyDoesNotDisconnectInnerSenders) CALLED_FAKE_ON(SenderFake_Disconnect, innerA, NEVER); CALLED_FAKE_ON(SenderFake_Disconnect, innerB, NEVER); - // Re-create so teardown's Destroy(sender) targets a live handle — + // Re-create so teardown's Destroy(sender) targets a live handle - // the destroy under test has already freed the original slot. CreateSwitchingSender(2); } @@ -218,7 +218,7 @@ TEST(SolidSyslogSwitchingSender, DisconnectAfterSelectorChangeWithoutSendForward Send("x", 1); // currentSender becomes innerA selectorReturn = INNER_B; // selector flips, but no Send yet SolidSyslogSender_Disconnect(sender); - // Disconnect does not re-consult the selector — it forwards to the + // Disconnect does not re-consult the selector - it forwards to the // currently-held sender, so innerA receives the Disconnect. CALLED_FAKE_ON(SenderFake_Disconnect, innerA, ONCE); CALLED_FAKE_ON(SenderFake_Disconnect, innerB, NEVER); @@ -286,10 +286,10 @@ TEST(SolidSyslogSwitchingSender, DisconnectAfterSwitchingBeyondEndIsNilSafe) Send("x", 1); selectorReturn = BEYOND_END; Send("y", 1); - // innerA was active, switched away — one Disconnect from the switch + // innerA was active, switched away - one Disconnect from the switch CALLED_FAKE_ON(SenderFake_Disconnect, innerA, ONCE); CALLED_FAKE_ON(SenderFake_Disconnect, innerB, NEVER); - // explicit Disconnect now resolves to nil — no inner sender touched + // explicit Disconnect now resolves to nil - no inner sender touched SolidSyslogSender_Disconnect(sender); CALLED_FAKE_ON(SenderFake_Disconnect, innerA, ONCE); CALLED_FAKE_ON(SenderFake_Disconnect, innerB, NEVER); @@ -303,7 +303,7 @@ TEST(SolidSyslogSwitchingSender, SelectorBeyondEndDisconnectBeforeSendDoesNotTou CALLED_FAKE_ON(SenderFake_Disconnect, innerB, NEVER); } -// Pool tests — prove SOLIDSYSLOG_SWITCHING_SENDER_POOL_SIZE caps live +// Pool tests - prove SOLIDSYSLOG_SWITCHING_SENDER_POOL_SIZE caps live // instances and overflow falls back to the shared SolidSyslogNullSender. // clang-format off @@ -382,7 +382,7 @@ TEST(SolidSyslogSwitchingSenderPool, FillingPoolThenOverflowReturnsDistinctFallb } } -// Bad-setup tests — SolidSyslogSwitchingSender_Create rejects malformed config +// Bad-setup tests - SolidSyslogSwitchingSender_Create rejects malformed config // and routes to NullSender. // clang-format off diff --git a/Tests/SolidSyslogTest.cpp b/Tests/SolidSyslogTest.cpp index fa4531b9..0a126070 100644 --- a/Tests/SolidSyslogTest.cpp +++ b/Tests/SolidSyslogTest.cpp @@ -107,7 +107,7 @@ TEST_GROUP(SolidSyslog) struct SolidSyslogSender *fakeSender; /* Pool-backed handles owned by tests that exercise Meta/TimeQuality SD. Held as fixture state so teardown releases their pool slots even if a - test body fails mid-assertion — otherwise the leaked slot returns the + test body fails mid-assertion - otherwise the leaked slot returns the fallback to subsequent tests and cascades the failure. */ struct SolidSyslogAtomicCounter *metaSdCounter; struct SolidSyslogStructuredData *metaSd; @@ -297,7 +297,7 @@ TEST(SolidSyslog, LogWithSdEscapesPerMessageValues) SolidSyslogStructuredData* perMessage[] = {&sdInject}; SolidSyslog_LogWithSd(solidSyslog, &message, perMessage, 1); /* The injected ']' is escaped to '\]' so it cannot break the SD framing - (asserted against the raw frame — the SDATA helper stops at any ']'). */ + (asserted against the raw frame - the SDATA helper stops at any ']'). */ STRCMP_CONTAINS("[inj k=\"a\\]b\"]", lastMessage()); } @@ -485,7 +485,7 @@ TEST(SolidSyslog, MessageTruncatedWhenExceedingBuffer) TEST(SolidSyslog, BomIsPreservedWhenMessageBodyTruncates) { /* When the body overflows the wire-frame budget, BoundedString clips - * the body but the BOM — written before the body — must remain + * the body but the BOM - written before the body - must remain * present. Pins the FormatMsg ordering: BOM first, body second. */ std::string longMsg(SOLIDSYSLOG_MAX_MESSAGE_SIZE, 'X'); message.Msg = longMsg.c_str(); @@ -884,7 +884,7 @@ TEST(SolidSyslog, ServiceDoesNotMarkSentWhenSendingFromBuffer) BufferFake_Destroy(); } -/* Shared fixture for the eager-drain Service tests — both wire a real +/* Shared fixture for the eager-drain Service tests - both wire a real * CircularBuffer (drives the multi-message-per-tick path) and a FIFO * StoreFake. Storage is static so a CHECK failure that skips the test * body's cleanup cannot leave a dangling stack reference behind for @@ -1189,7 +1189,7 @@ TEST(SolidSyslogLifecycle, ServiceWithDefaultStoreDrainsThroughToRealSender) TEST(SolidSyslogLifecycle, DestroyWithUnknownHandleReportsWarning) { /* Any non-pool address is "unknown" to IndexFromHandle. Cast a stack - byte's address — its value never gets dereferenced, only compared. */ + byte's address - its value never gets dereferenced, only compared. */ char stackByte = 0; auto* notAHandle = reinterpret_cast(&stackByte); ErrorHandlerFake_Install(nullptr); diff --git a/Tests/SolidSyslogTimeQualitySdTest.cpp b/Tests/SolidSyslogTimeQualitySdTest.cpp index c1e2cb37..79bc9058 100644 --- a/Tests/SolidSyslogTimeQualitySdTest.cpp +++ b/Tests/SolidSyslogTimeQualitySdTest.cpp @@ -160,10 +160,10 @@ TEST(SolidSyslogTimeQualitySd, FormatAdvancesLengthWithSyncAccuracy) TEST(SolidSyslogTimeQualitySd, DestroyDoesNotCrash) { - // Covered by teardown — this test documents the intent + // Covered by teardown - this test documents the intent } -// Pool tests — prove SOLIDSYSLOG_TIME_QUALITY_SD_POOL_SIZE caps live +// Pool tests - prove SOLIDSYSLOG_TIME_QUALITY_SD_POOL_SIZE caps live // instances and overflow falls back to the shared SolidSyslogNullSd. // clang-format off @@ -231,7 +231,7 @@ TEST(SolidSyslogTimeQualitySdPool, FillingPoolThenOverflowReturnsDistinctFallbac } } -// Bad-setup test — SolidSyslogTimeQualitySd_Create rejects NULL callback and +// Bad-setup test - SolidSyslogTimeQualitySd_Create rejects NULL callback and // routes to NullSd. // clang-format off diff --git a/Tests/SolidSyslogTimestampFormatterTest.cpp b/Tests/SolidSyslogTimestampFormatterTest.cpp index cea9ae69..096fd9cb 100644 --- a/Tests/SolidSyslogTimestampFormatterTest.cpp +++ b/Tests/SolidSyslogTimestampFormatterTest.cpp @@ -43,7 +43,7 @@ TEST_GROUP(SolidSyslogTimestampFormatter) }; // A full-string oracle on the canonical value proves every separator and -// every zero-padded field at once — strictly stronger than per-field checks. +// every zero-padded field at once - strictly stronger than per-field checks. TEST(SolidSyslogTimestampFormatter, FormatsValidTimestampAsRfc3339WithZuluOffset) { format(); diff --git a/Tests/SolidSyslogUdpPayloadTest.cpp b/Tests/SolidSyslogUdpPayloadTest.cpp index a92c6ce8..74f91e04 100644 --- a/Tests/SolidSyslogUdpPayloadTest.cpp +++ b/Tests/SolidSyslogUdpPayloadTest.cpp @@ -76,7 +76,7 @@ TEST(SolidSyslogUdpPayload, TrimToCodepointBoundaryMidFourByteAfterSecondContinu LONGS_EQUAL(0, SolidSyslogUdpPayload_TrimToCodepointBoundary(buffer, 3)); } -/* Cut exactly on a codepoint boundary — no walk back. */ +/* Cut exactly on a codepoint boundary - no walk back. */ TEST(SolidSyslogUdpPayload, TrimToCodepointBoundaryExactTwoByteBoundary) { const uint8_t buffer[] = {0xC3, 0xA9}; diff --git a/Tests/SolidSyslogUdpSenderTest.cpp b/Tests/SolidSyslogUdpSenderTest.cpp index 3c7bd835..8475acbb 100644 --- a/Tests/SolidSyslogUdpSenderTest.cpp +++ b/Tests/SolidSyslogUdpSenderTest.cpp @@ -73,7 +73,7 @@ static int SpyGetPort() return TEST_DEFAULT_PORT; } -// Endpoint stubs — file-scope because TestEndpoint is a free function that +// Endpoint stubs - file-scope because TestEndpoint is a free function that // the sender invokes via udp->config.Endpoint(). Tests mutate these globals // between Sends to drive endpoint-changed and callback-spy scenarios; the // TEST_BASE resets them in setup so groups don't leak state between tests. @@ -364,7 +364,7 @@ TEST(SolidSyslogUdpSender, ZeroLengthSendPassesThrough) LONGS_EQUAL(0, SocketFake_LastLen()); } -// Destroy tests manage their own sender lifetime — base teardown does +// Destroy tests manage their own sender lifetime - base teardown does // not call SolidSyslogUdpSender_Destroy because tests already did. // clang-format off TEST_GROUP_BASE(SolidSyslogUdpSenderDestroy, UdpSenderTestBase) @@ -680,7 +680,7 @@ TEST(SolidSyslogUdpSenderRetry, OversizeRetryWalksBackToCodepointBoundary) } /* Double-OVERSIZE means the kernel disagreed with its own reported - * MaxPayload — impossible-shouldn't-happen but if it did, returning + * MaxPayload - impossible-shouldn't-happen but if it did, returning * false would loop the buffered algorithm forever on an undeliverable. * Swallow: drop the message and return true so the caller moves on. */ TEST(SolidSyslogUdpSenderRetry, DoubleOversizeReturnsTrueToAvoidPermanentLoop) @@ -708,7 +708,7 @@ TEST(SolidSyslogUdpSenderRetry, ZeroMaxPayloadSkipsRetrySend) CALLED_DATAGRAM_SEND(ONCE); } -/* Trimmed length 0 means the message physically can't fit the path — +/* Trimmed length 0 means the message physically can't fit the path - * looping won't help, so we swallow and report success. The Buffered/ * Service algorithm discards rather than retrying forever. */ TEST(SolidSyslogUdpSenderRetry, ZeroMaxPayloadReturnsTrueToAvoidPermanentLoop) @@ -719,7 +719,7 @@ TEST(SolidSyslogUdpSenderRetry, ZeroMaxPayloadReturnsTrueToAvoidPermanentLoop) } /* Retry sendto failing with non-OVERSIZE error (e.g. ECONNREFUSED on - * connected UDP) is a TRANSIENT condition — return false so the + * connected UDP) is a TRANSIENT condition - return false so the * Buffered/Service algorithm keeps the message for retry. */ TEST(SolidSyslogUdpSenderRetry, RetryFailedNonOversizeReturnsFalse) { @@ -863,7 +863,7 @@ TEST(SolidSyslogUdpSenderBadSetup, SendWithNullBufferReportsErrorAndDoesNotSend) CALLED_FAKE(SocketFake_Sendto, NEVER); } -// Pool tests — prove SOLIDSYSLOG_UDP_SENDER_POOL_SIZE caps live instances +// Pool tests - prove SOLIDSYSLOG_UDP_SENDER_POOL_SIZE caps live instances // and overflow falls back to the shared SolidSyslogNullSender. Generic // pool mechanics (lock counts, per-probe locking, stale-handle warning) // are covered by SolidSyslogPoolAllocatorTest.cpp. @@ -939,7 +939,7 @@ TEST(SolidSyslogUdpSenderPool, ExhaustedCreateReportsError) UNSIGNED_LONGS_EQUAL(SOLIDSYSLOG_UDP_SENDER_ERROR_POOL_EXHAUSTED, ErrorHandlerFake_LastDetail()); } -// Delivery-health tests — same edge-triggered DeliveryHealthy bit as +// Delivery-health tests - same edge-triggered DeliveryHealthy bit as // StreamSender, here observing the SolidSyslogDatagram_SendTo result. The // DatagramFake drives per-call SendTo outcomes; the shared Sender-role // categories key the events while Source distinguishes the UDP transport. diff --git a/Tests/SolidSyslogWindowsClockTest.cpp b/Tests/SolidSyslogWindowsClockTest.cpp index 085debcb..3bb4959e 100644 --- a/Tests/SolidSyslogWindowsClockTest.cpp +++ b/Tests/SolidSyslogWindowsClockTest.cpp @@ -5,7 +5,7 @@ #include -// 2025-04-02T00:00:00Z — matches the POSIX clock test default so timestamps +// 2025-04-02T00:00:00Z - matches the POSIX clock test default so timestamps // behave identically across platforms when the same wall-clock value is faked. static SYSTEMTIME fakeSystemTime; static FILETIME fakeFileTime; @@ -129,7 +129,7 @@ TEST(SolidSyslogWindowsClock, MicrosecondFromHundredNanosecondRemainder) TEST(SolidSyslogWindowsClock, MaxMicrosecondsFromRemainder) { - // 9_999_990 100-ns units → 999_999 microseconds. + // 9_999_990 100-ns units -> 999_999 microseconds. setRawFileTime(9999990, 0); CHECK_MICROSECOND(999999); } @@ -162,7 +162,7 @@ TEST(SolidSyslogWindowsClock, Hour23Minute59Second59) CHECK_SECOND(59); } -// FILETIME epoch is 1601-01-01 — all zeroes map to year 1601. +// FILETIME epoch is 1601-01-01 - all zeroes map to year 1601. TEST(SolidSyslogWindowsClock, ZeroFileTimeProduces1601) { setRawFileTime(0, 0); diff --git a/Tests/SolidSyslogWindowsHostnameTest.cpp b/Tests/SolidSyslogWindowsHostnameTest.cpp index 06f6be77..569cad08 100644 --- a/Tests/SolidSyslogWindowsHostnameTest.cpp +++ b/Tests/SolidSyslogWindowsHostnameTest.cpp @@ -81,7 +81,7 @@ TEST(SolidSyslogWindowsHostname, EmptyHostnameProducesEmptyString) TEST(SolidSyslogWindowsHostname, HostnameTooLongForBufferProducesEmptyString) { // 260-char hostname exceeds the internal 256-char buffer. GetComputerNameExA - // reports ERROR_MORE_DATA → the helper treats this as failure → nothing written. + // reports ERROR_MORE_DATA -> the helper treats this as failure -> nothing written. static char longName[261]; memset(longName, 'x', 260); longName[260] = '\0'; diff --git a/Tests/SolidSyslogWindowsSysUpTimeTest.cpp b/Tests/SolidSyslogWindowsSysUpTimeTest.cpp index 8b75cb22..4ed25945 100644 --- a/Tests/SolidSyslogWindowsSysUpTimeTest.cpp +++ b/Tests/SolidSyslogWindowsSysUpTimeTest.cpp @@ -57,7 +57,7 @@ TEST(SolidSyslogWindowsSysUpTime, MaxUint32Boundary) TEST(SolidSyslogWindowsSysUpTime, WrapsPastMaxUint32) { - // 42,949,672,970 ms / 10 = 4,294,967,297 hundredths = UINT32_MAX + 2 → wraps to 1 + // 42,949,672,970 ms / 10 = 4,294,967,297 hundredths = UINT32_MAX + 2 -> wraps to 1 fakeTickCount = 42949672970ULL; UNSIGNED_LONGS_EQUAL(1, SolidSyslogWindows_GetSysUpTime()); } diff --git a/Tests/SolidSyslogWinsockTcpStreamTest.cpp b/Tests/SolidSyslogWinsockTcpStreamTest.cpp index 056a92af..a77ce6a7 100644 --- a/Tests/SolidSyslogWinsockTcpStreamTest.cpp +++ b/Tests/SolidSyslogWinsockTcpStreamTest.cpp @@ -40,7 +40,7 @@ uint32_t FakeGetConnectTimeoutMs_ReturnValue = 200U; void FakeGetConnectTimeoutMs_Reset() { FakeGetConnectTimeoutMs_CallCount = 0; - FakeGetConnectTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel — overwritten on first call */ + FakeGetConnectTimeoutMs_LastContext = reinterpret_cast(0x1U); /* sentinel - overwritten on first call */ FakeGetConnectTimeoutMs_ReturnValue = 200U; } @@ -225,7 +225,7 @@ TEST(SolidSyslogWinsockTcpStream, OpenClosesSocketOnConnectFailure) } /* ---------------------------------------------------------------------- - * Non-blocking connect with bounded wait — the production path that + * Non-blocking connect with bounded wait - the production path that * keeps the BlockStore service thread's drain rate from being throttled * by Windows' default ~2 s connect()-retry on a refused loopback port. * -------------------------------------------------------------------- */ @@ -234,7 +234,7 @@ TEST(SolidSyslogWinsockTcpStream, OpenSetsNonBlockingMode) { SolidSyslogStream_Open(stream, addr); /* Single FIONBIO call: non-blocking on (1). The socket stays non-blocking - so Send/Read are also fail-fast — no SO_SNDTIMEO needed. */ + so Send/Read are also fail-fast - no SO_SNDTIMEO needed. */ CALLED_FAKE(WinsockFake_Fionbio, ONCE); LONGS_EQUAL(1, WinsockFake_FionbioArgAt(0)); } @@ -258,7 +258,7 @@ TEST(SolidSyslogWinsockTcpStream, OpenPassesBoundedConnectTimeoutToSelect) { WinsockFake_SetConnectFailsWithLastError(WSAEWOULDBLOCK); SolidSyslogStream_Open(stream, addr); - /* Default tunable SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS = 200 → 0 s + 200 000 µs. */ + /* Default tunable SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS = 200 -> 0 s + 200 000 µs. */ LONGS_EQUAL(0, WinsockFake_LastSelectTimeoutSec()); LONGS_EQUAL(200000, WinsockFake_LastSelectTimeoutUsec()); } @@ -343,7 +343,7 @@ TEST(SolidSyslogWinsockTcpStream, OpenReadsSO_ERRORAfterSelectWritable) TEST(SolidSyslogWinsockTcpStream, OpenFailsWhenIoctlsocketFails) { /* If the kernel refuses to put the socket into non-blocking mode the - caller cannot bound the connect wait — fail fast rather than fall + caller cannot bound the connect wait - fail fast rather than fall back to blocking-connect's ~2 s retry behaviour. */ WinsockFake_SetIoctlSocketFails(true); CHECK_FALSE(SolidSyslogStream_Open(stream, addr)); @@ -351,7 +351,7 @@ TEST(SolidSyslogWinsockTcpStream, OpenFailsWhenIoctlsocketFails) TEST(SolidSyslogWinsockTcpStream, OpenFailsWhenConnectFailsImmediatelyWithRefused) { - /* Non-WSAEWOULDBLOCK errors (e.g. WSAECONNREFUSED) are immediate failures — + /* Non-WSAEWOULDBLOCK errors (e.g. WSAECONNREFUSED) are immediate failures - no select wait, no SO_ERROR check, just fail fast. */ WinsockFake_SetConnectFailsWithLastError(WSAECONNREFUSED); CHECK_FALSE(SolidSyslogStream_Open(stream, addr)); diff --git a/Tests/StoreFake.c b/Tests/StoreFake.c index 6fdb77f2..a6ba7225 100644 --- a/Tests/StoreFake.c +++ b/Tests/StoreFake.c @@ -142,7 +142,7 @@ static bool IsHalted(struct SolidSyslogStore* self) return fake->halted; } -/* StoreFake models a real store — a Write rejection is a policy decision, +/* StoreFake models a real store - a Write rejection is a policy decision, * not a "please try elsewhere" signal. Service must not bypass to the * sender on rejection. */ static bool IsTransient(struct SolidSyslogStore* self) diff --git a/Tests/Support/FatFsFakes/Interface/FatFsFake.h b/Tests/Support/FatFsFakes/Interface/FatFsFake.h index c6a9cb9a..e4b9059a 100644 --- a/Tests/Support/FatFsFakes/Interface/FatFsFake.h +++ b/Tests/Support/FatFsFakes/Interface/FatFsFake.h @@ -43,7 +43,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN int FatFsFake_UnlinkCallCount(void); const char* FatFsFake_LastUnlinkPath(void); - /* file size — writes obj.objsize on the last-opened FIL, so f_size(fp) + /* file size - writes obj.objsize on the last-opened FIL, so f_size(fp) * (a macro that dereferences fp->obj.objsize) returns the programmed * value. */ void FatFsFake_SetFileSize(unsigned long size); diff --git a/Tests/Support/FatFsFakes/Interface/ffconf.h b/Tests/Support/FatFsFakes/Interface/ffconf.h index 7226cd7c..afd02eca 100644 --- a/Tests/Support/FatFsFakes/Interface/ffconf.h +++ b/Tests/Support/FatFsFakes/Interface/ffconf.h @@ -2,22 +2,22 @@ * the FatFsFakes. Mirrors the upstream /opt/fatfs/source/ffconf.h * (revision 80386, R0.16) with overrides documented inline. * - * No adapter source compiles against this at S08.05 slice 1 — the + * No adapter source compiles against this at S08.05 slice 1 - the * placeholder Tests/FatFs/SolidSyslogFatFsFileTest only includes ff.h to * prove the include path resolves. First content lands with slice 2. * * The integrator BDD-target ffconf.h lives separately under - * Bdd/Targets/FreeRtos/ — header-configured platform pack, per + * Bdd/Targets/FreeRtos/ - header-configured platform pack, per * project_header_configured_platforms memory. */ -#define FFCONF_DEF 80386 /* Revision ID — must match FF_DEFINED in ff.h */ +#define FFCONF_DEF 80386 /* Revision ID - must match FF_DEFINED in ff.h */ /* Function Configurations */ #define FF_FS_READONLY 0 #define FF_FS_MINIMIZE 0 #define FF_USE_FIND 0 -#define FF_USE_MKFS 0 /* Adapter doesn't format — integrator's job. */ +#define FF_USE_MKFS 0 /* Adapter doesn't format - integrator's job. */ #define FF_USE_FASTSEEK 0 #define FF_USE_EXPAND 0 #define FF_USE_CHMOD 0 @@ -29,7 +29,7 @@ #define FF_STRF_ENCODE 0 /* Locale and Namespace */ -#define FF_CODE_PAGE 437 /* Latin1 — avoids pulling in DBCS sub-tables when LFN=0. */ +#define FF_CODE_PAGE 437 /* Latin1 - avoids pulling in DBCS sub-tables when LFN=0. */ #define FF_USE_LFN 0 #define FF_MAX_LFN 255 #define FF_LFN_UNICODE 0 @@ -52,7 +52,7 @@ /* System */ #define FF_FS_TINY 0 #define FF_FS_EXFAT 0 -#define FF_FS_NORTC 1 /* Skip get_fattime() — fixed-date stamps fine for fakes. */ +#define FF_FS_NORTC 1 /* Skip get_fattime() - fixed-date stamps fine for fakes. */ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2026 diff --git a/Tests/Support/FreeRtosFakes/Interface/FreeRTOSConfig.h b/Tests/Support/FreeRtosFakes/Interface/FreeRTOSConfig.h index 85fd2737..60a08855 100644 --- a/Tests/Support/FreeRtosFakes/Interface/FreeRTOSConfig.h +++ b/Tests/Support/FreeRtosFakes/Interface/FreeRTOSConfig.h @@ -7,7 +7,7 @@ /* Host-suitable FreeRTOSConfig.h for compiling Platform/FreeRtos adapters * against fakes. The values here are chosen so the real FreeRTOS-Kernel - * headers parse cleanly on the host compiler — actual scheduler behaviour + * headers parse cleanly on the host compiler - actual scheduler behaviour * is provided by FreeRtosFakes/Source/, which substitutes the API at link * time. * @@ -35,7 +35,7 @@ #define configUSE_MALLOC_FAILED_HOOK 0 /* Static allocation is required for SolidSyslogFreeRtosMutex - * (xSemaphoreCreateMutexStatic) — caller injects the StaticSemaphore_t-sized + * (xSemaphoreCreateMutexStatic) - caller injects the StaticSemaphore_t-sized * storage rather than the kernel mallocing it. Dynamic stays on so the * test config matches the example, which also uses dynamic allocation for * task / FreeRTOS-Plus-TCP buffers. */ diff --git a/Tests/Support/FreeRtosFakes/Interface/FreeRTOSIPConfig.h b/Tests/Support/FreeRtosFakes/Interface/FreeRTOSIPConfig.h index 0a5de70f..d6820dc9 100644 --- a/Tests/Support/FreeRtosFakes/Interface/FreeRTOSIPConfig.h +++ b/Tests/Support/FreeRtosFakes/Interface/FreeRTOSIPConfig.h @@ -4,7 +4,7 @@ #include "FreeRTOS.h" /* Host-suitable FreeRTOS-Plus-TCP config for unit-test fakes. The IP stack - * itself is never run on the host — these values are only here so the + * itself is never run on the host - these values are only here so the * upstream Plus-TCP headers parse cleanly. Real behaviour comes from * FreeRtosFakes/Source/, which substitutes the API at link time. */ diff --git a/Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h b/Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h index dea33bf6..4f33eecf 100644 --- a/Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h +++ b/Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h @@ -45,7 +45,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN const struct freertos_sockaddr* FreeRtosSocketsFake_LastConnectAddress(void); socklen_t FreeRtosSocketsFake_LastConnectAddressLength(void); /* Snapshot of SO_SNDTIMEO / SO_RCVTIMEO observed at the moment - * FreeRTOS_connect was called — proves the bounded-connect contract + * FreeRTOS_connect was called - proves the bounded-connect contract * (timeouts set before connect, cleared after). 0 if connect was never * called. SO_RCVTIMEO is what FreeRTOS_connect actually honours; both * are tracked because we set both as belt-and-braces. */ diff --git a/Tests/Support/FreeRtosFakes/Interface/pack_struct_end.h b/Tests/Support/FreeRtosFakes/Interface/pack_struct_end.h index b954a8a3..75adda05 100644 --- a/Tests/Support/FreeRtosFakes/Interface/pack_struct_end.h +++ b/Tests/Support/FreeRtosFakes/Interface/pack_struct_end.h @@ -3,7 +3,7 @@ * Real Plus-TCP installs ship per-compiler variants under * source/portable/Compiler//. The GCC variant supplies * __attribute__((packed)) here so the preceding struct definition is closed - * with a packing attribute. We provide a compiler-independent ';' instead — + * with a packing attribute. We provide a compiler-independent ';' instead - * it terminates the struct without imposing any packing, which is fine * because tests never run the IP stack and never observe the layout. * diff --git a/Tests/Support/FreeRtosFakes/Interface/portmacro.h b/Tests/Support/FreeRtosFakes/Interface/portmacro.h index 01afac0d..d41cfb7a 100644 --- a/Tests/Support/FreeRtosFakes/Interface/portmacro.h +++ b/Tests/Support/FreeRtosFakes/Interface/portmacro.h @@ -6,7 +6,7 @@ /* Stub of FreeRTOS-Kernel's portmacro.h. * - * The real kernel ships one portmacro.h per port × compiler combination + * The real kernel ships one portmacro.h per port x compiler combination * (e.g. portable/GCC/ARM_CM3/, portable/IAR/ARM_CM3/, portable/ThirdParty/ * GCC/Posix/). Tests must stay independent of which port and which compiler * the integrator's production build will use, so FreeRtosFakes provides @@ -15,14 +15,14 @@ * * No scheduler runs; critical-section / yield / interrupt macros expand to * nothing, and tests never observe context-switch behaviour. The stack-type - * choice doesn't matter — fakes never allocate task stacks. + * choice doesn't matter - fakes never allocate task stacks. */ #include /* Kernel scalar types. BaseType_t / UBaseType_t are typedef'd to long / * unsigned long so they match the host compiler's long width (64-bit on x86_64 - * Linux, 32-bit on a 32-bit host) — that is intentional: the adapter under + * Linux, 32-bit on a 32-bit host) - that is intentional: the adapter under * test never depends on these widths since it stores BaseType_t args verbatim * and forwards them to the fake, and all FreeRTOS socket constants are small * integers that fit any width. Real targets bring their own portmacro.h. */ @@ -39,7 +39,7 @@ typedef uint32_t StackType_t; #define portTICK_TYPE_IS_ATOMIC 1 #define portPOINTER_SIZE_TYPE intptr_t -/* Critical-section / interrupt / yield primitives — no-op for host tests. */ +/* Critical-section / interrupt / yield primitives - no-op for host tests. */ #define portYIELD() ((void) 0) #define portYIELD_FROM_ISR(x) ((void) (x)) #define portENTER_CRITICAL() ((void) 0) diff --git a/Tests/Support/FreeRtosFakes/Source/FreeRtosDnsFake.c b/Tests/Support/FreeRtosFakes/Source/FreeRtosDnsFake.c index 5c631dfa..70382b63 100644 --- a/Tests/Support/FreeRtosFakes/Source/FreeRtosDnsFake.c +++ b/Tests/Support/FreeRtosFakes/Source/FreeRtosDnsFake.c @@ -22,7 +22,7 @@ static BaseType_t lastGetAddrInfoSocktype = 0; * xPrivateStorage.sockaddr is the payload `ai_addr` points at, which is the * shape FreeRTOS-Plus-TCP actually produces (no separate malloc per address). * IPv4 comes from FreeRTOS_inet_addr(node), so tests that pass dotted-quad - * hostnames get back the parsed address with no further wiring — mirrors + * hostnames get back the parsed address with no further wiring - mirrors * SocketFake's inet_pton trick. */ static struct freertos_addrinfo fakeResult; diff --git a/Tests/Support/FreeRtosFakes/Source/FreeRtosSocketsFake.c b/Tests/Support/FreeRtosFakes/Source/FreeRtosSocketsFake.c index bcb24610..1e47742d 100644 --- a/Tests/Support/FreeRtosFakes/Source/FreeRtosSocketsFake.c +++ b/Tests/Support/FreeRtosFakes/Source/FreeRtosSocketsFake.c @@ -57,7 +57,7 @@ static TickType_t rcvTimeoAtConnect = 0; static unsigned closesocketCallCount = 0; static Socket_t lastClosesocketSocket = NULL; -/* Sentinel used as a "valid" Socket_t return — non-NULL and not +/* Sentinel used as a "valid" Socket_t return - non-NULL and not * FREERTOS_INVALID_SOCKET. Adapters only inspect Open's return for * the invalid sentinel; any other non-zero pointer is treated as success. */ static int fakeSocketHandleAnchor = 0; diff --git a/Tests/Support/LwipFakes/Interface/LwipDnsFake.h b/Tests/Support/LwipFakes/Interface/LwipDnsFake.h index 1f56472a..8e6069ba 100644 --- a/Tests/Support/LwipFakes/Interface/LwipDnsFake.h +++ b/Tests/Support/LwipFakes/Interface/LwipDnsFake.h @@ -29,12 +29,12 @@ SOLIDSYSLOG_EXTERN_C_BEGIN ip_addr_t* LwipDnsFake_LastAddrOut(void); /* True between an ERR_INPROGRESS dns_gethostbyname and the matching - * FireCallback — i.e. a dns_found_callback is stored and not yet fired. */ + * FireCallback - i.e. a dns_found_callback is stored and not yet fired. */ bool LwipDnsFake_HasPendingCallback(void); /* Fires the stored dns_found_callback (the async completion). Pass a * non-NULL ipaddr to deliver a resolved address, or NULL to deliver a - * lookup failure — mirroring lwIP's contract. The host stand-in for the + * lookup failure - mirroring lwIP's contract. The host stand-in for the * tcpip thread firing the callback while the caller spins; tests drive it * from their injected Sleep. */ void LwipDnsFake_FireCallback(const ip_addr_t* ipaddr); diff --git a/Tests/Support/LwipFakes/Interface/LwipFakeMarshalGuard.h b/Tests/Support/LwipFakes/Interface/LwipFakeMarshalGuard.h index eb2657d6..68b92c4d 100644 --- a/Tests/Support/LwipFakes/Interface/LwipFakeMarshalGuard.h +++ b/Tests/Support/LwipFakes/Interface/LwipFakeMarshalGuard.h @@ -15,7 +15,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN * surfaced by LwipFakeMarshalGuard_CheckNoBreach() at teardown. * * Why record-then-check rather than fail at the call site: the fakes are - * C, and CppUTest aborts a test by throwing / longjmp — unwinding through + * C, and CppUTest aborts a test by throwing / longjmp - unwinding through * C frames is undefined. Recording the breach and failing in the C++ * teardown is robust, and the captured file/line still points the reader * straight at the offending lwIP call. */ diff --git a/Tests/Support/LwipFakes/Interface/LwipPbufFake.h b/Tests/Support/LwipFakes/Interface/LwipPbufFake.h index 5a32af6e..0c89e1b6 100644 --- a/Tests/Support/LwipFakes/Interface/LwipPbufFake.h +++ b/Tests/Support/LwipFakes/Interface/LwipPbufFake.h @@ -24,11 +24,11 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Allocated-but-not-yet-freed pbuf count. Successful pbuf_alloc bumps it; * pbuf_free decrements. A test that ends with a non-zero value has - * leaked a pbuf — pin this in teardown to catch leaks across the suite. */ + * leaked a pbuf - pin this in teardown to catch leaks across the suite. */ int LwipPbufFake_OutstandingPbufCount(void); /* RX-side helper: pbufs handed to the wrapper via the tcp_recv callback - * come from lwIP's machinery, not our pbuf_alloc — but the wrapper still + * come from lwIP's machinery, not our pbuf_alloc - but the wrapper still * pbuf_free's them when fully drained. Tests fabricate stack pbufs and * call this to balance the outstanding count so the leak invariant * stays honest. */ diff --git a/Tests/Support/LwipFakes/Interface/LwipTcpFake.h b/Tests/Support/LwipFakes/Interface/LwipTcpFake.h index da2a17a9..fc5c0897 100644 --- a/Tests/Support/LwipFakes/Interface/LwipTcpFake.h +++ b/Tests/Support/LwipFakes/Interface/LwipTcpFake.h @@ -18,11 +18,11 @@ SOLIDSYSLOG_EXTERN_C_BEGIN unsigned LwipTcpFake_TcpNewCallCount(void); struct tcp_pcb* LwipTcpFake_LastTcpNewReturned(void); - /* tcp_arg spy — last (pcb, arg) pair captured */ + /* tcp_arg spy - last (pcb, arg) pair captured */ unsigned LwipTcpFake_TcpArgCallCount(void); void* LwipTcpFake_LastCallbackArg(void); - /* tcp_recv / tcp_err / tcp_sent spies — last registered callback fn captured */ + /* tcp_recv / tcp_err / tcp_sent spies - last registered callback fn captured */ unsigned LwipTcpFake_TcpRecvCallCount(void); tcp_recv_fn LwipTcpFake_LastRecvFn(void); unsigned LwipTcpFake_TcpErrCallCount(void); @@ -34,7 +34,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void LwipTcpFake_SetTcpConnectError(int8_t err); /* Whether tcp_connect synchronously invokes the registered connected_cb - * before returning. Default true — happy-path successful connect. Set to + * before returning. Default true - happy-path successful connect. Set to * false for tests that drive the timeout path (no callback fires). */ void LwipTcpFake_SetConnectCallbackFires(bool fires); @@ -68,14 +68,14 @@ SOLIDSYSLOG_EXTERN_C_BEGIN unsigned LwipTcpFake_TcpOutputCallCount(void); struct tcp_pcb* LwipTcpFake_LastOutputPcb(void); - /* tcp_recved spy — window-update ACK after the wrapper drains bytes */ + /* tcp_recved spy - window-update ACK after the wrapper drains bytes */ unsigned LwipTcpFake_TcpRecvedCallCount(void); struct tcp_pcb* LwipTcpFake_LastRecvedPcb(void); uint16_t LwipTcpFake_LastRecvedLen(void); /* Allocated-but-not-yet-freed PCB count. Successful tcp_new bumps it; * tcp_close / tcp_abort decrement. The tcp_err callback releases the - * pcb upstream — tests that fire it via LwipTcpFake_LastErrFn must call + * pcb upstream - tests that fire it via LwipTcpFake_LastErrFn must call * LwipTcpFake_NotePcbReleasedByErr() to keep the leak invariant honest. */ int LwipTcpFake_OutstandingPcbCount(void); void LwipTcpFake_NotePcbReleasedByErr(void); diff --git a/Tests/Support/LwipFakes/Interface/LwipUdpFake.h b/Tests/Support/LwipFakes/Interface/LwipUdpFake.h index cfcdf80c..abfa7be7 100644 --- a/Tests/Support/LwipFakes/Interface/LwipUdpFake.h +++ b/Tests/Support/LwipFakes/Interface/LwipUdpFake.h @@ -33,7 +33,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Allocated-but-not-yet-freed PCB count. Successful udp_new bumps it; * udp_remove decrements. A test that ends with a non-zero value has - * leaked a PCB — pin this in teardown to catch leaks across the suite. */ + * leaked a PCB - pin this in teardown to catch leaks across the suite. */ int LwipUdpFake_OutstandingPcbCount(void); SOLIDSYSLOG_EXTERN_C_END diff --git a/Tests/Support/LwipFakes/Interface/arch/cc.h b/Tests/Support/LwipFakes/Interface/arch/cc.h index 56794092..8ec26b84 100644 --- a/Tests/Support/LwipFakes/Interface/arch/cc.h +++ b/Tests/Support/LwipFakes/Interface/arch/cc.h @@ -2,7 +2,7 @@ * compile lwIP headers under host GCC / Clang builds: LWIP_PLATFORM_DIAG * / _ASSERT as no-ops so unit tests don't print or abort on traffic- * pattern messages. lwIP's own arch.h supplies u8_t / u16_t / u32_t / - * s8_t / s16_t / s32_t via stdint when we don't redefine them — let it. */ + * s8_t / s16_t / s32_t via stdint when we don't redefine them - let it. */ #ifndef LWIP_ARCH_CC_H #define LWIP_ARCH_CC_H diff --git a/Tests/Support/LwipFakes/Interface/lwipopts.h b/Tests/Support/LwipFakes/Interface/lwipopts.h index 841ab3f7..30061aa5 100644 --- a/Tests/Support/LwipFakes/Interface/lwipopts.h +++ b/Tests/Support/LwipFakes/Interface/lwipopts.h @@ -1,12 +1,12 @@ /* Host-side test config for lwIP. Trimmed to the minimum that lets the * SolidSyslogLwipRaw* wrappers compile and exercise their unit tests: - * - NO_SYS=1 — no OS abstraction (LwipRaw is OS-agnostic by construction) - * - LWIP_RAW / UDP / TCP on — the three APIs the wrappers use - * - LWIP_DNS on — exposes lwip/dns.h (dns_gethostbyname, dns_found_callback) + * - NO_SYS=1 - no OS abstraction (LwipRaw is OS-agnostic by construction) + * - LWIP_RAW / UDP / TCP on - the three APIs the wrappers use + * - LWIP_DNS on - exposes lwip/dns.h (dns_gethostbyname, dns_found_callback) * so the LwipDnsFake can define them for SolidSyslogLwipRawDnsResolver tests. * No real dns.c is compiled into any host test exe; the fake supplies the * symbols. The numeric SolidSyslogLwipRawResolver ignores DNS entirely. - * - MEM_LIBC_MALLOC=1 — host tests can use libc; production wrappers + * - MEM_LIBC_MALLOC=1 - host tests can use libc; production wrappers * must not depend on lwIP's mem pool. */ #ifndef SOLIDSYSLOG_TEST_LWIPOPTS_H #define SOLIDSYSLOG_TEST_LWIPOPTS_H diff --git a/Tests/Support/LwipFakes/Source/LwipDnsFake.c b/Tests/Support/LwipFakes/Source/LwipDnsFake.c index 9a1476cd..4f6b065a 100644 --- a/Tests/Support/LwipFakes/Source/LwipDnsFake.c +++ b/Tests/Support/LwipFakes/Source/LwipDnsFake.c @@ -85,7 +85,7 @@ err_t dns_gethostbyname(const char* hostname, ip_addr_t* addr, dns_found_callbac } else { - /* ERR_ARG / other immediate rejection — no callback stored. */ + /* ERR_ARG / other immediate rejection - no callback stored. */ } return getHostByNameResult; } diff --git a/Tests/Support/MbedTlsFake.c b/Tests/Support/MbedTlsFake.c index bb86fd7e..31e85b76 100644 --- a/Tests/Support/MbedTlsFake.c +++ b/Tests/Support/MbedTlsFake.c @@ -20,7 +20,7 @@ enum MBEDTLSFAKE_MAX_INPUT = 256 }; -/* AES-256-GCM capture double — see header. */ +/* AES-256-GCM capture double - see header. */ enum { MBEDTLSFAKE_GCM_KEY_SIZE = 32, @@ -64,7 +64,7 @@ static const void* lastPlatformZeroizeBuf; static size_t lastPlatformZeroizeLen; /* ------------------------------------------------------------------------- - * Captured state — one section per mbedTLS API call. Tests read these via + * Captured state - one section per mbedTLS API call. Tests read these via * accessors below; production reaches libmbedtls through the link-interposed * functions at the bottom of the file. * ------------------------------------------------------------------------- */ @@ -704,10 +704,10 @@ void mbedtls_ssl_conf_rng(mbedtls_ssl_config* conf, int (*f_rng)(void*, unsigned lastSslConfRngContextArg = p_rng; } -/* Capture double — two callers. The TLS stream wires this by address into +/* Capture double - two callers. The TLS stream wires this by address into * mbedtls_ssl_conf_rng and never invokes it at test time; the AES-GCM policy * calls it directly to fill each record's nonce. Captures its arguments and - * fills a deterministic 0xA0, 0xA1, … pattern (mirrors the OpenSslFake + * fills a deterministic 0xA0, 0xA1, ... pattern (mirrors the OpenSslFake * RAND_bytes double) so a seal test can assert the nonce reached the trailer. */ int mbedtls_ctr_drbg_random(void* p_rng, unsigned char* output, size_t output_len) { @@ -786,7 +786,7 @@ size_t MbedTlsFake_LastPlatformZeroizeLen(void) /* Deterministic, NON-cryptographic tag: an FNV-1a fold over the key then the * input then each output position. Sensitive to key, input, and position so a - * changed key, tampered data, or tampered tag all produce a different value — + * changed key, tampered data, or tampered tag all produce a different value - * enough to exercise the policy's round-trip / tamper / wrong-key paths without * linking real libmbedcrypto. */ void MbedTlsFake_ComputeExpectedTag( @@ -848,7 +848,7 @@ void mbedtls_platform_zeroize(void* buf, size_t len) } /* ------------------------------------------------------------------------- - * AES-256-GCM — link-interposed mbedtls_gcm_* + the CTR-DRBG nonce source. + * AES-256-GCM - link-interposed mbedtls_gcm_* + the CTR-DRBG nonce source. * Capture-and-canned-return, NOT a cipher (see header). * ------------------------------------------------------------------------- */ @@ -896,7 +896,7 @@ int mbedtls_gcm_crypt_and_tag( (void) mode; gcmSealCount++; memcpy(lastGcmNonce, iv, (iv_len < sizeof lastGcmNonce) ? iv_len : sizeof lastGcmNonce); - /* Report only what was actually captured — a reader walking LastGcmAad() / + /* Report only what was actually captured - a reader walking LastGcmAad() / * LastGcmPlaintext() up to the reported length then never runs past the * capture buffer if a test exceeds its capacity. */ lastGcmAadLen = (add_len < sizeof lastGcmAad) ? add_len : sizeof lastGcmAad; @@ -904,7 +904,7 @@ int mbedtls_gcm_crypt_and_tag( lastGcmPlaintextLen = (length < sizeof lastGcmPlaintext) ? length : sizeof lastGcmPlaintext; memcpy(lastGcmPlaintext, input, lastGcmPlaintextLen); /* The double does not encrypt: copy input to output unchanged so the - * in-place buffer stays defined (memmove — production passes output == input) + * in-place buffer stays defined (memmove - production passes output == input) * and write a canned all-zero tag the adapter only forwards into the trailer. */ memmove(output, input, length); memset(tag, 0, tag_len); @@ -932,7 +932,7 @@ int mbedtls_gcm_auth_decrypt( lastGcmAadLen = (add_len < sizeof lastGcmAad) ? add_len : sizeof lastGcmAad; memcpy(lastGcmAad, add, lastGcmAadLen); memmove(output, input, length); - /* Canned verdict — real tag verification is the integration suite's job. + /* Canned verdict - real tag verification is the integration suite's job. * SetGcmAuthFails drives the tamper / wrong-key rejection (silent false); * the AUTH_DECRYPT step drives a genuine error (reported DECRYPT_FAILED). */ int result = 0; diff --git a/Tests/Support/MbedTlsFake.h b/Tests/Support/MbedTlsFake.h index e14d42c5..db88e305 100644 --- a/Tests/Support/MbedTlsFake.h +++ b/Tests/Support/MbedTlsFake.h @@ -47,7 +47,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN int MbedTlsFake_SslHandshakeCallCount(void); struct mbedtls_ssl_context* MbedTlsFake_LastSslHandshakeArg(void); void MbedTlsFake_SetSslHandshakeReturn(int value); - /* Per-call return sequence — each handshake invocation gets the next + /* Per-call return sequence - each handshake invocation gets the next * value in `values`; once exhausted, every subsequent call returns the * last entry. Used to drive WANT_READ/WANT_WRITE retry loops. Capped * at MBEDTLSFAKE_MAX_HANDSHAKE_RETURNS (silently truncated). */ @@ -114,7 +114,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void MbedTlsFake_SetMdHmacReturn(int value); /* Computes the same deterministic, non-cryptographic 32-byte tag the fake's - * mbedtls_md_hmac writes — derived from (key, input) so tests can predict the + * mbedtls_md_hmac writes - derived from (key, input) so tests can predict the * tag and exercise round-trip / tamper / wrong-key behaviour. NOT a real HMAC. */ void MbedTlsFake_ComputeExpectedTag( const uint8_t* key, @@ -128,7 +128,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN const void* MbedTlsFake_LastPlatformZeroizeBuf(void); size_t MbedTlsFake_LastPlatformZeroizeLen(void); - /* AES-256-GCM (mbedtls_gcm_*) + CTR-DRBG nonce source — drive the at-rest + /* AES-256-GCM (mbedtls_gcm_*) + CTR-DRBG nonce source - drive the at-rest * AES-GCM SecurityPolicy without linking real libmbedcrypto. A * capture-and-canned-return double, NOT a cipher: mbedtls_gcm_crypt_and_tag / * mbedtls_gcm_auth_decrypt capture their arguments, copy the body through @@ -148,7 +148,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Step of the seal/open sequence to fail, so a test can pin the error path of * each fallible mbedTLS GCM call: setkey, crypt_and_tag (seal), auth_decrypt - * (open, genuine error — distinct from the tamper verdict below). */ + * (open, genuine error - distinct from the tamper verdict below). */ enum MbedTlsFakeGcmStep { MBEDTLSFAKE_GCM_STEP_NONE = 0, @@ -158,11 +158,11 @@ SOLIDSYSLOG_EXTERN_C_BEGIN }; void MbedTlsFake_SetGcmStepFails(enum MbedTlsFakeGcmStep step); - /* Makes mbedtls_gcm_auth_decrypt return MBEDTLS_ERR_GCM_AUTH_FAILED — the + /* Makes mbedtls_gcm_auth_decrypt return MBEDTLS_ERR_GCM_AUTH_FAILED - the * tamper / wrong-key verdict the adapter must surface silently (no report). */ void MbedTlsFake_SetGcmAuthFails(bool fails); - /* mbedtls_ctr_drbg_random — the policy's per-record nonce source. */ + /* mbedtls_ctr_drbg_random - the policy's per-record nonce source. */ int MbedTlsFake_CtrDrbgRandomCallCount(void); const void* MbedTlsFake_LastCtrDrbgRandomContext(void); const void* MbedTlsFake_LastCtrDrbgRandomBuf(void); diff --git a/Tests/Support/MqFake.c b/Tests/Support/MqFake.c index 42816953..b79d666e 100644 --- a/Tests/Support/MqFake.c +++ b/Tests/Support/MqFake.c @@ -274,7 +274,7 @@ mqd_t mq_open(const char* name, int oflag, ...) { va_list ap; va_start(ap, oflag); - (void) va_arg(ap, mode_t); /* mode — unused by fake */ + (void) va_arg(ap, mode_t); /* mode - unused by fake */ const struct mq_attr* attr = va_arg(ap, struct mq_attr*); va_end(ap); if (attr != NULL) diff --git a/Tests/Support/MqFake.h b/Tests/Support/MqFake.h index 49eb4bb1..a7a84945 100644 --- a/Tests/Support/MqFake.h +++ b/Tests/Support/MqFake.h @@ -10,7 +10,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void MqFake_Reset(void); - /* open configuration — one-shot, consumed by the next mq_open call */ + /* open configuration - one-shot, consumed by the next mq_open call */ void MqFake_FailNextOpen(int errnoValue); int MqFake_OpenCallCount(void); @@ -20,7 +20,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN size_t MqFake_LastOpenMaxMessageSize(void); const char* MqFake_OpenNameAt(int callIndex); - /* send configuration — one-shot, consumed by the next mq_send call */ + /* send configuration - one-shot, consumed by the next mq_send call */ void MqFake_FailNextSend(int errnoValue); int MqFake_SendCallCount(void); @@ -28,7 +28,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN const char* MqFake_LastSendBufAsString(void); size_t MqFake_LastSendLen(void); - /* receive configuration — one-shot, consumed by the next mq_receive call */ + /* receive configuration - one-shot, consumed by the next mq_receive call */ void MqFake_FailNextReceive(int errnoValue); int MqFake_ReceiveCallCount(void); diff --git a/Tests/Support/OpenSslFake.c b/Tests/Support/OpenSslFake.c index 17fc8fb0..b2890919 100644 --- a/Tests/Support/OpenSslFake.c +++ b/Tests/Support/OpenSslFake.c @@ -13,12 +13,12 @@ #include /* ------------------------------------------------------------------------- - * Captured state — one section per OpenSSL API call. Tests read these via + * Captured state - one section per OpenSSL API call. Tests read these via * accessors below; production reaches libssl through the link-interposed * functions at the bottom of the file. * ------------------------------------------------------------------------- */ -/* Sentinel storage for opaque OpenSSL types — our fake returns stable +/* Sentinel storage for opaque OpenSSL types - our fake returns stable * pointers to these so tests can assert pointer-chain plumbing with * POINTERS_EQUAL. */ static char fakeCtxStorage; @@ -27,7 +27,7 @@ static char fakeSslStorage; static char fakeBioMethStorage; static char fakeSha256Storage; -/* HMAC / EVP_sha256 / OPENSSL_cleanse capture — backs the at-rest +/* HMAC / EVP_sha256 / OPENSSL_cleanse capture - backs the at-rest * HMAC-SHA256 SecurityPolicy tests. */ enum { @@ -47,14 +47,14 @@ static int cleanseCallCount; static const void* lastCleanseBuf; static size_t lastCleanseLen; -/* AES-256-GCM fake — a capture-and-canned-return test double, NOT a cipher. The +/* AES-256-GCM fake - a capture-and-canned-return test double, NOT a cipher. The * production policy is a thin adapter that shuttles bytes through the EVP_* * sequence; the unit tests verify that wiring (which key, nonce, AAD and * plaintext reach OpenSSL, in what order, and how success/failure propagate). * The EVP calls therefore capture their arguments and return canned results: * Encrypt/DecryptUpdate copy input to output unchanged, GET_TAG writes a fixed * tag, and DecryptFinal returns a settable verdict. Genuine AES-256-GCM - * correctness — round-trip, tamper detection, wrong-key rejection — is owned by + * correctness - round-trip, tamper detection, wrong-key rejection - is owned by * the OpenSslIntegration suite against real libcrypto. */ enum { @@ -67,7 +67,7 @@ enum /* A single direction flag is all the state the double needs: the production code * allocates one EVP context per seal or open, uses it, and frees it before the - * next — never two at once. The flag lets Update capture the plaintext only on + * next - never two at once. The flag lets Update capture the plaintext only on * encrypt. The handle is a char sentinel (like the SSL/BIO fakes). */ static bool fakeGcmEncrypting; static char fakeGcmCtxStorage; @@ -247,7 +247,7 @@ static SSL_CTX* lastCheckPrivateKeyCtxArg; static bool checkPrivateKeyFails; /* ------------------------------------------------------------------------- - * Reset — zero every captured value. + * Reset - zero every captured value. * ------------------------------------------------------------------------- */ void OpenSslFake_Reset(void) @@ -372,7 +372,7 @@ void OpenSslFake_Reset(void) } /* ------------------------------------------------------------------------- - * Accessors — grouped by the OpenSSL function they describe. + * Accessors - grouped by the OpenSSL function they describe. * ------------------------------------------------------------------------- */ int OpenSslFake_CtxNewCallCount(void) @@ -626,7 +626,7 @@ SSL_CTX* OpenSslFake_LastCtxFreeCtxArg(void) } /* ------------------------------------------------------------------------- - * Link-time substitution for OpenSSL — replaces libssl symbols in the test + * Link-time substitution for OpenSSL - replaces libssl symbols in the test * binary. Production links real libssl; tests never link -lssl. * Each function records its args for test assertion. Return values are * plausible-success stubs; where behaviour needs switching for failure-path @@ -1107,7 +1107,7 @@ void OpenSslFake_SetCheckPrivateKeyFails(bool fails) /* Deterministic, NON-cryptographic tag: an FNV-1a fold over the key then the * input then each output position. Sensitive to key, input, and position so a - * changed key, tampered data, or tampered tag all produce a different value — + * changed key, tampered data, or tampered tag all produce a different value - * enough to exercise the policy's round-trip / tamper / wrong-key paths without * linking real libcrypto. */ void OpenSslFake_ComputeExpectedTag( @@ -1228,7 +1228,7 @@ size_t OpenSslFake_LastCleanseLen(void) } /* ------------------------------------------------------------------------- - * AES-256-GCM — link-interposed EVP cipher + RAND_bytes. + * AES-256-GCM - link-interposed EVP cipher + RAND_bytes. * ------------------------------------------------------------------------- */ static int FakeGcm_Init(const EVP_CIPHER* cipher, const unsigned char* key, const unsigned char* iv, bool encrypting) @@ -1255,7 +1255,7 @@ static int FakeGcm_Update(unsigned char* out, int* outl, const unsigned char* in enum OpenSslFakeGcmStep step = OPENSSLFAKE_GCM_STEP_UPDATE_BODY; if (out == NULL) { - /* Associated data — captured, never transformed. */ + /* Associated data - captured, never transformed. */ lastGcmAadLen = length; memcpy(lastGcmAad, in, (length < sizeof lastGcmAad) ? length : sizeof lastGcmAad); step = OPENSSLFAKE_GCM_STEP_UPDATE_AAD; @@ -1347,7 +1347,7 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX* ctx, unsigned char* outm, int* outl) (void) outm; *outl = 0; gcmOpenCount++; - /* Canned authentication verdict — real tag verification is the integration + /* Canned authentication verdict - real tag verification is the integration * suite's job. A FINAL-step failure drives the tamper-rejected path * (DecryptFinal returns 0), which the adapter must surface silently. */ return (gcmFailStep == OPENSSLFAKE_GCM_STEP_FINAL) ? 0 : 1; @@ -1361,7 +1361,7 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX* ctx, int type, int arg, void* ptr) if (type == EVP_CTRL_GCM_GET_TAG) { gcmSealCount++; - /* Canned tag — the adapter only forwards these bytes into the trailer; it + /* Canned tag - the adapter only forwards these bytes into the trailer; it * never inspects them and no unit test asserts their value. */ memset(ptr, 0, FAKE_GCM_TAG_SIZE); result = (gcmFailStep == OPENSSLFAKE_GCM_STEP_GET_TAG) ? 0 : 1; diff --git a/Tests/Support/OpenSslFake.h b/Tests/Support/OpenSslFake.h index 66f0a5e9..573e1ec4 100644 --- a/Tests/Support/OpenSslFake.h +++ b/Tests/Support/OpenSslFake.h @@ -3,11 +3,11 @@ #include "SolidSyslogExternC.h" -#include // IWYU pragma: keep — dual-use header (C and C++ TUs); IWYU only sees the C++ side and would drop this. +#include // IWYU pragma: keep - dual-use header (C and C++ TUs); IWYU only sees the C++ side and would drop this. #include #include -/* Forward-declared OpenSSL types — full definitions live in . */ +/* Forward-declared OpenSSL types - full definitions live in . */ struct ssl_ctx_st; struct ssl_st; struct ssl_method_st; @@ -30,7 +30,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void OpenSslFake_SetBioNewFails(bool fails); void OpenSslFake_SetCipherListFails(bool fails); - /* SSL return-value injection — drive non-blocking I/O paths */ + /* SSL return-value injection - drive non-blocking I/O paths */ enum { OPENSSLFAKE_MAX_CONNECT_RETURNS = 8 @@ -97,7 +97,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct bio_st* OpenSslFake_LastSetBioReadBioArg(void); struct bio_st* OpenSslFake_LastSetBioWriteBioArg(void); - /* SSL_ctrl (SET_TLSEXT_HOSTNAME path — SNI) */ + /* SSL_ctrl (SET_TLSEXT_HOSTNAME path - SNI) */ struct ssl_st* OpenSslFake_LastSslCtrlSslArg(void); const char* OpenSslFake_LastSniHostname(void); @@ -141,7 +141,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN struct ssl_ctx_st* OpenSslFake_LastCheckPrivateKeyCtxArg(void); void OpenSslFake_SetCheckPrivateKeyFails(bool fails); - /* HMAC / EVP_sha256 / OPENSSL_cleanse — drive the at-rest HMAC-SHA256 + /* HMAC / EVP_sha256 / OPENSSL_cleanse - drive the at-rest HMAC-SHA256 * SecurityPolicy without linking real libcrypto. */ int OpenSslFake_HmacCallCount(void); const void* OpenSslFake_LastHmacMd(void); /* compare against EVP_sha256() to assert SHA-256 was selected */ @@ -152,7 +152,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void OpenSslFake_SetHmacFails(bool fails); /* Computes the same deterministic, non-cryptographic 32-byte tag the fake's - * HMAC writes — derived from (key, input) so tests can predict the tag and + * HMAC writes - derived from (key, input) so tests can predict the tag and * exercise round-trip / tamper / wrong-key behaviour. NOT a real HMAC. */ void OpenSslFake_ComputeExpectedTag( const uint8_t* key, @@ -166,7 +166,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN const void* OpenSslFake_LastCleanseBuf(void); size_t OpenSslFake_LastCleanseLen(void); - /* AES-256-GCM EVP cipher + RAND_bytes — drive the at-rest AES-GCM + /* AES-256-GCM EVP cipher + RAND_bytes - drive the at-rest AES-GCM * SecurityPolicy without linking real libcrypto. A capture-and-canned-return * double, NOT a cipher: the EVP calls capture their arguments, copy the body * through unchanged, and return canned results. It verifies the adapter's @@ -183,8 +183,8 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* Step of the EVP seal/open sequence to fail, so a test can pin the error * path of each OpenSSL crypto call the adapter makes. The names match the - * production && chain: CTX_NEW → INIT_CIPHER → SET_IVLEN → INIT_KEY → - * UPDATE_AAD → UPDATE_BODY → (encrypt: FINAL → GET_TAG) / (decrypt: SET_TAG → + * production && chain: CTX_NEW -> INIT_CIPHER -> SET_IVLEN -> INIT_KEY -> + * UPDATE_AAD -> UPDATE_BODY -> (encrypt: FINAL -> GET_TAG) / (decrypt: SET_TAG -> * FINAL). A FINAL failure on open is the tamper/auth-reject verdict. */ enum OpenSslFakeGcmStep { diff --git a/Tests/Support/PlusFatFakes/Interface/FreeRTOSFATConfig.h b/Tests/Support/PlusFatFakes/Interface/FreeRTOSFATConfig.h index 8d35936a..dfe2caa2 100644 --- a/Tests/Support/PlusFatFakes/Interface/FreeRTOSFATConfig.h +++ b/Tests/Support/PlusFatFakes/Interface/FreeRTOSFATConfig.h @@ -3,8 +3,8 @@ * Plus-FAT is header-configured: ff_headers.h includes this file (after * FreeRTOS.h) and FreeRTOSFATConfigDefaults.h fills in every value not set * here. The three settings below are the minimum the defaults header demands - * — byte order, a thread-local-storage slot for the CWD, and a portINLINE - * fallback for the host compiler — matching Plus-FAT's own DefaultConf sample. + * - byte order, a thread-local-storage slot for the CWD, and a portINLINE + * fallback for the host compiler - matching Plus-FAT's own DefaultConf sample. * * Note: configNUM_THREAD_LOCAL_STORAGE_POINTERS (which ff_stdio.h requires to * be >= 3) is a kernel setting and so lives in FreeRtosFakes/FreeRTOSConfig.h, diff --git a/Tests/Support/PlusFatFakes/Source/PlusFatFake.c b/Tests/Support/PlusFatFakes/Source/PlusFatFake.c index 6f6eebb2..756e1fbb 100644 --- a/Tests/Support/PlusFatFakes/Source/PlusFatFake.c +++ b/Tests/Support/PlusFatFakes/Source/PlusFatFake.c @@ -18,7 +18,7 @@ static FF_FILE fakeFile; /* Backing store for the FreeRTOS thread-local pointers that Plus-FAT's ff_stdio * layer uses to hold the task errno (stdioSET_ERRNO / stdioGET_ERRNO). The host * link has no kernel, so the fake supplies these two kernel entry points over a - * plain array — this is how the adapter's stdioGET_ERRNO() reads back the errno + * plain array - this is how the adapter's stdioGET_ERRNO() reads back the errno * the fake's ff_fopen leaves behind. */ static void* threadLocalStorage[configNUM_THREAD_LOCAL_STORAGE_POINTERS]; @@ -259,7 +259,7 @@ size_t ff_fwrite(const void* pvBuffer, size_t xSize, size_t xItems, FF_FILE* pxS void PlusFatFake_SetFlushCacheFails(void) { - /* Any error code with the FF_ERRFLAG bit set is non-FF_ERR_NONE — the + /* Any error code with the FF_ERRFLAG bit set is non-FF_ERR_NONE - the * adapter treats it as a flush failure. */ flushCacheResult = (int) (FF_ERR_IOMAN_DRIVER_FATAL_ERROR | FF_ERRFLAG); } diff --git a/Tests/Support/SocketFake.h b/Tests/Support/SocketFake.h index 5f876ebd..5b7b0d10 100644 --- a/Tests/Support/SocketFake.h +++ b/Tests/Support/SocketFake.h @@ -66,7 +66,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN /* getsockopt configuration (models IPPROTO_IP / IP_MTU and SOL_SOCKET / SO_ERROR) */ void SocketFake_SetIpMtu(int mtu); void SocketFake_SetIpMtuLookupFails(bool fails); - /* SOL_SOCKET / SO_ERROR — read by the non-blocking-connect completion path. + /* SOL_SOCKET / SO_ERROR - read by the non-blocking-connect completion path. Defaults to 0 (success) until set. */ void SocketFake_SetSoError(int err); void SocketFake_SetSoErrorLookupFails(bool fails); @@ -83,13 +83,13 @@ SOLIDSYSLOG_EXTERN_C_BEGIN int SocketFake_LastFcntlSetFlags(void); bool SocketFake_FcntlSetFlSetNonBlocking(void); - /* select configuration — three independent simulations: + /* select configuration - three independent simulations: (1) successful non-blocking-connect completion: SetSelectWritable(true) - plus SetSoError(0) — fd is writable, SO_ERROR is clear. + plus SetSoError(0) - fd is writable, SO_ERROR is clear. (2) deferred connect failure (typical "connection refused" path on - POSIX): SetSelectWritable(true) plus SetSoError(ECONNREFUSED) — + POSIX): SetSelectWritable(true) plus SetSoError(ECONNREFUSED) - the fd appears writable, getsockopt(SO_ERROR) reveals the error. - (3) select() reporting fd in exceptfds: SetSelectError(true) — the + (3) select() reporting fd in exceptfds: SetSelectError(true) - the production path additionally rejects fds in the exception set via FD_ISSET on errorSet, even though typical kernels surface connect failures via simulation (2) rather than exceptfds. diff --git a/Tests/Support/TestUtils.h b/Tests/Support/TestUtils.h index 9be3184e..b13e916c 100644 --- a/Tests/Support/TestUtils.h +++ b/Tests/Support/TestUtils.h @@ -5,7 +5,7 @@ namespace CososoTesting { -/* Expected call counts — readable names for CALLED_FUNCTION assertions. +/* Expected call counts - readable names for CALLED_FUNCTION assertions. * Namespaced because NEVER/ONCE are common identifiers that could collide * at include sites. Tests opt in via `using namespace CososoTesting;`. */ enum @@ -37,8 +37,8 @@ enum #define CALLED_FAKE_ON(getter, instance, count) LONGS_EQUAL((count), getter##CallCount(instance)) /* Assert the last error event captured by ErrorHandlerFake matches an expected - * (source, category, detail) triple. Prefer the portable Category — it survives - * a backend swap — over the per-class Detail code when a portable reaction is + * (source, category, detail) triple. Prefer the portable Category - it survives + * a backend swap - over the per-class Detail code when a portable reaction is * the thing under test. Use at a site that includes "ErrorHandlerFake.h". */ #define CHECK_ERROR_EVENT(expectedSource, expectedCategory, expectedDetail) \ { \ diff --git a/Tests/Support/WinsockFake.h b/Tests/Support/WinsockFake.h index 2f1227d4..53dea7cb 100644 --- a/Tests/Support/WinsockFake.h +++ b/Tests/Support/WinsockFake.h @@ -72,7 +72,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN void WinsockFake_SetIpMtu(int mtu); void WinsockFake_SetIpMtuLookupFails(bool fails); - /* SOL_SOCKET / SO_ERROR — read by the non-blocking-connect completion + /* SOL_SOCKET / SO_ERROR - read by the non-blocking-connect completion path. Defaults to 0 (success) until set. */ void WinsockFake_SetSoError(int err); void WinsockFake_SetSoErrorLookupFails(bool fails); @@ -97,7 +97,7 @@ SOLIDSYSLOG_EXTERN_C_BEGIN int WinsockFake_IoctlSocketCallCount(void); SOCKET WinsockFake_LastIoctlSocketFd(void); long WinsockFake_LastIoctlSocketCmd(void); - /* Last argp value written into ioctlsocket — for FIONBIO this is the + /* Last argp value written into ioctlsocket - for FIONBIO this is the non-blocking flag (1 = non-blocking, 0 = blocking). */ u_long WinsockFake_LastIoctlSocketArg(void); /* All recorded ioctlsocket FIONBIO arg values, in call order, so tests @@ -119,10 +119,10 @@ SOLIDSYSLOG_EXTERN_C_BEGIN long WinsockFake_LastSelectTimeoutSec(void); long WinsockFake_LastSelectTimeoutUsec(void); - /* WSAGetLastError shim — defaults to whatever WSASetLastError set. */ + /* WSAGetLastError shim - defaults to whatever WSASetLastError set. */ int WSAAPI WinsockFake_WSAGetLastError(void); - /* Fake Winsock functions — injected into production via UT_PTR_SET. */ + /* Fake Winsock functions - injected into production via UT_PTR_SET. */ SOCKET WSAAPI WinsockFake_socket(int af, int type, int protocol); int WSAAPI WinsockFake_sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen); int WSAAPI WinsockFake_connect(SOCKET s, const struct sockaddr* name, int namelen); diff --git a/ci/consumer-smoke/config-gates-off/arch/cc.h b/ci/consumer-smoke/config-gates-off/arch/cc.h index 8575ea80..c193fadf 100644 --- a/ci/consumer-smoke/config-gates-off/arch/cc.h +++ b/ci/consumer-smoke/config-gates-off/arch/cc.h @@ -4,7 +4,7 @@ * u8_t / u16_t / u32_t from when they are not redefined, so newlib * on arm-none-eabi covers the types and only the hooks are left. * - * This image is compiled, never run — LWIP_RAND is a constant rather than an + * This image is compiled, never run - LWIP_RAND is a constant rather than an * entropy source because nothing in the lane opens a connection. A deployed * target must supply a real one; see Bdd/Targets/FreeRtosLwip/arch/cc.h. */ #ifndef SOLIDSYSLOG_CONSUMER_SMOKE_ARCH_CC_H diff --git a/ci/consumer-smoke/config/arch/cc.h b/ci/consumer-smoke/config/arch/cc.h index 8575ea80..c193fadf 100644 --- a/ci/consumer-smoke/config/arch/cc.h +++ b/ci/consumer-smoke/config/arch/cc.h @@ -4,7 +4,7 @@ * u8_t / u16_t / u32_t from when they are not redefined, so newlib * on arm-none-eabi covers the types and only the hooks are left. * - * This image is compiled, never run — LWIP_RAND is a constant rather than an + * This image is compiled, never run - LWIP_RAND is a constant rather than an * entropy source because nothing in the lane opens a connection. A deployed * target must supply a real one; see Bdd/Targets/FreeRtosLwip/arch/cc.h. */ #ifndef SOLIDSYSLOG_CONSUMER_SMOKE_ARCH_CC_H diff --git a/ci/consumer-smoke/main.c b/ci/consumer-smoke/main.c index 104590d8..4351be3f 100644 --- a/ci/consumer-smoke/main.c +++ b/ci/consumer-smoke/main.c @@ -1,8 +1,8 @@ /** @file * Consumer smoke test (S30.04): the smallest translation unit that proves an * integrator can include the public headers, call the API and link against the - * SolidSyslog target their FetchContent pulled in. Nothing is delivered — the - * Null buffer swallows the record — because the build, not the behaviour, is + * SolidSyslog target their FetchContent pulled in. Nothing is delivered - the + * Null buffer swallows the record - because the build, not the behaviour, is * what this checks. */ #include "SolidSyslog.h"