Aranya
a software development tool for governing access to data and services over a decentralized, zero-trust framework with secure end-to-end encrypted data exchange built-in.
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
aranya-client.h File Reference

External header file containing C function definitions for the Aranya client library. More...

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <sys/socket.h>

Go to the source code of this file.

Data Structures

struct  AranyaExtError
 Extended error information. More...
 
struct  AranyaClient
 A handle to an Aranya Client. More...
 
struct  AranyaClientConfig
 Configuration info for Aranya. More...
 
struct  AranyaId
 
struct  AranyaDeviceId
 Device ID. More...
 
struct  AranyaClientConfigBuilder
 Configuration info builder for Aranya. More...
 
struct  AranyaAqcConfigBuilder
 Configuration info builder for Aranya QUIC Channels. More...
 
struct  AranyaAqcConfig
 Configuration info for Aranya QUIC Channels. More...
 
struct  AranyaQuicSyncConfigBuilder
 
struct  AranyaSeedIkm
 Raw PSK seed IKM for QUIC syncer. More...
 
struct  AranyaQuicSyncConfig
 
struct  AranyaTeamConfigBuilder
 
struct  AranyaTeamConfig
 
struct  AranyaSyncPeerConfigBuilder
 Builder for a Sync Peer config. More...
 
struct  AranyaSyncPeerConfig
 Sync Peer config. More...
 
struct  AranyaTeamId
 Team ID. More...
 
struct  AranyaLabelId
 Label ID. More...
 
struct  AranyaAqcPeerChannel
 A type containing the AQC channel variant. More...
 
struct  AranyaAqcBidiChannel
 An AQC Bidirectional Channel Object. More...
 
struct  AranyaAqcSendChannel
 An AQC Sender Channel Object. More...
 
struct  AranyaAqcReceiveChannel
 An AQC Receiver Channel Object. More...
 
struct  AranyaAqcBidiStream
 An AQC Bidirectional Stream Object. More...
 
struct  AranyaAqcSendStream
 An AQC Sender Stream Object. More...
 
struct  AranyaAqcReceiveStream
 An AQC Receiver Stream Object. More...
 

Macros

#define __has_attribute(x)   0
 
#define ARANYA_NO_RETURN
 
#define ARANYA_NON_NULL
 
#define ARANYA_PACKED
 
#define ARANYA_DURATION_SECONDS   (1000 * ARANYA_DURATION_MILLISECONDS)
 
#define ARANYA_DURATION_MILLISECONDS   (1000 * ARANYA_DURATION_MICROSECONDS)
 
#define ARANYA_DURATION_MICROSECONDS   (1000 * ARANYA_DURATION_NANOSECONDS)
 
#define ARANYA_DURATION_NANOSECONDS   1
 
#define ARANYA_ID_LEN   32
 The size in bytes of an ID.
 
#define ARANYA_SEED_IKM_LEN   32
 The size in bytes of a PSK seed IKM.
 
#define ARANYA_ID_STR_LEN   (((ARANYA_ID_LEN * 1375) / 1000) + 1)
 The size in bytes of an ID converted to a human-readable base58 string.
 

Typedefs

typedef uint8_t AranyaAqcChannelType
 
typedef uint8_t AranyaChanOp
 
typedef uint32_t AranyaError
 
typedef uint8_t AranyaRole
 
typedef struct AranyaExtError AranyaExtError
 Extended error information.
 
typedef struct AranyaClient AranyaClient
 A handle to an Aranya Client.
 
typedef struct AranyaClientConfig AranyaClientConfig
 Configuration info for Aranya.
 
typedef struct AranyaId AranyaId
 
typedef struct AranyaDeviceId AranyaDeviceId
 Device ID.
 
typedef struct AranyaClientConfigBuilder AranyaClientConfigBuilder
 Configuration info builder for Aranya.
 
typedef struct AranyaAqcConfigBuilder AranyaAqcConfigBuilder
 Configuration info builder for Aranya QUIC Channels.
 
typedef struct AranyaAqcConfig AranyaAqcConfig
 Configuration info for Aranya QUIC Channels.
 
typedef struct AranyaQuicSyncConfigBuilder AranyaQuicSyncConfigBuilder
 
