> This page is for version 1.4.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 1.4.0 (Latest) (default): https://docs.nvidia.com/halos/outside-in-safety/1.4.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/halos/outside-in-safety/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/halos/outside-in-safety/_mcp/server.

# pss_daemon.h

> Generated reference for pss_daemon.h: The client API of libnvpssd_interface: register with the SEI daemon, send heartbeats, report safety events and trust verdicts, and terminate.

The client API of `libnvpssd_interface`: register with the SEI daemon, send heartbeats, report safety events and trust verdicts, and terminate.

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`.

```c
#include "pss_daemon.h"
```

## Functions

### NvPSSRegisterPSSClient

```c
NvPSSDErr NvPSSRegisterPSSClient(uint32_t *clientId, uint8_t clientType);
```

### NvPSSRegisterPSSClientInstance

```c
NvPSSDErr NvPSSRegisterPSSClientInstance(uint32_t *clientId, uint8_t clientType, uint8_t instanceId);
```

### NvPSSTerminatePSSClient

```c
NvPSSDErr NvPSSTerminatePSSClient(const uint32_t clientId);
```

### NvPSSReportSafetyEvent

```c
NvPSSDErr NvPSSReportSafetyEvent(const uint32_t clientId, const SafetyEvent *event);
```

Report a safety event.

Clients use this function to report safety events to the PSS daemon when they detect potential hazards.

| Parameter  | Description                                                                   |
| ---------- | ----------------------------------------------------------------------------- |
| `clientId` | The ID of the client reporting the event.                                     |
| `event`    | A `SafetyEvent` structure containing details about the detected safety event. |

**Returns:** NVPSSD_SUCCESS if the daemon accepted the event (REPORT_ACCEPTED), NVPSSD_FAIL otherwise. The specific rejection reason (one of the REPORT_REJECTED\_\* codes) is logged server-side.

### NvPSSSendHeartbeat

```c
NvPSSDErr NvPSSSendHeartbeat(const uint32_t clientId, const uint8_t clientType);
```

## Types

### PSDRegistrationMsg_t

```c
struct PSDRegistrationMsg_t
```

Registration message structure for PSD socket communication.

This structure is used for event type registration between PSS Daemon and PSD clients DecisionRequest/DecisionResponse are sent directly without wrapping

| Field             | Declaration                | Description |
| ----------------- | -------------------------- | ----------- |
| `msgType`         | `uint32_t msgType`         |             |
| `clientId`        | `uint32_t clientId`        |             |
| `eventTypesCount` | `uint32_t eventTypesCount` |             |
| `eventTypes`      | `EventType eventTypes[10]` |             |

### NvPSSDToPSDResp_t

```c
struct NvPSSDToPSDResp_t
```

Response structure for PSD socket communication.

This structure is used by PSS Daemon to respond to PSD client requests.

| Field      | Declaration         | Description |
| ---------- | ------------------- | ----------- |
| `clientId` | `uint32_t clientId` |             |
| `status`   | `uint32_t status`   |             |

### NvPSSDStatus_t

```c
enum NvPSSDStatus_t
```

| Value            | Initializer | Description |
| ---------------- | ----------- | ----------- |
| `NVPSSD_SUCCESS` | `0`         |             |
| `NVPSSD_FAIL`    |             |             |

### Type aliases

| Name                 | Definition                                               | Description                                                                                                                                                                                                            |
| -------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NvPSSDErr`          | `typedef enum NvPSSDStatus_t NvPSSDErr`                  |                                                                                                                                                                                                                        |
| `PSDRegistrationMsg` | `typedef struct PSDRegistrationMsg_t PSDRegistrationMsg` | Registration message structure for PSD socket communication. This structure is used for event type registration between PSS Daemon and PSD clients DecisionRequest/DecisionResponse are sent directly without wrapping |
| `NvPSSDToPSDResp`    | `typedef struct NvPSSDToPSDResp_t NvPSSDToPSDResp`       | Response structure for PSD socket communication. This structure is used by PSS Daemon to respond to PSD client requests.                                                                                               |

## Macros

