pss_message_validate.h
pss_message_validate.h
CRC-32 integrity and field-range validation of SafetyEvent and DecisionRequest.
Part of the SEI client interface. Generated from the header published in safety-core/, release 1.3-26.07.5. The development packages install it in /opt/nvidia/psf/include.
CRC-32 integrity and field-range validation for SafetyEvent and DecisionRequest wire messages.
Pure C with extern “C” linkage so the same object can be linked into C++ host binaries (PSS daemon, PSD, Gateway) and into C firmware builds.
Typical receiver sequence:
pssSafetyEventVerifyCRC()/pssDecisionRequestVerifyCRC()validateSafetyEvent()/validateDecisionRequest()
Typical sender sequence:
- Fill struct fields
pssSafetyEventSetCRC()/pssDecisionRequestSetCRC()
Any component that modifies a struct after CRC computation (e.g. fusion, filtering) must call the SetCRC function again before forwarding.
Functions
pssGetSchemaVersion
pssSetSchemaVersion
pssGetCrc32
pssSetCrc32
pssComputeCRC32
Compute CRC-32 (ISO 3309 / ITU-T V.42, polynomial 0xEDB88320 reflected) over an arbitrary byte buffer.
Returns: CRC-32 value.
pssSafetyEventSetCRC
Set integrity.schemaVersion and compute + store integrity.crc32 for a SafetyEvent.
CRC covers bytes [0 .. offsetof(SafetyEvent, integrity.crc32) - 1], i.e. all fields including schemaVersion but excluding crc32 itself.
pssSafetyEventVerifyCRC
Verify the CRC-32 stored in a received SafetyEvent.
Returns: true if the CRC matches, false otherwise.
pssDecisionRequestSetCRC
Set integrity.schemaVersion and compute + store integrity.crc32 for a DecisionRequest.
pssDecisionRequestVerifyCRC
Verify the CRC-32 stored in a received DecisionRequest.
Returns: true if the CRC matches, false otherwise.
validateSafetyEvent
Validate all fields of a SafetyEvent (including CRC and schema version).
Checks performed:
- Non-NULL pointer
- Schema version == PSS_SCHEMA_VERSION
- CRC-32 integrity
- EventType and ObjectType enum ranges
- confidenceLevel in [0.0f, 1.0f] (NaN is rejected)
- timestamp != 0 (rejects uninitialized events)
- sensorIdentifier NUL-terminated within bounds
- cause within the EventCause enum. An in-range value the receiver does not recognise is accepted deliberately: unknown causes must reach the SDMs, which treat anything other than CAUSE_SAIM_INIT as a genuine failure.
Returns: PSS_VALID (0) on success, or a bitmask of PSS_ERR_* flags indicating which checks failed.
validateDecisionRequest
Validate all fields of a DecisionRequest (including CRC, schema version, and nested FusedSafetyEvent entries).
Checks performed:
- Non-NULL pointer
- Schema version == PSS_SCHEMA_VERSION
- CRC-32 integrity
- sensorDataSummarySize <= MAX_SENSORS_DATA_SUMMARY_SIZE
- OperationalMode range
- Per-sensor
FusedSafetyEventfield validation (types, daemon-owned OPERATIONAL/CRITICAL severity, confidence, timestamp, status, strings, object types) - Populated
SensorDataentries have homogeneous severity so PSD’s first-event routing rule is safe - Explicit critical evidence is not labeled OPERATIONAL
Returns: PSS_VALID (0) on success, or a bitmask of PSS_ERR_* flags.