typedef struct AranyaSeedIkm AranyaSeedIkm
 Raw PSK seed IKM for QUIC syncer.
 
typedef struct AranyaQuicSyncConfig AranyaQuicSyncConfig
 
typedef struct AranyaTeamConfigBuilder AranyaTeamConfigBuilder
 
typedef struct AranyaTeamConfig AranyaTeamConfig
 
typedef struct AranyaSyncPeerConfigBuilder AranyaSyncPeerConfigBuilder
 Builder for a Sync Peer config.
 
typedef struct AranyaSyncPeerConfig AranyaSyncPeerConfig
 Sync Peer config.
 
typedef uint64_t AranyaDuration
 A type to represent a span of time in nanoseconds.
 
typedef struct AranyaTeamId AranyaTeamId
 Team ID.
 
typedef const char * AranyaLabelName
 An AQC label name.
 
typedef struct AranyaLabelId AranyaLabelId
 Label ID.
 
typedef const char * AranyaAddr
 A network socket address for an Aranya client.
 
typedef const char * AranyaNetIdentifier
 A network identifier for an Aranya client.
 
typedef struct AranyaAqcPeerChannel AranyaAqcPeerChannel
 A type containing the AQC channel variant.
 
typedef struct AranyaAqcBidiChannel AranyaAqcBidiChannel
 An AQC Bidirectional Channel Object.
 
typedef struct AranyaAqcSendChannel AranyaAqcSendChannel
 An AQC Sender Channel Object.
 
typedef struct AranyaAqcReceiveChannel AranyaAqcReceiveChannel
 An AQC Receiver Channel Object.
 
typedef struct AranyaAqcBidiStream AranyaAqcBidiStream
 An AQC Bidirectional Stream Object.
 
typedef struct AranyaAqcSendStream AranyaAqcSendStream
 An AQC Sender Stream Object.
 
typedef struct AranyaAqcReceiveStream AranyaAqcReceiveStream
 An AQC Receiver Stream Object.
 

Enumerations

enum  AranyaAqcChannelType { ARANYA_AQC_CHANNEL_TYPE_BIDIRECTIONAL , ARANYA_AQC_CHANNEL_TYPE_RECEIVER }
 An enum containing all `AranyaAqcPeerChannel` variants.
 
enum  AranyaChanOp { ARANYA_CHAN_OP_RECV_ONLY , ARANYA_CHAN_OP_SEND_ONLY , ARANYA_CHAN_OP_SEND_RECV }
 Valid channel operations for a label assignment. More...
 
enum  AranyaError {
  ARANYA_ERROR_SUCCESS , ARANYA_ERROR_BUG , ARANYA_ERROR_TIMEOUT , ARANYA_ERROR_INVALID_ARGUMENT ,
  ARANYA_ERROR_BUFFER_TOO_SMALL , ARANYA_ERROR_INVALID_UTF8 , ARANYA_ERROR_INVALID_ADDR , ARANYA_ERROR_IPC ,
  ARANYA_ERROR_ARANYA , ARANYA_ERROR_AQC , ARANYA_ERROR_WOULD_BLOCK , ARANYA_ERROR_CLOSED ,
  ARANYA_ERROR_CONFIG , ARANYA_ERROR_SERIALIZATION , ARANYA_ERROR_OTHER
}
 An error code. More...
 
enum  AranyaRole { ARANYA_ROLE_OWNER , ARANYA_ROLE_ADMIN , ARANYA_ROLE_OPERATOR , ARANYA_ROLE_MEMBER }
 An enum containing team roles defined in the Aranya policy. More...
 

Functions

AranyaError aranya_init_logging (void)
 Initializes logging.
 
AranyaError aranya_init_logging_ext (struct AranyaExtError *__ext_err)
 Initializes logging.
 
AranyaError aranya_decode_hex (uint8_t *dst, size_t dst_len, const uint8_t *src, size_t src_len, size_t *__output)
 Decodes the hexadecimal string src into dst and returns the number of bytes written to dst.
 
AranyaError aranya_decode_hex_ext (uint8_t *dst, size_t dst_len, const uint8_t *src, size_t src_len, size_t *__output, struct AranyaExtError *__ext_err)
 Decodes the hexadecimal string src into dst and returns the number of bytes written to dst.
 
