RTE OSAdapter POSIX 0.1.0 build 41b3eb3
POSIX/Linux OAL OSAdapter for Platform_RTE
Loading...
Searching...
No Matches
rte_posix_osadapter_random.c File Reference

POSIX rte_random OSAdapter: the kernel CSPRNG via getentropy() (Linux glibc 2.25+, macOS 10.12+). More...

#include "rte/posix_osadapter/rte_posix_osadapter.h"
#include <unistd.h>
Include dependency graph for rte_posix_osadapter_random.c:

Go to the source code of this file.

Functions

static rte_status_t osadapter_fill (uint8_t *out, size_t len)
const rte_osadapter_random_t * rte_posix_osadapter_random (void)
 The POSIX rte_random OSAdapter: the kernel CSPRNG via getentropy(); fails (never falls back) if it is unavailable - REQ-OAL-RANDOM-001.

Variables

static const rte_osadapter_random_t s_posix_random_osadapter = { osadapter_fill }

Detailed Description

POSIX rte_random OSAdapter: the kernel CSPRNG via getentropy() (Linux glibc 2.25+, macOS 10.12+).

getentropy() takes at most 256 bytes per call, the same bound as RTE_RANDOM_MAX_REQUEST, so one call serves one request. It blocks only until the kernel pool is first initialised at boot, never afterwards. On failure the OSAdapter reports RTE_STATUS_HARDWARE_FAULT and never substitutes a predictable generator (REQ-OAL-RANDOM-001).

Definition in file rte_posix_osadapter_random.c.

Macro Definition Documentation

◆ _DEFAULT_SOURCE

#define _DEFAULT_SOURCE

Definition at line 2 of file rte_posix_osadapter_random.c.

Function Documentation

◆ osadapter_fill()

rte_status_t osadapter_fill ( uint8_t * out,
size_t len )
static

Definition at line 28 of file rte_posix_osadapter_random.c.

◆ rte_posix_osadapter_random()

const rte_osadapter_random_t * rte_posix_osadapter_random ( void )

The POSIX rte_random OSAdapter: the kernel CSPRNG via getentropy(); fails (never falls back) if it is unavailable - REQ-OAL-RANDOM-001.

Definition at line 23 of file rte_posix_osadapter_random.c.

Variable Documentation

◆ s_posix_random_osadapter

const rte_osadapter_random_t s_posix_random_osadapter = { osadapter_fill }
static

Definition at line 21 of file rte_posix_osadapter_random.c.