11#ifndef ARANYA_CLIENT_H
12#define ARANYA_CLIENT_H
21#include <sys/socket.h>
23#ifndef __has_attribute
24 #define __has_attribute(x) 0
27#if !defined(ARANYA_ALIGNED)
28 #if __has_attribute(aligned)
29 #define ARANYA_ALIGNED(n) __attribute__((aligned(n)))
31 #error "compiler must support `aligned` attribute"
35#if !defined(ARANYA_DESIGNATED_INIT)
36 #if __has_attribute(designated_init)
37 #define ARANYA_DESIGNATED_INIT __attribute__((designated_init))
39 #define ARANYA_DESIGNATED_INIT
43#if !defined(ARANYA_MUST_USE)
44 #if __has_attribute(warn_unused_result)
45 #define ARANYA_MUST_USE __attribute__((warn_unused_result))
47 #define ARANYA_MUST_USE
51#if !defined(ARANYA_NO_RETURN)
52 #if __has_attribute(noreturn)
53 #define ARANYA_NO_RETURN __attribute__((noreturn))
55 #define ARANYA_NO_RETURN
59#if !defined(ARANYA_NON_NULL)
61 #if __has_attribute(nonnull)
62 #define ARANYA_NON_NULL __attribute__((nonnull))
64 #elif defined(__clang__)
65 #define ARANYA_NON_NULL _Nonnull
67 #define ARANYA_NON_NULL
71#if !defined(ARANYA_PACKED)
72 #if __has_attribute(packed)
73 #define ARANYA_PACKED __attribute__((packed))
80#define ARANYA_DURATION_SECONDS (1000 * ARANYA_DURATION_MILLISECONDS)
82#define ARANYA_DURATION_MILLISECONDS (1000 * ARANYA_DURATION_MICROSECONDS)
84#define ARANYA_DURATION_MICROSECONDS (1000 * ARANYA_DURATION_NANOSECONDS)
86#define ARANYA_DURATION_NANOSECONDS 1
91#define ARANYA_ID_LEN 32
96#define ARANYA_ID_STR_LEN (((ARANYA_ID_LEN * 1375) / 1000) + 1)
106 ARANYA_AQC_CHANNEL_TYPE_BIDIRECTIONAL,
107 ARANYA_AQC_CHANNEL_TYPE_RECEIVER,
254 uint8_t __for_size_only[88];
266 uint8_t __for_size_only[3728];
278 uint8_t __for_size_only[56];
301 uint8_t __for_size_only[72];
313 uint8_t __for_size_only[24];
325 uint8_t __for_size_only[40];
334 uint8_t __for_size_only[16];
343 uint8_t __for_size_only[24];
355 uint8_t __for_size_only[40];
367 uint8_t __for_size_only[32];
423 uint8_t __for_size_only[120];
435 uint8_t __for_size_only[112];
447 uint8_t __for_size_only[112];
459 uint8_t __for_size_only[112];
471 uint8_t __for_size_only[184];
483 uint8_t __for_size_only[152];
495 uint8_t __for_size_only[184];
511const char *aranya_error_to_str(uint32_t err);
704 size_t *keybundle_len);
717 size_t *keybundle_len,
840 const char *address);
962 const char *address);
1521 const uint8_t *keybundle,
1522 size_t keybundle_len);
1538 const uint8_t *keybundle,
1539 size_t keybundle_len,
1699 size_t *devices_len);
1714 size_t *devices_len,
1732 size_t *keybundle_len);
1749 size_t *keybundle_len,
1773 size_t *labels_len);
1818 size_t *labels_len);
2429 const uint8_t *data,
2444 const uint8_t *data,
2645 const uint8_t *data,
2660 const uint8_t *data,
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_builder_set_aqc_config(struct AranyaClientConfigBuilder *cfg, const struct AranyaAqcConfig *aqc_config)
Sets the configuration for Aranya QUIC Channels.
AranyaError aranya_team_config_build_ext(struct AranyaTeamConfigBuilder *cfg, struct AranyaTeamConfig *out, struct AranyaExtError *__ext_err)
Attempts to construct a `AranyaTeamConfig`.
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_sync_peer_config_build(struct AranyaSyncPeerConfigBuilder *cfg, struct AranyaSyncPeerConfig *out)
Attempts to build a `AranyaSyncPeerConfig`.
#define ARANYA_ID_LEN
The size in bytes of an ID.
Definition aranya-client.h:91
uint64_t AranyaDuration
A type to represent a span of time in nanoseconds.
Definition aranya-client.h:373
AranyaError aranya_aqc_config_build_ext(struct AranyaAqcConfigBuilder *cfg, struct AranyaAqcConfig *out, struct AranyaExtError *__ext_err)
Attempts to construct an `AranyaAqcConfig`.
AranyaError aranya_client_config_builder_set_daemon_api_pk(struct AranyaClientConfigBuilder *cfg, const uint8_t *pk, size_t pk_len)
Sets the daemon's public API key.
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_client_config_build(struct AranyaClientConfigBuilder *cfg, struct AranyaClientConfig *out)
Attempts to construct a `AranyaClientConfig`.
const char * AranyaAddr
A network socket address for an Aranya client.
Definition aranya-client.h:401
AranyaError aranya_init_logging(void)
Initializes logging.
AranyaAqcChannelType
An enum containing all `AranyaAqcPeerChannel` variants.
Definition aranya-client.h:105
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_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_interval(struct AranyaSyncPeerConfigBuilder *cfg, AranyaDuration interval)
Configures how often the peer will be synced with.
AranyaError aranya_aqc_config_build(struct AranyaAqcConfigBuilder *cfg, struct AranyaAqcConfig *out)
Attempts to construct an `AranyaAqcConfig`.
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_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.
const char * AranyaLabelName
An AQC label name.
Definition aranya-client.h:387
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.
const char * AranyaNetIdentifier
A network identifier for an Aranya client.
Definition aranya-client.h:408
AranyaError aranya_init_logging_ext(struct AranyaExtError *__ext_err)
Initializes logging.
AranyaError aranya_client_config_builder_set_daemon_api_pk_ext(struct AranyaClientConfigBuilder *cfg, const uint8_t *pk, size_t pk_len, struct AranyaExtError *__ext_err)
Sets the daemon's public API key.
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_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_sync_later(struct AranyaSyncPeerConfigBuilder *cfg)
Updates the config to disable immediate syncing with the peer.
AranyaError
An error code.
Definition aranya-client.h:150
@ ARANYA_ERROR_INVALID_ARGUMENT
Invalid argument.
Definition aranya-client.h:166
@ ARANYA_ERROR_CONFIG
Unable to create configuration info.
Definition aranya-client.h:202
@ ARANYA_ERROR_IPC
Could not send request to daemon.
Definition aranya-client.h:182
@ ARANYA_ERROR_INVALID_UTF8
Invalid UTF-8.
Definition aranya-client.h:174
@ ARANYA_ERROR_TIMEOUT
Timed out.
Definition aranya-client.h:162
@ ARANYA_ERROR_AQC
AQC library error.
Definition aranya-client.h:190
@ ARANYA_ERROR_BUFFER_TOO_SMALL
Buffer is too small.
Definition aranya-client.h:170
@ ARANYA_ERROR_BUG
Internal bug discovered.
Definition aranya-client.h:158
@ ARANYA_ERROR_INVALID_ADDR
Invalid Address.
Definition aranya-client.h:178
@ ARANYA_ERROR_SERIALIZATION
Serialization error.
Definition aranya-client.h:206
@ ARANYA_ERROR_SUCCESS
Success.
Definition aranya-client.h:154
@ ARANYA_ERROR_OTHER
Some other error occurred.
Definition aranya-client.h:210
@ ARANYA_ERROR_ARANYA
An Aranya error.
Definition aranya-client.h:186
@ ARANYA_ERROR_CLOSED
A connection got unexpectedly closed.
Definition aranya-client.h:198
@ ARANYA_ERROR_WOULD_BLOCK
Tried to poll an endpoint but nothing received yet.
Definition aranya-client.h:194
AranyaChanOp
Valid channel operations for a label assignment.
Definition aranya-client.h:120
@ ARANYA_CHAN_OP_SEND_ONLY
The device can only send data in channels with this label.
Definition aranya-client.h:130
@ ARANYA_CHAN_OP_SEND_RECV
The device can send and receive data in channels with this label.
Definition aranya-client.h:135
@ ARANYA_CHAN_OP_RECV_ONLY
The device can only receive data in channels with this label.
Definition aranya-client.h:125
AranyaError aranya_client_config_build_ext(struct AranyaClientConfigBuilder *cfg, struct AranyaClientConfig *out, struct AranyaExtError *__ext_err)
Attempts to construct a `AranyaClientConfig`.
AranyaError aranya_team_config_build(struct AranyaTeamConfigBuilder *cfg, struct AranyaTeamConfig *out)
Attempts to construct a `AranyaTeamConfig`.
AranyaError aranya_aqc_config_builder_set_address(struct AranyaAqcConfigBuilder *cfg, const char *address)
Sets the network address that the AQC server should listen on.
AranyaRole
An enum containing team roles defined in the Aranya policy.
Definition aranya-client.h:223
@ ARANYA_ROLE_ADMIN
Admin role.
Definition aranya-client.h:231
@ ARANYA_ROLE_OWNER
Owner role.
Definition aranya-client.h:227
@ ARANYA_ROLE_MEMBER
Member role.
Definition aranya-client.h:239
@ ARANYA_ROLE_OPERATOR
Operator role.
Definition aranya-client.h:235
An AQC Bidirectional Channel Object.
Definition aranya-client.h:429
AranyaError aranya_aqc_bidi_channel_cleanup_ext(struct AranyaAqcBidiChannel *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
AranyaError aranya_aqc_bidi_channel_cleanup(struct AranyaAqcBidiChannel *ptr)
Releases any resources associated with ptr.
An AQC Bidirectional Stream Object.
Definition aranya-client.h:465
AranyaError aranya_aqc_bidi_stream_cleanup(struct AranyaAqcBidiStream *ptr)
Releases any resources associated with ptr.
AranyaError aranya_aqc_bidi_stream_cleanup_ext(struct AranyaAqcBidiStream *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
Configuration info builder for Aranya QUIC Channels.
Definition aranya-client.h:307
AranyaError aranya_aqc_config_builder_init(struct AranyaAqcConfigBuilder *out)
Initializes AranyaAqcConfigBuilder.
AranyaError aranya_aqc_config_builder_cleanup(struct AranyaAqcConfigBuilder *ptr)
Releases any resources associated with ptr.
AranyaError aranya_aqc_config_builder_init_ext(struct AranyaAqcConfigBuilder *out, struct AranyaExtError *__ext_err)
Initializes AranyaAqcConfigBuilder.
AranyaError aranya_aqc_config_builder_cleanup_ext(struct AranyaAqcConfigBuilder *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
Configuration info for Aranya QUIC Channels.
Definition aranya-client.h:319
A type containing the AQC channel variant.
Definition aranya-client.h:417
AranyaError aranya_aqc_peer_channel_cleanup_ext(struct AranyaAqcPeerChannel *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
AranyaError aranya_aqc_peer_channel_cleanup(struct AranyaAqcPeerChannel *ptr)
Releases any resources associated with ptr.
An AQC Receiver Channel Object.
Definition aranya-client.h:453
AranyaError aranya_aqc_receive_channel_cleanup(struct AranyaAqcReceiveChannel *ptr)
Releases any resources associated with ptr.
AranyaError aranya_aqc_receive_channel_cleanup_ext(struct AranyaAqcReceiveChannel *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
An AQC Receiver Stream Object.
Definition aranya-client.h:489
AranyaError aranya_aqc_receive_stream_cleanup(struct AranyaAqcReceiveStream *ptr)
Releases any resources associated with ptr.
AranyaError aranya_aqc_receive_stream_cleanup_ext(struct AranyaAqcReceiveStream *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
An AQC Sender Channel Object.
Definition aranya-client.h:441
AranyaError aranya_aqc_send_channel_cleanup_ext(struct AranyaAqcSendChannel *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
AranyaError aranya_aqc_send_channel_cleanup(struct AranyaAqcSendChannel *ptr)
Releases any resources associated with ptr.
An AQC Sender Stream Object.
Definition aranya-client.h:477
AranyaError aranya_aqc_send_stream_cleanup_ext(struct AranyaAqcSendStream *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
AranyaError aranya_aqc_send_stream_cleanup(struct AranyaAqcSendStream *ptr)
Releases any resources associated with ptr.
Configuration info builder for Aranya.
Definition aranya-client.h:295
AranyaError aranya_client_config_builder_cleanup(struct AranyaClientConfigBuilder *ptr)
Releases any resources associated with ptr.
AranyaError aranya_client_config_builder_init_ext(struct AranyaClientConfigBuilder *out, struct AranyaExtError *__ext_err)
Initializes AranyaClientConfigBuilder.
AranyaError aranya_client_config_builder_init(struct AranyaClientConfigBuilder *out)
Initializes AranyaClientConfigBuilder.
AranyaError aranya_client_config_builder_cleanup_ext(struct AranyaClientConfigBuilder *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
Configuration info for Aranya.
Definition aranya-client.h:272
A handle to an Aranya Client.
Definition aranya-client.h:260
AranyaError aranya_client_cleanup_ext(struct AranyaClient *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
AranyaError aranya_query_labels_ext(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaLabelId *labels, size_t *labels_len, struct AranyaExtError *__ext_err)
Query for list of existing labels.
AranyaError aranya_create_team_ext(struct AranyaClient *client, const struct AranyaTeamConfig *cfg, struct AranyaTeamId *__output, struct AranyaExtError *__ext_err)
Create a new graph/team with the current device as the owner.
AranyaError aranya_query_device_keybundle_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, uint8_t *keybundle, size_t *keybundle_len, struct AranyaExtError *__ext_err)
Query device's keybundle.
AranyaError aranya_revoke_role_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaRole role, struct AranyaExtError *__ext_err)
Revoke a role from a device.
AranyaError aranya_create_label_ext(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaLabelName name, struct AranyaLabelId *__output, struct AranyaExtError *__ext_err)
Create a channel label.
AranyaError aranya_aqc_get_receive_channel(struct AranyaAqcPeerChannel *channel, struct AranyaAqcReceiveChannel *receiver)
Converts the `AranyaAqcPeerChannel`into an [AranyaAqcReceiveChannel`](AranyaAqcReceiveChannel) for re...
AranyaError aranya_aqc_bidi_stream_send_ext(struct AranyaClient *client, struct AranyaAqcBidiStream *stream, const uint8_t *data, size_t data_len, struct AranyaExtError *__ext_err)
Send some data to a peer using an `AranyaAqcBidiStream`.
AranyaError aranya_add_team_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaTeamConfig *cfg, struct AranyaExtError *__ext_err)
Add a team to the local device store.
AranyaError aranya_query_device_keybundle(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, uint8_t *keybundle, size_t *keybundle_len)
Query device's keybundle.
AranyaError aranya_close_team(struct AranyaClient *client, const struct AranyaTeamId *team)
Close the team and stop all operations on the graph.
AranyaError aranya_create_label(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaLabelName name, struct AranyaLabelId *__output)
Create a channel label.
AranyaError aranya_aqc_create_bidi_channel(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaNetIdentifier peer, const struct AranyaLabelId *label_id, struct AranyaAqcBidiChannel *channel)
Create a bidirectional AQC channel between this device and a peer.
AranyaError aranya_aqc_create_uni_channel(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaNetIdentifier peer, const struct AranyaLabelId *label_id, struct AranyaAqcSendChannel *channel)
Create a unidirectional AQC channel between this device and a peer.
AranyaError aranya_aqc_recv_stream_try_recv_ext(struct AranyaAqcReceiveStream *stream, uint8_t *buffer, size_t buffer_len, size_t *__output, struct AranyaExtError *__ext_err)
Receive some data from an `AranyaAqcReceiveStream`.
AranyaError aranya_aqc_send_create_uni_stream(struct AranyaClient *client, struct AranyaAqcSendChannel *channel, struct AranyaAqcSendStream *stream)
Create a unidirectional stream from an `AranyaAqcSendChannel`.
AranyaError aranya_aqc_bidi_try_receive_stream(struct AranyaAqcBidiChannel *channel, struct AranyaAqcReceiveStream *recv_stream, struct AranyaAqcSendStream *send_stream, bool *send_init)
Tries to receive the receive (and potentially send) ends of a stream.
AranyaError aranya_query_label_exists(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaLabelId *label, bool *__output)
Query if a label exists.
AranyaError aranya_query_labels(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaLabelId *labels, size_t *labels_len)
Query for list of existing labels.
AranyaError aranya_close_team_ext(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaExtError *__ext_err)
Close the team and stop all operations on the graph.
AranyaError aranya_assign_role_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaRole role, struct AranyaExtError *__ext_err)
Assign a role to a device.
AranyaError aranya_aqc_try_receive_channel(struct AranyaClient *client, struct AranyaAqcPeerChannel *channel, AranyaAqcChannelType *__output)
Tries to poll AQC to see if any channels have been received.
AranyaError aranya_revoke_label(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaLabelId *label_id)
Revoke a label from a device.
AranyaError aranya_delete_label_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaLabelId *label_id, struct AranyaExtError *__ext_err)
Delete a channel label.
AranyaError aranya_revoke_label_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaLabelId *label_id, struct AranyaExtError *__ext_err)
Revoke a label from a device.
AranyaError aranya_aqc_delete_uni_channel(struct AranyaClient *client, struct AranyaAqcSendChannel *channel)
Delete a unidirectional AQC channel.
AranyaError aranya_remove_team(struct AranyaClient *client, const struct AranyaTeamId *team)
Remove a team from the local device store.
AranyaError aranya_aqc_recv_stream_try_recv(struct AranyaAqcReceiveStream *stream, uint8_t *buffer, size_t buffer_len, size_t *__output)
Receive some data from an `AranyaAqcReceiveStream`.
AranyaError aranya_client_cleanup(struct AranyaClient *ptr)
Releases any resources associated with ptr.
AranyaError aranya_add_sync_peer_ext(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config, struct AranyaExtError *__ext_err)
Add the peer for automatic periodic Aranya state syncing.
AranyaError aranya_add_sync_peer(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config)
Add the peer for automatic periodic Aranya state syncing.
AranyaError aranya_query_device_label_assignments_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, struct AranyaLabelId *labels, size_t *labels_len, struct AranyaExtError *__ext_err)
Query device label assignments.
AranyaError aranya_aqc_bidi_create_uni_stream_ext(struct AranyaClient *client, struct AranyaAqcBidiChannel *channel, struct AranyaAqcSendStream *stream, struct AranyaExtError *__ext_err)
Create a unidirectional stream from an `AranyaAqcBidiChannel`.
AranyaError aranya_aqc_delete_bidi_channel(struct AranyaClient *client, struct AranyaAqcBidiChannel *channel)
Delete a bidirectional AQC channel.
AranyaError aranya_get_key_bundle(struct AranyaClient *client, uint8_t *keybundle, size_t *keybundle_len)
Gets the public key bundle for this device.
AranyaError aranya_remove_team_ext(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaExtError *__ext_err)
Remove a team from the local device store.
AranyaError aranya_aqc_bidi_create_bidi_stream(struct AranyaClient *client, struct AranyaAqcBidiChannel *channel, struct AranyaAqcBidiStream *stream)
Create a bidirectional stream from a `AranyaAqcBidiChannel`.
AranyaError aranya_aqc_bidi_stream_try_recv_ext(struct AranyaAqcBidiStream *stream, uint8_t *buffer, size_t buffer_len, size_t *__output, struct AranyaExtError *__ext_err)
Receive some data from an `AranyaAqcBidiStream`.
AranyaError aranya_aqc_try_receive_channel_ext(struct AranyaClient *client, struct AranyaAqcPeerChannel *channel, AranyaAqcChannelType *__output, struct AranyaExtError *__ext_err)
Tries to poll AQC to see if any channels have been received.
AranyaError aranya_aqc_send_stream_send_ext(struct AranyaClient *client, struct AranyaAqcSendStream *stream, const uint8_t *data, size_t data_len, struct AranyaExtError *__ext_err)
Send some data over an `AranyaAqcSendStream`m.
AranyaError aranya_aqc_delete_uni_channel_ext(struct AranyaClient *client, struct AranyaAqcSendChannel *channel, struct AranyaExtError *__ext_err)
Delete a unidirectional AQC channel.
AranyaError aranya_sync_now_ext(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config, struct AranyaExtError *__ext_err)
Sync with peer immediately.
AranyaError aranya_aqc_send_create_uni_stream_ext(struct AranyaClient *client, struct AranyaAqcSendChannel *channel, struct AranyaAqcSendStream *stream, struct AranyaExtError *__ext_err)
Create a unidirectional stream from an `AranyaAqcSendChannel`.
AranyaError aranya_client_init(struct AranyaClient *client, const struct AranyaClientConfig *config)
Initializes a new client instance.
AranyaError aranya_aqc_remove_net_identifier(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaNetIdentifier net_identifier)
Disassociate an AQC network identifier from a device.
AranyaError aranya_aqc_get_bidi_channel(struct AranyaAqcPeerChannel *channel, struct AranyaAqcBidiChannel *bidi)
Converts the `AranyaAqcPeerChannel`into an [AranyaAqcBidiChannel`](AranyaAqcBidiChannel) for sending/...
AranyaError aranya_aqc_remove_net_identifier_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaNetIdentifier net_identifier, struct AranyaExtError *__ext_err)
Disassociate an AQC network identifier from a device.
AranyaError aranya_revoke_role(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaRole role)
Revoke a role from a device.
AranyaError aranya_assign_role(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaRole role)
Assign a role to a device.
AranyaError aranya_aqc_create_bidi_channel_ext(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaNetIdentifier peer, const struct AranyaLabelId *label_id, struct AranyaAqcBidiChannel *channel, struct AranyaExtError *__ext_err)
Create a bidirectional AQC channel between this device and a peer.
AranyaError aranya_query_devices_on_team(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaDeviceId *devices, size_t *devices_len)
Query devices on team.
AranyaError aranya_query_devices_on_team_ext(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaDeviceId *devices, size_t *devices_len, struct AranyaExtError *__ext_err)
Query devices on team.
AranyaError aranya_aqc_create_uni_channel_ext(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaNetIdentifier peer, const struct AranyaLabelId *label_id, struct AranyaAqcSendChannel *channel, struct AranyaExtError *__ext_err)
Create a unidirectional AQC channel between this device and a peer.
AranyaError aranya_get_key_bundle_ext(struct AranyaClient *client, uint8_t *keybundle, size_t *keybundle_len, struct AranyaExtError *__ext_err)
Gets the public key bundle for this device.
AranyaError aranya_query_device_label_assignments(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, struct AranyaLabelId *labels, size_t *labels_len)
Query device label assignments.
AranyaError aranya_query_label_exists_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaLabelId *label, bool *__output, struct AranyaExtError *__ext_err)
Query if a label exists.
AranyaError aranya_aqc_assign_net_identifier_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaNetIdentifier net_identifier, struct AranyaExtError *__ext_err)
Associate a network identifier to a device for use with AQC.
AranyaError aranya_aqc_bidi_stream_send(struct AranyaClient *client, struct AranyaAqcBidiStream *stream, const uint8_t *data, size_t data_len)
Send some data to a peer using an `AranyaAqcBidiStream`.
AranyaError aranya_remove_device_from_team(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device)
Remove a device from the team.
AranyaError aranya_aqc_get_receive_channel_ext(struct AranyaAqcPeerChannel *channel, struct AranyaAqcReceiveChannel *receiver, struct AranyaExtError *__ext_err)
Converts the `AranyaAqcPeerChannel`into an [AranyaAqcReceiveChannel`](AranyaAqcReceiveChannel) for re...
AranyaError aranya_remove_device_from_team_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, struct AranyaExtError *__ext_err)
Remove a device from the team.
AranyaError aranya_remove_sync_peer(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr)
Remove the peer from automatic Aranya state syncing.
AranyaError aranya_aqc_bidi_create_bidi_stream_ext(struct AranyaClient *client, struct AranyaAqcBidiChannel *channel, struct AranyaAqcBidiStream *stream, struct AranyaExtError *__ext_err)
Create a bidirectional stream from a `AranyaAqcBidiChannel`.
AranyaError aranya_aqc_send_stream_send(struct AranyaClient *client, struct AranyaAqcSendStream *stream, const uint8_t *data, size_t data_len)
Send some data over an `AranyaAqcSendStream`m.
AranyaError aranya_create_team(struct AranyaClient *client, const struct AranyaTeamConfig *cfg, struct AranyaTeamId *__output)
Create a new graph/team with the current device as the owner.
AranyaError aranya_delete_label(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaLabelId *label_id)
Delete a channel label.
AranyaError aranya_add_team(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaTeamConfig *cfg)
Add a team to the local device store.
AranyaError aranya_get_device_id_ext(struct AranyaClient *client, struct AranyaDeviceId *__output, struct AranyaExtError *__ext_err)
Gets the public device ID.
AranyaError aranya_add_device_to_team(struct AranyaClient *client, const struct AranyaTeamId *team, const uint8_t *keybundle, size_t keybundle_len)
Add a device to the team with the default role.
AranyaError aranya_client_init_ext(struct AranyaClient *client, const struct AranyaClientConfig *config, struct AranyaExtError *__ext_err)
Initializes a new client instance.
AranyaError aranya_assign_label(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaLabelId *label_id, AranyaChanOp op)
Assign a label to a device so that it can be used for a channel.
AranyaError aranya_assign_label_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaLabelId *label_id, AranyaChanOp op, struct AranyaExtError *__ext_err)
Assign a label to a device so that it can be used for a channel.
AranyaError aranya_get_device_id(struct AranyaClient *client, struct AranyaDeviceId *__output)
Gets the public device ID.
AranyaError aranya_aqc_recv_try_receive_uni_stream_ext(struct AranyaAqcReceiveChannel *channel, struct AranyaAqcReceiveStream *stream, struct AranyaExtError *__ext_err)
Receives the stream from an `AranyaAqcReceiveChannel`.
AranyaError aranya_remove_sync_peer_ext(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, struct AranyaExtError *__ext_err)
Remove the peer from automatic Aranya state syncing.
AranyaError aranya_aqc_bidi_stream_try_recv(struct AranyaAqcBidiStream *stream, uint8_t *buffer, size_t buffer_len, size_t *__output)
Receive some data from an `AranyaAqcBidiStream`.
AranyaError aranya_query_aqc_net_identifier(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, char *ident, size_t *ident_len, bool *__output)
Query device's AQC network identifier.
AranyaError aranya_add_device_to_team_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const uint8_t *keybundle, size_t keybundle_len, struct AranyaExtError *__ext_err)
Add a device to the team with the default role.
AranyaError aranya_aqc_assign_net_identifier(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, AranyaNetIdentifier net_identifier)
Associate a network identifier to a device for use with AQC.
AranyaError aranya_aqc_recv_try_receive_uni_stream(struct AranyaAqcReceiveChannel *channel, struct AranyaAqcReceiveStream *stream)
Receives the stream from an `AranyaAqcReceiveChannel`.
AranyaError aranya_aqc_bidi_try_receive_stream_ext(struct AranyaAqcBidiChannel *channel, struct AranyaAqcReceiveStream *recv_stream, struct AranyaAqcSendStream *send_stream, bool *send_init, struct AranyaExtError *__ext_err)
Tries to receive the receive (and potentially send) ends of a stream.
AranyaError aranya_aqc_get_bidi_channel_ext(struct AranyaAqcPeerChannel *channel, struct AranyaAqcBidiChannel *bidi, struct AranyaExtError *__ext_err)
Converts the `AranyaAqcPeerChannel`into an [AranyaAqcBidiChannel`](AranyaAqcBidiChannel) for sending/...
AranyaError aranya_aqc_delete_bidi_channel_ext(struct AranyaClient *client, struct AranyaAqcBidiChannel *channel, struct AranyaExtError *__ext_err)
Delete a bidirectional AQC channel.
AranyaError aranya_sync_now(struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config)
Sync with peer immediately.
AranyaError aranya_aqc_bidi_create_uni_stream(struct AranyaClient *client, struct AranyaAqcBidiChannel *channel, struct AranyaAqcSendStream *stream)
Create a unidirectional stream from an `AranyaAqcBidiChannel`.
AranyaError aranya_query_aqc_net_identifier_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, char *ident, size_t *ident_len, bool *__output, struct AranyaExtError *__ext_err)
Query device's AQC network identifier.
Device ID.
Definition aranya-client.h:288
Extended error information.
Definition aranya-client.h:248
AranyaError aranya_ext_error_msg_ext(const struct AranyaExtError *err, char *msg, size_t *msg_len, struct AranyaExtError *__ext_err)
Copies the extended error's message into msg.
AranyaError aranya_ext_error_init(struct AranyaExtError *out)
Initializes AranyaExtError.
AranyaError aranya_ext_error_msg(const struct AranyaExtError *err, char *msg, size_t *msg_len)
Copies the extended error's message into msg.
AranyaError aranya_ext_error_init_ext(struct AranyaExtError *out, struct AranyaExtError *__ext_err)
Initializes AranyaExtError.
AranyaError aranya_ext_error_cleanup(struct AranyaExtError *ptr)
Releases any resources associated with ptr.
AranyaError aranya_ext_error_cleanup_ext(struct AranyaExtError *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
Definition aranya-client.h:281
AranyaError aranya_id_from_str(const char *str, struct AranyaId *__output)
Decodes str into an `AranyaId`.
AranyaError aranya_id_to_str(const struct AranyaId *id, char *str, size_t *str_len)
Writes the human-readable encoding of id to str.
Label ID.
Definition aranya-client.h:392
Builder for a Sync Peer config.
Definition aranya-client.h:349
AranyaError aranya_sync_peer_config_builder_cleanup(struct AranyaSyncPeerConfigBuilder *ptr)
Releases any resources associated with ptr.
AranyaError aranya_sync_peer_config_builder_init_ext(struct AranyaSyncPeerConfigBuilder *out, struct AranyaExtError *__ext_err)
Initializes AranyaSyncPeerConfigBuilder.
AranyaError aranya_sync_peer_config_builder_init(struct AranyaSyncPeerConfigBuilder *out)
Initializes AranyaSyncPeerConfigBuilder.
AranyaError aranya_sync_peer_config_builder_cleanup_ext(struct AranyaSyncPeerConfigBuilder *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
Sync Peer config.
Definition aranya-client.h:361
Definition aranya-client.h:328
AranyaError aranya_team_config_builder_cleanup_ext(struct AranyaTeamConfigBuilder *ptr, struct AranyaExtError *__ext_err)
Releases any resources associated with ptr.
AranyaError aranya_team_config_builder_init_ext(struct AranyaTeamConfigBuilder *out, struct AranyaExtError *__ext_err)
Initializes AranyaTeamConfigBuilder.
AranyaError aranya_team_config_builder_init(struct AranyaTeamConfigBuilder *out)
Initializes AranyaTeamConfigBuilder.
AranyaError aranya_team_config_builder_cleanup(struct AranyaTeamConfigBuilder *ptr)
Releases any resources associated with ptr.
Definition aranya-client.h:337
Team ID.
Definition aranya-client.h:378