AranyaError aranya_client_config_build (struct AranyaClientConfigBuilder *cfg, struct AranyaClientConfig *out)
 Attempts to construct a `AranyaClientConfig`.
 
AranyaError aranya_client_config_build_ext (struct AranyaClientConfigBuilder *cfg, struct AranyaClientConfig *out, struct AranyaExtError *__ext_err)
 Attempts to construct a `AranyaClientConfig`.
 
AranyaError aranya_client_config_builder_set_daemon_uds_path (struct AranyaClientConfigBuilder *cfg, const char *address)
 Sets Unix Domain Socket path that the daemon is listening on.
 
AranyaError aranya_client_config_builder_set_daemon_uds_path_ext (struct AranyaClientConfigBuilder *cfg, const char *address, struct AranyaExtError *__ext_err)
 Sets Unix Domain Socket path that the daemon is listening on.
 
AranyaError aranya_aqc_config_build (struct AranyaAqcConfigBuilder *cfg, struct AranyaAqcConfig *out)
 Attempts to construct an `AranyaAqcConfig`.
 
AranyaError aranya_aqc_config_build_ext (struct AranyaAqcConfigBuilder *cfg, struct AranyaAqcConfig *out, struct AranyaExtError *__ext_err)
 Attempts to construct an `AranyaAqcConfig`.
 
AranyaError aranya_aqc_config_builder_set_address (struct AranyaAqcConfigBuilder *cfg, const char *address)
 Sets the network address that the AQC server should listen on.
 
AranyaError aranya_aqc_config_builder_set_address_ext (struct AranyaAqcConfigBuilder *cfg, const char *address, struct AranyaExtError *__ext_err)
 Sets the network address that the AQC server should listen on.
 
AranyaError aranya_client_config_builder_set_aqc_config (struct AranyaClientConfigBuilder *cfg, const struct AranyaAqcConfig *aqc_config)
 Sets the configuration for Aranya QUIC Channels.
 
AranyaError aranya_client_config_builder_set_aqc_config_ext (struct AranyaClientConfigBuilder *cfg, const struct AranyaAqcConfig *aqc_config, struct AranyaExtError *__ext_err)
 Sets the configuration for Aranya QUIC Channels.
 
AranyaError aranya_quic_sync_config_generate (struct AranyaQuicSyncConfigBuilder *cfg)
 Attempts to set PSK seed generation mode value on `AranyaQuicSyncConfigBuilder`.
 
AranyaError aranya_quic_sync_config_generate_ext (struct AranyaQuicSyncConfigBuilder *cfg, struct AranyaExtError *__ext_err)
 Attempts to set PSK seed generation mode value on `AranyaQuicSyncConfigBuilder`.
 
AranyaError aranya_quic_sync_config_wrapped_seed (struct AranyaQuicSyncConfigBuilder *cfg, const uint8_t *encap_seed, size_t encap_seed_len)
 Attempts to set wrapped PSK seed value on `AranyaQuicSyncConfigBuilder`.
 
AranyaError aranya_quic_sync_config_wrapped_seed_ext (struct AranyaQuicSyncConfigBuilder *cfg, const uint8_t *encap_seed, size_t encap_seed_len, struct AranyaExtError *__ext_err)
 Attempts to set wrapped PSK seed value on `AranyaQuicSyncConfigBuilder`.
 
AranyaError aranya_quic_sync_config_raw_seed_ikm (struct AranyaQuicSyncConfigBuilder *cfg, const struct AranyaSeedIkm *ikm)
 Attempts to set raw PSK seed IKM value on `AranyaQuicSyncConfigBuilder`.
 
AranyaError aranya_quic_sync_config_raw_seed_ikm_ext (struct AranyaQuicSyncConfigBuilder *cfg, const struct AranyaSeedIkm *ikm, struct AranyaExtError *__ext_err)
 Attempts to set raw PSK seed IKM value on `AranyaQuicSyncConfigBuilder`.
 
AranyaError aranya_quic_sync_config_build (struct AranyaQuicSyncConfigBuilder *cfg, struct AranyaQuicSyncConfig *out)
 Attempts to construct a `AranyaQuicSyncConfig`.
 
