Skip to navigation

NvPSDGatewayContract.hpp

View as Markdown

The gateway’s contract with an SDM: subscribable and mandatory event types, the request-ID range and the records the gateway synthesises. C++.

Part of the NvPSD Gateway 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.

#include "NvPSDGatewayContract.hpp"

Functions

NvPSDGatewayAddMandatoryEventTypes

static inline void NvPSDGatewayAddMandatoryEventTypes(std::unordered_set< EventType > &types);

NvPSDGatewayIsAllowedHealthEventType

static inline bool NvPSDGatewayIsAllowedHealthEventType(uint32_t raw);

NvPSDGatewayBuildRegisteredEventSet

static inline bool NvPSDGatewayBuildRegisteredEventSet(const uint32_t *rawEventTypes, uint8_t count, std::unordered_set< EventType > *outTypes);

NvPSDGatewayClassifyRegr

static inline uint8_t NvPSDGatewayClassifyRegr(const char *buf, size_t n, std::unordered_set< EventType > *outTypes);

NvPSDGatewayIsStatusNoopOnlyRequest

static inline bool NvPSDGatewayIsStatusNoopOnlyRequest(const DecisionRequest &req);

NvPSDGatewayShouldSendDecisionRequest

static inline bool NvPSDGatewayShouldSendDecisionRequest(bool sendFullRequest, uint8_t eventCount, OperationalMode pssMode);

NvPSDGatewayDecisionPacketSendResult

static inline NvPSDGatewayPacketSendResult NvPSDGatewayDecisionPacketSendResult(ssize_t sentBytes);

NvPSDGatewayBuildDecisionRequestPacket

static inline bool NvPSDGatewayBuildDecisionRequestPacket(const DecisionRequest &req, uint64_t gatewayEpoch, uint32_t gatewayTxSeq, NvPSDGatewayDecisionRequestPacket *outPacket);

NvPSDGatewayRequestIdIsSequenceTracked

static inline bool NvPSDGatewayRequestIdIsSequenceTracked(uint32_t requestId);

NvPSDGatewayObservePssRequestId

static inline NvPSDGatewayPssRequestObservation NvPSDGatewayObservePssRequestId(NvPSDGatewayPssSequenceState *state, uint32_t requestId);

NvPSDGatewayShouldForwardObservedPssRequest

static inline bool NvPSDGatewayShouldForwardObservedPssRequest(NvPSDGatewayPssRequestObservation observation);

NvPSDGatewayBuildPssSequenceGapSwFailRequest

static inline bool NvPSDGatewayBuildPssSequenceGapSwFailRequest(const DecisionRequest &current, DecisionRequest *outRequest);

NvPSDGatewayBuildInvalidPssRequestIdSwFailRequest

static inline bool NvPSDGatewayBuildInvalidPssRequestIdSwFailRequest(const DecisionRequest &current, DecisionRequest *outRequest);

NvPSDGatewayRecoveryRecordOwed

static inline bool NvPSDGatewayRecoveryRecordOwed(uint64_t recoveryOwedGen);

NvPSDGatewayRecoveryDebtAfterSend

static inline uint64_t NvPSDGatewayRecoveryDebtAfterSend(uint64_t owedNow, uint64_t sentFor, bool sent);

NvPSDGatewayBuildPssCommRecoveredRequest

static inline bool NvPSDGatewayBuildPssCommRecoveredRequest(const DecisionRequest &current, DecisionRequest *outRequest);

NvPSDGatewayBuildPssErrorSwFailRequest

static inline bool NvPSDGatewayBuildPssErrorSwFailRequest(const DecisionRequest &current, DecisionRequest *outRequest);

Types

NvPSDGatewayRegrRateLimiter

class NvPSDGatewayRegrRateLimiter
FieldDeclarationDescription
maxPerWindow_uint32_t maxPerWindow_
windowMs_uint32_t windowMs_
entries_std::unordered_map< uint32_t, Entry > entries_

NvPSDGatewayRegrRateLimiter::Entry

struct NvPSDGatewayRegrRateLimiter::Entry
FieldDeclarationDescription
windowStartMsuint64_t windowStartMs
countuint32_t count
notifiedbool notified

NvPSDGatewayPssSequenceState

struct NvPSDGatewayPssSequenceState
FieldDeclarationDescription
initializedbool initialized
lastValidRequestIduint32_t lastValidRequestId

NvPSDGatewayRegrAdmission

enum NvPSDGatewayRegrAdmission
ValueInitializerDescription
ADMIT
REFUSE_NOTIFY
REFUSE_SILENT

NvPSDGatewayPacketSendResult

enum NvPSDGatewayPacketSendResult
ValueInitializerDescription
SENT0U
FAILED_SYSCALL
FAILED_SHORT_SEND

NvPSDGatewayPssRequestObservation

enum NvPSDGatewayPssRequestObservation
ValueInitializerDescription
ACCEPT0U
GAP
DUPLICATE_OR_STALE
INVALID

Constants

NameDeclarationDescription
NVPSD_GATEWAY_MAX_EVENT_TYPES_PER_CLIENTconstexpr uint8_t NVPSD_GATEWAY_MAX_EVENT_TYPES_PER_CLIENT = 32U
NVPSD_GATEWAY_PSS_REQUEST_ID_MINconstexpr uint32_t NVPSD_GATEWAY_PSS_REQUEST_ID_MIN = 1U
NVPSD_GATEWAY_PSS_REQUEST_ID_MAXconstexpr uint32_t NVPSD_GATEWAY_PSS_REQUEST_ID_MAX = UINT32_MAX - 1U
NVPSD_GATEWAY_REGR_MAX_PER_WINDOW_DEFAULTconstexpr uint32_t NVPSD_GATEWAY_REGR_MAX_PER_WINDOW_DEFAULT = 4U
NVPSD_GATEWAY_REGR_MAX_PER_WINDOW_MINconstexpr uint32_t NVPSD_GATEWAY_REGR_MAX_PER_WINDOW_MIN = 1U
NVPSD_GATEWAY_REGR_MAX_PER_WINDOW_MAXconstexpr uint32_t NVPSD_GATEWAY_REGR_MAX_PER_WINDOW_MAX = 64U
NVPSD_GATEWAY_REGR_WINDOW_MS_DEFAULTconstexpr uint32_t NVPSD_GATEWAY_REGR_WINDOW_MS_DEFAULT = 10000U
NVPSD_GATEWAY_REGR_WINDOW_MS_MINconstexpr uint32_t NVPSD_GATEWAY_REGR_WINDOW_MS_MIN = 1000U
NVPSD_GATEWAY_REGR_WINDOW_MS_MAXconstexpr uint32_t NVPSD_GATEWAY_REGR_WINDOW_MS_MAX = 600000U