# IEC60870-Slave product subset Source: repository `IEC60870-Slave/` at baseline `f84855a5`. The source directory is retained as the independent validation baseline. Only this product subset is to be compiled into the replacement product target. No example main is included. Copying is byte-preserving; source hashes are recorded in the directory manifests before local compatibility edits. ## Verification status | Check | Status | | --- | --- | | Original byte provenance | `UPSTREAM.sha256`; independent final 84-file check passed, six controlled source differences | | C99 assertions | 43 original invocations unchanged; independent AC5 true passes / false fails, invalid capacities including SOE128 rejected | | Final compiler diagnostics | Independent AC5 default/compact: 62 translation-unit compilations, RC0 and zero diagnostics; simulator and runtime tests tracked separately | | Static memory / runtime integration | Separate build-verifier and integration task evidence; no board runtime claim | | License | No license grant confirmed; redistribution not authorized by this import | Required scope: APCI transport, GI/CI, spontaneous/periodic measurements, commands, clock synchronization, read, standard parameters and Type200-203. History, recording, file storage and firmware-upgrade backends are not imported; product integrations must reuse existing subsystems. Organizational source import is not a rename; baseline paths remain unchanged. Local edits use the Edit tool only. ## Local patches - Added `common/IEC60870_StaticAssert.h`, included by shared Types and the standalone Net header. In pre-C11 C, each existing assertion expands to a line-unique typedef with array bound `(condition) ? 1 : -1`; false assertions are compile errors. C11 targets retain native assertions. All 43 assertion invocations and their conditions/messages remain unchanged, including SOE=256. - `104/IEC104_TcpServer.c`: two explicit `IEC104_TcpEventType_t` casts when expanding the byte-sized ring header into event validation helpers; no condition, capacity, storage layout or runtime behavior is changed. - `104/IEC104_SendManager.c` and `104/business/IEC104_Spontaneous.c`: convert nonnegative enum range checks to unsigned upper-bound comparisons. Invalid negative values still convert above the valid range and are rejected; AC5 no longer diagnoses pointless unsigned comparisons against zero. - `104/business/IEC104_Command.h`: mask each TYPE_BIT shift count with 15. Selected valid branches already use shifts 0..13; range guards still return zero for unsupported types. This avoids MSVC diagnostics about unsigned underflow in unselected conditional branches, not a proven executed runtime UB. - Added `common/IEC60870_FaultEvent.c` as an exact-copy link dependency of `IEC104_Spontaneous_Publish_Fault_Event`, with Lead authorization. - `UPSTREAM.sha256`: 84 original byte hashes (29 implementations, 54 directory headers and the declarative profile header). Paths are relative to this directory and to `IEC60870-Slave/`; hashes describe upstream bytes, not the six locally patched files. The compatibility header is new and not upstream. - Independent hash/diff and AC5 true/false assertion verification is performed by build-verifier; product integration and simulator build have separate owners. ## License No license grant has been inferred. The baseline license must be checked before redistribution outside this authorized project integration. ## Layout - `common`: shared ASDU, information-object codecs and time representation. - `104`: mature transport and business state machines. - `examples`: DTU declarative point-profile header only, never an example main. The board network backend is a later integration task; importing this subset does not by itself remove dependencies of the current board service. Resource capacities must be measured before adjustment. No assertions, quality gates, stack limits or compiler diagnostics are disabled by this import.