AranyaError aranya_quic_sync_config_build_ext (struct AranyaQuicSyncConfigBuilder *cfg, struct AranyaQuicSyncConfig *out, struct AranyaExtError *__ext_err)
 Attempts to construct a `AranyaQuicSyncConfig`.
 
AranyaError aranya_team_config_builder_set_quic_syncer (struct AranyaTeamConfigBuilder *cfg, struct AranyaQuicSyncConfig *quic)
 Configures QUIC syncer for `AranyaTeamConfigBuilder`.
 
AranyaError aranya_team_config_builder_set_quic_syncer_ext (struct AranyaTeamConfigBuilder *cfg, struct AranyaQuicSyncConfig *quic, struct AranyaExtError *__ext_err)
 Configures QUIC syncer for `AranyaTeamConfigBuilder`.
 
AranyaError aranya_team_config_build (struct AranyaTeamConfigBuilder *cfg, struct AranyaTeamConfig *out)
 Attempts to construct a `AranyaTeamConfig`.
 
AranyaError aranya_team_config_build_ext (struct AranyaTeamConfigBuilder *cfg, struct AranyaTeamConfig *out, struct AranyaExtError *__ext_err)
 Attempts to construct a `AranyaTeamConfig`.
 
AranyaError aranya_sync_peer_config_build (struct AranyaSyncPeerConfigBuilder *cfg, struct AranyaSyncPeerConfig *out)
 Attempts to build a `AranyaSyncPeerConfig`.
 
AranyaError aranya_sync_peer_config_build_ext (struct AranyaSyncPeerConfigBuilder *cfg, struct AranyaSyncPeerConfig *out, struct AranyaExtError *__ext_err)
 Attempts to build a `AranyaSyncPeerConfig`.
 
AranyaError aranya_sync_peer_config_builder_set_interval (struct AranyaSyncPeerConfigBuilder *cfg, AranyaDuration interval)
 Configures how often the peer will be synced with.
 
AranyaError aranya_sync_peer_config_builder_set_interval_ext (struct AranyaSyncPeerConfigBuilder *cfg, AranyaDuration interval, struct AranyaExtError *__ext_err)
 Configures how often the peer will be synced with.
 
AranyaError aranya_sync_peer_config_builder_set_sync_now (struct AranyaSyncPeerConfigBuilder *cfg)
 Updates the config to enable immediate syncing with the peer.
 
AranyaError aranya_sync_peer_config_builder_set_sync_now_ext (struct AranyaSyncPeerConfigBuilder *cfg, struct AranyaExtError *__ext_err)
 Updates the config to enable immediate syncing with the peer.
 
AranyaError aranya_sync_peer_config_builder_set_sync_later (struct AranyaSyncPeerConfigBuilder *cfg)
 Updates the config to disable immediate syncing with the peer.
 
AranyaError aranya_sync_peer_config_builder_set_sync_later_ext (struct AranyaSyncPeerConfigBuilder *cfg, struct AranyaExtError *__ext_err)
 Updates the config to disable immediate syncing with the peer.
 
AranyaError aranya_rand (struct AranyaClient *client, uint8_t *buf, size_t buf_len)
 Return random bytes from Aranya's CSPRNG.
 
AranyaError aranya_rand_ext (struct AranyaClient *client, uint8_t *buf, size_t buf_len, struct AranyaExtError *__ext_err)
 Return random bytes from Aranya's CSPRNG.
 

Detailed Description

External header file containing C function definitions for the Aranya client library.

Typedef Documentation

◆ AranyaAddr

typedef const char* AranyaAddr

A network socket address for an Aranya client.

E.g. "localhost:8080", "127.0.0.1:8080"

◆ AranyaAqcPeerChannel

A type containing the AQC channel variant.

Note that this data is only valid after a successful call to try_receive_channel, and is invalidated after calling get_bidi_channel/get_receive_channel.

◆ AranyaLabelName

typedef const char* AranyaLabelName

An AQC label name.

E.g. "TELEMETRY_LABEL"

◆ AranyaNetIdentifier