| Macro                                | Value                                                                                                                                                                                                      | Description                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NVPSS_DAEMON_DEFAULT_CONF`          | `"/opt/nvidia/psf/bin/nvpss.conf"`                                                                                                                                                                         | Default configuration file for nvpss_daemon. Overridable with conf. Defined here rather than inline at the read site so the usage text, the default and any future packaging reference are one string. The override exists because a path with no override made the daemon unrunnable in a test fixture without editing an installed system file. |
| `PSS_DAEMON_SOCKET_PATH`             | `"/run/nvpsf/nvpssd_to_psd"`                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                   |
| `PSS_DAEMON_RPC_SOCKET_PATH`         | `"/run/nvpsf/nvpssd"`                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                   |
| `MAX_PSD_CLIENTS`                    | `32`                                                                                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                   |
| `REGISTER_PSD_CLIENT`                | `100`                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                   |
| `REGISTER_EVENT_TYPES`               | `101`                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                   |
| `UNREGISTER_PSD_CLIENT`              | `102`                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                   |
| `PSS_MDX_INSTANCE_MAX`               | `8U`                                                                                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                   |
| `REGISTER_ACCEPTED`                  | `1 /* Registration successful */`                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                   |
| `REGISTER_REJECTED_DUPLICATE_TYPE`   | `2 /* Another active client of the same type exists */`                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                   |
| `REGISTER_REJECTED_INVALID_TYPE`     | `3 /* clientType not one of the valid CLIENT_* constants */`                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                   |
| `REGISTER_REJECTED_INVALID_INSTANCE` | `4 /* instance id above PSS_MDX_INSTANCE_MAX, or non-zero for a client type other than CLIENT_MDX */`                                                                                                      |                                                                                                                                                                                                                                                                                                                                                   |
| `TERMINATE_ACCEPTED`                 | `1 /* Client termination completed successfully */`                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                   |
| `REPORT_ACCEPTED`                    | `1 /* Event accepted and forwarded to fusion / routing */`                                                                                                                                                 |                                                                                                                                                                                                                                                                                                                                                   |
| `REPORT_REJECTED_CLIENTID_MISMATCH`  | `2 /* fusionMetadata.clientID does not match the RPC-assigned client id */`                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                   |
| `REPORT_REJECTED_UNAUTHORIZED`       | `3 /* Heartbeat fault, payload too small, or unauthorized client type */`                                                                                                                                  |                                                                                                                                                                                                                                                                                                                                                   |
| `REPORT_REJECTED_LOW_CONFIDENCE`     | `4 /* confidenceLevel below configured acceptance threshold */`                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                   |
| `REPORT_REJECTED_VALIDATION_FAILED`  | `5 /* CRC, schema, or field-range validation failed */`                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                   |
| `REPORT_REJECTED_UNRESOLVED_SENSOR`  | `6 /* Per-sensor event whose sensor identity could not be resolved: fusionMetadata.pipelineID == 0. Distinct from VALIDATION_FAILED so a client can tell a configuration error from a corrupt message. */` |                                                                                                                                                                                                                                                                                                                                                   |
| `HEARTBEAT_ACK`                      | `1 /* PSS daemon acknowledges SEND_HEARTBEAT */`                                                                                                                                                           |                                                                                                                                                                                                                                                                                                                                                   |
| `HB_MSG`                             | `0x7E`                                                                                                                                                                                                     |                                                                                                                                                                                                                                                                                                                                                   |
| `HB_INTERVAL_MS`                     | `5000 /* Nominal period between SEND_HEARTBEAT (clients + gateway PSS-HB thread). */`                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                   |
| `HB_STALE_GRACE_MS`                  | `1500 /* Slack above HB_INTERVAL_MS so jitter/scheduling does not false-stale before next HB */`                                                                                                           |                                                                                                                                                                                                                                                                                                                                                   |
| `HB_TIMEOUT_MS`                      | `(HB_INTERVAL_MS + HB_STALE_GRACE_MS) /* Stale if no SEND_HEARTBEAT within this window */`                                                                                                                 |                                                                                                                                                                                                                                                                                                                                                   |
| `CLIENT_MDX`                         | `1`                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                   |
| `CLIENT_SAFETY_MONITOR`              | `2`                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                   |
| `CLIENT_PSD_GATEWAY`                 | `3`                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                   |
| `CLIENT_PERCEPTION_MONITOR`          | `4`                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                   |