Skip to navigation

NvPSDGatewayProtocol.h

View as Markdown

The gateway wire format: registration (REGR), registration refusal (RGNK) and its reasons, and the envelope that carries each decision request to an SDM.

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 "NvPSDGatewayProtocol.h"

Functions

NvPSDGatewayBuildRegReject

static inline void NvPSDGatewayBuildRegReject(uint8_t out[NVPSD_GATEWAY_REG_REJECT_MSG_SIZE], uint8_t reason);

NvPSDGatewayParseRegReject

static inline bool NvPSDGatewayParseRegReject(const void *buf, size_t n, uint8_t *reason);

NvPSDGatewayRegRejectReasonName

static inline const char * NvPSDGatewayRegRejectReasonName(uint8_t reason);

NvPSDGatewayDecisionPacketEpochIsValid

static inline bool NvPSDGatewayDecisionPacketEpochIsValid(uint64_t epoch);

NvPSDGatewayDecisionPacketSequenceIsValid

static inline bool NvPSDGatewayDecisionPacketSequenceIsValid(uint32_t txSeq);

NvPSDGatewayDecisionPacketHeaderIsValid

static inline bool NvPSDGatewayDecisionPacketHeaderIsValid(const NvPSDGatewayDecisionRequestPacket *packet);

Types

NvPSDGatewayDecisionRequestPacket

struct NvPSDGatewayDecisionRequestPacket
FieldDeclarationDescription
magicchar magic[4]
versionuint16_t version
headerSizeuint16_t headerSize
gatewayEpochuint64_t gatewayEpoch
gatewayTxSequint32_t gatewayTxSeq
requestDecisionRequest request

NvPSDGatewayRegRejectReason

enum NvPSDGatewayRegRejectReason
ValueInitializerDescription
NVPSD_REG_REJECT_MALFORMED1
NVPSD_REG_REJECT_NO_VALID_EVENT_TYPES2
NVPSD_REG_REJECT_TABLE_FULL3
NVPSD_REG_REJECT_RATE_LIMITED4

Type aliases

NameDefinitionDescription
NvPSDGatewayDecisionRequestPackettypedef struct NvPSDGatewayDecisionRequestPacket NvPSDGatewayDecisionRequestPacket

Macros

MacroValueDescription
NVPSD_GATEWAY_MAX_CLIENTS10Maximum number of decision-maker clients that can register over UDP.
NVPSD_GATEWAY_REG_MAGIC"REGR"Registration packet magic (4 bytes). Send to gateway to subscribe to EVENT_* types.
NVPSD_GATEWAY_HB_MAGIC_GATEWAY"HBPG"Heartbeat: gateway → client (4 bytes).
NVPSD_GATEWAY_HB_MAGIC_CLIENT"HBPC"Heartbeat ACK: client → gateway (4 bytes).
NVPSD_GATEWAY_HB_MSG_SIZE8Heartbeat message size: 4-byte magic + 4-byte seq (network byte order).
NVPSD_GATEWAY_REG_REJECT_MAGIC"RGNK"Registration refusal: gateway -> client, 4-byte magic + one reason byte (NvPSDGatewayRegRejectReason). Sent for every REGR the gateway refuses, so a refused client can tell refusal and why from silence. Additive: its size matches no other message on this link, and a client built before it discards it as an unexpected size. Smaller than any REGR, so answering one cannot amplify traffic.
NVPSD_GATEWAY_REG_REJECT_MSG_SIZE5
NVPSD_GATEWAY_DECISION_MAGIC"DRPG"DecisionRequest packet: gateway -> SDM (4 bytes).
NVPSD_GATEWAY_DECISION_PACKET_VERSION1UDecisionRequest packet version for the Gateway-to-SDM UDP envelope.
NVPSD_GATEWAY_DECISION_TX_SEQ_MIN1UValid Gateway-to-SDM sequence range. 0 and UINT32_MAX are reserved sentinels.
NVPSD_GATEWAY_DECISION_TX_SEQ_MAX(UINT32_MAX - 1U)
NVPSD_GATEWAY_DECISION_EPOCH_MAXUINT64_MAX
NVPSD_GATEWAY_DECISION_HEADER_SIZE((uint16_t)offsetof(NvPSDGatewayDecisionRequestPacket, request))