typedef const char* AranyaNetIdentifier

A network identifier for an Aranya client.

E.g. "localhost:8080", "127.0.0.1:8080"

Enumeration Type Documentation

◆ AranyaChanOp

Valid channel operations for a label assignment.

Enumerator
ARANYA_CHAN_OP_RECV_ONLY 

The device can only receive data in channels with this label.

ARANYA_CHAN_OP_SEND_ONLY 

The device can only send data in channels with this label.

ARANYA_CHAN_OP_SEND_RECV 

The device can send and receive data in channels with this label.

◆ AranyaError

An error code.

For extended error information, see `AranyaExtError`.

Enumerator
ARANYA_ERROR_SUCCESS 

Success.

ARANYA_ERROR_BUG 

Internal bug discovered.

ARANYA_ERROR_TIMEOUT 

Timed out.

ARANYA_ERROR_INVALID_ARGUMENT 

Invalid argument.

ARANYA_ERROR_BUFFER_TOO_SMALL 

Buffer is too small.

ARANYA_ERROR_INVALID_UTF8 

Invalid UTF-8.

ARANYA_ERROR_INVALID_ADDR 

Invalid Address.

ARANYA_ERROR_IPC 

Could not send request to daemon.

ARANYA_ERROR_ARANYA 

An Aranya error.

ARANYA_ERROR_AQC 

AQC library error.

ARANYA_ERROR_WOULD_BLOCK 

Tried to poll an endpoint but nothing received yet.

ARANYA_ERROR_CLOSED 

A connection got unexpectedly closed.

ARANYA_ERROR_CONFIG 

Unable to create configuration info.

ARANYA_ERROR_SERIALIZATION 

Serialization error.

ARANYA_ERROR_OTHER 

Some other error occurred.

◆ AranyaRole

enum AranyaRole

An enum containing team roles defined in the Aranya policy.

Enumerator
ARANYA_ROLE_OWNER 

Owner role.

ARANYA_ROLE_ADMIN 

Admin role.

ARANYA_ROLE_OPERATOR 

Operator role.

ARANYA_ROLE_MEMBER 

Member role.

Function Documentation

◆ aranya_aqc_config_build()

AranyaError aranya_aqc_config_build ( struct AranyaAqcConfigBuilder cfg,
struct AranyaAqcConfig out 
)

Attempts to construct an `AranyaAqcConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the aqc config builder
outa pointer to write the aqc config to

◆ aranya_aqc_config_build_ext()

AranyaError aranya_aqc_config_build_ext ( struct AranyaAqcConfigBuilder cfg,
struct AranyaAqcConfig out,
struct AranyaExtError __ext_err 
)

Attempts to construct an `AranyaAqcConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the aqc config builder
outa pointer to write the aqc config to

◆ aranya_aqc_config_builder_set_address()

AranyaError aranya_aqc_config_builder_set_address ( struct AranyaAqcConfigBuilder cfg,
const char *  address 
)

Sets the network address that the AQC server should listen on.

Parameters
cfga pointer to the aqc config builder
addressa string with the address to bind to

◆ aranya_aqc_config_builder_set_address_ext()

AranyaError aranya_aqc_config_builder_set_address_ext ( struct AranyaAqcConfigBuilder cfg,
const char *  address,
struct AranyaExtError __ext_err 
)

Sets the network address that the AQC server should listen on.

Parameters
cfga pointer to the aqc config builder
addressa string with the address to bind to

◆ aranya_client_config_build()

AranyaError aranya_client_config_build ( struct AranyaClientConfigBuilder cfg,
struct AranyaClientConfig out 
)

Attempts to construct a `AranyaClientConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the client config builder
outa pointer to write the client config to

◆ aranya_client_config_build_ext()

AranyaError aranya_client_config_build_ext ( struct AranyaClientConfigBuilder cfg,
struct AranyaClientConfig out,
struct AranyaExtError __ext_err 
)

Attempts to construct a `AranyaClientConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the client config builder
outa pointer to write the client config to

◆ aranya_client_config_builder_set_aqc_config()

AranyaError aranya_client_config_builder_set_aqc_config ( struct AranyaClientConfigBuilder cfg,
const struct AranyaAqcConfig aqc_config 
)

Sets the configuration for Aranya QUIC Channels.

Parameters
cfga pointer to the client config builder
aqc_configa pointer to a valid AQC config (see `AranyaAqcConfigBuilder`)

◆ aranya_client_config_builder_set_aqc_config_ext()

AranyaError aranya_client_config_builder_set_aqc_config_ext ( struct AranyaClientConfigBuilder cfg,
const struct AranyaAqcConfig aqc_config,
struct AranyaExtError __ext_err 
)

Sets the configuration for Aranya QUIC Channels.

Parameters
cfga pointer to the client config builder
aqc_configa pointer to a valid AQC config (see `AranyaAqcConfigBuilder`)

◆ aranya_client_config_builder_set_daemon_uds_path()

AranyaError aranya_client_config_builder_set_daemon_uds_path ( struct AranyaClientConfigBuilder cfg,
const char *  address 
)

Sets Unix Domain Socket path that the daemon is listening on.

Parameters
cfga pointer to the client config builder
addressa string containing the address

◆ aranya_client_config_builder_set_daemon_uds_path_ext()

AranyaError aranya_client_config_builder_set_daemon_uds_path_ext ( struct AranyaClientConfigBuilder cfg,
const char *  address,
struct AranyaExtError __ext_err 
)

Sets Unix Domain Socket path that the daemon is listening on.

Parameters
cfga pointer to the client config builder
addressa string containing the address

◆ aranya_decode_hex()

AranyaError aranya_decode_hex ( uint8_t *  dst,
size_t  dst_len,
const uint8_t *  src,
size_t  src_len,
size_t *  __output 
)

Decodes the hexadecimal string src into dst and returns the number of bytes written to dst.

If src is a valid hexadecimal string, the number of bytes written to dst will be exactly half the length of src. Therefore, dst must be at least half as long as src.

Parameters
dstthe output buffer
srcthe input hexadecimal string

◆ aranya_decode_hex_ext()

AranyaError aranya_decode_hex_ext ( uint8_t *  dst,
size_t  dst_len,
const uint8_t *  src,
size_t  src_len,
size_t *  __output,
struct AranyaExtError __ext_err 
)

Decodes the hexadecimal string src into dst and returns the number of bytes written to dst.

If src is a valid hexadecimal string, the number of bytes written to dst will be exactly half the length of src. Therefore, dst must be at least half as long as src.

Parameters
dstthe output buffer
srcthe input hexadecimal string

◆ aranya_init_logging()

AranyaError aranya_init_logging ( void  )

Initializes logging.

Assumes the ARANYA_CAPI environment variable has been set to the desired tracing log level. E.g. ARANYA_CAPI=debug.

◆ aranya_init_logging_ext()

AranyaError aranya_init_logging_ext ( struct AranyaExtError __ext_err)

Initializes logging.

Assumes the ARANYA_CAPI environment variable has been set to the desired tracing log level. E.g. ARANYA_CAPI=debug.

◆ aranya_quic_sync_config_build()

AranyaError aranya_quic_sync_config_build ( struct AranyaQuicSyncConfigBuilder cfg,
struct AranyaQuicSyncConfig out 
)

Attempts to construct a `AranyaQuicSyncConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the QUIC sync config builder [QuicSyncConfigBuilder]
outa pointer to write the QUIC sync config to `AranyaQuicSyncConfig`

◆ aranya_quic_sync_config_build_ext()

AranyaError aranya_quic_sync_config_build_ext ( struct AranyaQuicSyncConfigBuilder cfg,
struct AranyaQuicSyncConfig out,
struct AranyaExtError __ext_err 
)

Attempts to construct a `AranyaQuicSyncConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the QUIC sync config builder [QuicSyncConfigBuilder]
outa pointer to write the QUIC sync config to `AranyaQuicSyncConfig`

◆ aranya_quic_sync_config_generate()

AranyaError aranya_quic_sync_config_generate ( struct AranyaQuicSyncConfigBuilder cfg)

Attempts to set PSK seed generation mode value on `AranyaQuicSyncConfigBuilder`.

Parameters
cfga pointer to the quic sync config builder

◆ aranya_quic_sync_config_generate_ext()

AranyaError aranya_quic_sync_config_generate_ext ( struct AranyaQuicSyncConfigBuilder cfg,
struct AranyaExtError __ext_err 
)

Attempts to set PSK seed generation mode value on `AranyaQuicSyncConfigBuilder`.

Parameters
cfga pointer to the quic sync config builder

◆ aranya_quic_sync_config_raw_seed_ikm()

AranyaError aranya_quic_sync_config_raw_seed_ikm ( struct AranyaQuicSyncConfigBuilder cfg,
const struct AranyaSeedIkm ikm 
)

Attempts to set raw PSK seed IKM value on `AranyaQuicSyncConfigBuilder`.

Parameters
cfga pointer to the quic sync config builder
ikma pointer the raw PSK seed IKM

◆ aranya_quic_sync_config_raw_seed_ikm_ext()

AranyaError aranya_quic_sync_config_raw_seed_ikm_ext ( struct AranyaQuicSyncConfigBuilder cfg,
const struct AranyaSeedIkm ikm,
struct AranyaExtError __ext_err 
)

Attempts to set raw PSK seed IKM value on `AranyaQuicSyncConfigBuilder`.

Parameters
cfga pointer to the quic sync config builder
ikma pointer the raw PSK seed IKM

◆ aranya_quic_sync_config_wrapped_seed()

AranyaError aranya_quic_sync_config_wrapped_seed ( struct AranyaQuicSyncConfigBuilder cfg,
const uint8_t *  encap_seed,
size_t  encap_seed_len 
)

Attempts to set wrapped PSK seed value on `AranyaQuicSyncConfigBuilder`.

Parameters
cfga pointer to the quic sync config builder
encap_seeda pointer the encapsulated PSK seed

◆ aranya_quic_sync_config_wrapped_seed_ext()

AranyaError aranya_quic_sync_config_wrapped_seed_ext ( struct AranyaQuicSyncConfigBuilder cfg,
const uint8_t *  encap_seed,
size_t  encap_seed_len,
struct AranyaExtError __ext_err 
)

Attempts to set wrapped PSK seed value on `AranyaQuicSyncConfigBuilder`.

Parameters
cfga pointer to the quic sync config builder
encap_seeda pointer the encapsulated PSK seed

◆ aranya_rand()

AranyaError aranya_rand ( struct AranyaClient client,
uint8_t *  buf,
size_t  buf_len 
)

Return random bytes from Aranya's CSPRNG.

This method can be used to generate a PSK seed IKM for the QUIC syncer.

Parameters
[in]clientthe Aranya Client `AranyaClient`.
[out]bufbuffer where random bytes are written to.
[in]buf_lenthe size of the buffer.

◆ aranya_rand_ext()

AranyaError aranya_rand_ext ( struct AranyaClient client,
uint8_t *  buf,
size_t  buf_len,
struct AranyaExtError __ext_err 
)

Return random bytes from Aranya's CSPRNG.

This method can be used to generate a PSK seed IKM for the QUIC syncer.

Parameters
[in]clientthe Aranya Client `AranyaClient`.
[out]bufbuffer where random bytes are written to.
[in]buf_lenthe size of the buffer.

◆ aranya_sync_peer_config_build()

AranyaError aranya_sync_peer_config_build ( struct AranyaSyncPeerConfigBuilder cfg,
struct AranyaSyncPeerConfig out 
)

Attempts to build a `AranyaSyncPeerConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the builder for a sync config

◆ aranya_sync_peer_config_build_ext()

AranyaError aranya_sync_peer_config_build_ext ( struct AranyaSyncPeerConfigBuilder cfg,
struct AranyaSyncPeerConfig out,
struct AranyaExtError __ext_err 
)

Attempts to build a `AranyaSyncPeerConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the builder for a sync config

◆ aranya_sync_peer_config_builder_set_interval()

AranyaError aranya_sync_peer_config_builder_set_interval ( struct AranyaSyncPeerConfigBuilder cfg,
AranyaDuration  interval 
)

Configures how often the peer will be synced with.

By default, the interval is not set. It is an error to call `aranya_sync_peer_config_build` before setting the interval with this function

Parameters
cfga pointer to the builder for a sync config
intervalSet the interval at which syncing occurs

◆ aranya_sync_peer_config_builder_set_interval_ext()

AranyaError aranya_sync_peer_config_builder_set_interval_ext ( struct AranyaSyncPeerConfigBuilder cfg,
AranyaDuration  interval,
struct AranyaExtError __ext_err 
)

Configures how often the peer will be synced with.

By default, the interval is not set. It is an error to call `aranya_sync_peer_config_build` before setting the interval with this function

Parameters
cfga pointer to the builder for a sync config
intervalSet the interval at which syncing occurs

◆ aranya_sync_peer_config_builder_set_sync_later()

AranyaError aranya_sync_peer_config_builder_set_sync_later ( struct AranyaSyncPeerConfigBuilder cfg)

Updates the config to disable immediate syncing with the peer.

Overrides `aranya_sync_peer_config_builder_set_sync_now` if invoked afterward.

By default, the peer is synced with immediately.

Parameters
cfga pointer to the builder for a sync config

◆ aranya_sync_peer_config_builder_set_sync_later_ext()

AranyaError aranya_sync_peer_config_builder_set_sync_later_ext ( struct AranyaSyncPeerConfigBuilder cfg,
struct AranyaExtError __ext_err 
)

Updates the config to disable immediate syncing with the peer.

Overrides `aranya_sync_peer_config_builder_set_sync_now` if invoked afterward.

By default, the peer is synced with immediately.

Parameters
cfga pointer to the builder for a sync config

◆ aranya_sync_peer_config_builder_set_sync_now()

AranyaError aranya_sync_peer_config_builder_set_sync_now ( struct AranyaSyncPeerConfigBuilder cfg)

Updates the config to enable immediate syncing with the peer.

Overrides `aranya_sync_peer_config_builder_set_sync_later` if invoked afterward.

By default, the peer is synced with immediately.

Parameters
cfga pointer to the builder for a sync config

◆ aranya_sync_peer_config_builder_set_sync_now_ext()

AranyaError aranya_sync_peer_config_builder_set_sync_now_ext ( struct AranyaSyncPeerConfigBuilder cfg,
struct AranyaExtError __ext_err 
)

Updates the config to enable immediate syncing with the peer.

Overrides `aranya_sync_peer_config_builder_set_sync_later` if invoked afterward.

By default, the peer is synced with immediately.

Parameters
cfga pointer to the builder for a sync config

◆ aranya_team_config_build()

AranyaError aranya_team_config_build ( struct AranyaTeamConfigBuilder cfg,
struct AranyaTeamConfig out 
)

Attempts to construct a `AranyaTeamConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the team config builder
outa pointer to write the team config to

◆ aranya_team_config_build_ext()

AranyaError aranya_team_config_build_ext ( struct AranyaTeamConfigBuilder cfg,
struct AranyaTeamConfig out,
struct AranyaExtError __ext_err 
)

Attempts to construct a `AranyaTeamConfig`.

This function consumes and releases any resources associated with the memory pointed to by cfg.

Parameters
cfga pointer to the team config builder
outa pointer to write the team config to

◆ aranya_team_config_builder_set_quic_syncer()

AranyaError aranya_team_config_builder_set_quic_syncer ( struct AranyaTeamConfigBuilder cfg,
struct AranyaQuicSyncConfig quic 
)

Configures QUIC syncer for `AranyaTeamConfigBuilder`.

By default, the QUIC syncer config is not set. It is an error to call `aranya_team_config_build` before setting the interval with this function

Parameters
cfga pointer to the builder for a team config
quicset the QUIC syncer config

◆ aranya_team_config_builder_set_quic_syncer_ext()

AranyaError aranya_team_config_builder_set_quic_syncer_ext ( struct AranyaTeamConfigBuilder cfg,
struct AranyaQuicSyncConfig quic,
struct AranyaExtError __ext_err 
)

Configures QUIC syncer for `AranyaTeamConfigBuilder`.

By default, the QUIC syncer config is not set. It is an error to call `aranya_team_config_build` before setting the interval with this function

Parameters
cfga pointer to the builder for a team config
quicset the QUIC syncer config