14#ifndef ARANYA_CLIENT_H
15#define ARANYA_CLIENT_H
24#include <sys/socket.h>
26#ifndef __has_attribute
27 #define __has_attribute(x) 0
30#if !defined(ARANYA_ALIGNED)
31 #if __has_attribute(aligned)
32 #define ARANYA_ALIGNED(n) __attribute__((aligned(n)))
34 #error "compiler must support `aligned` attribute"
38#if !defined(ARANYA_DESIGNATED_INIT)
39 #if __has_attribute(designated_init)
40 #define ARANYA_DESIGNATED_INIT __attribute__((designated_init))
42 #define ARANYA_DESIGNATED_INIT
46#if !defined(ARANYA_MUST_USE)
47 #if __has_attribute(warn_unused_result)
48 #define ARANYA_MUST_USE __attribute__((warn_unused_result))
50 #define ARANYA_MUST_USE
54#if !defined(ARANYA_NO_RETURN)
55 #if __has_attribute(noreturn)
56 #define ARANYA_NO_RETURN __attribute__((noreturn))
58 #define ARANYA_NO_RETURN
62#if !defined(ARANYA_NON_NULL)
64 #if __has_attribute(nonnull)
65 #define ARANYA_NON_NULL __attribute__((nonnull))
67 #elif defined(__clang__)
68 #define ARANYA_NON_NULL _Nonnull
70 #define ARANYA_NON_NULL
74#if !defined(ARANYA_PACKED)
75 #if __has_attribute(packed)
76 #define ARANYA_PACKED __attribute__((packed))
82#if !defined(ARANYA_DEPRECATED)
83 #if __has_attribute(deprecated)
84 #define ARANYA_DEPRECATED __attribute__((deprecated))
85 #define ARANYA_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
87 #define ARANYA_DEPRECATED
88 #define ARANYA_DEPRECATED_MSG(msg)
93#define ARANYA_DURATION_SECONDS (1000 * ARANYA_DURATION_MILLISECONDS)
95#define ARANYA_DURATION_MILLISECONDS (1000 * ARANYA_DURATION_MICROSECONDS)
97#define ARANYA_DURATION_MICROSECONDS (1000 * ARANYA_DURATION_NANOSECONDS)
99#define ARANYA_DURATION_NANOSECONDS 1
104#define ARANYA_ID_LEN 32
109#define DEFAULT_ROLES_LEN 3
114#define ARANYA_SEED_IKM_LEN 32
119#define ARANYA_ID_STR_LEN (((ARANYA_ID_LEN * 1375) / 1000) + 1)
121#if defined(ENABLE_ARANYA_AFC)
128#define ARANYA_AFC_CHANNEL_OVERHEAD 24
181#if defined(ENABLE_ARANYA_AFC)
182 ARANYA_ERROR_WRONG_CHANNEL_TYPE,
209#if defined(ENABLE_ARANYA_PREVIEW)
213enum AranyaRoleManagementPermission
222 ARANYA_ROLE_MANAGEMENT_PERMISSION_CAN_ASSIGN_ROLE,
227 ARANYA_ROLE_MANAGEMENT_PERMISSION_CAN_REVOKE_ROLE,
232 ARANYA_ROLE_MANAGEMENT_PERMISSION_CAN_CHANGE_ROLE_PERMS,
235typedef uint8_t AranyaRoleManagementPermission;
239#if defined(ENABLE_ARANYA_PREVIEW)
251 ARANYA_PERMISSION_ADD_DEVICE,
255 ARANYA_PERMISSION_REMOVE_DEVICE,
260 ARANYA_PERMISSION_TERMINATE_TEAM,
264 ARANYA_PERMISSION_CREATE_ROLE,
268 ARANYA_PERMISSION_DELETE_ROLE,
272 ARANYA_PERMISSION_ASSIGN_ROLE,
276 ARANYA_PERMISSION_REVOKE_ROLE,
280 ARANYA_PERMISSION_CHANGE_ROLE_MANAGEMENT_PERMS,
286 ARANYA_PERMISSION_SETUP_DEFAULT_ROLE,
291 ARANYA_PERMISSION_CHANGE_ROLE_MANAGING_ROLE,
295 ARANYA_PERMISSION_CREATE_LABEL,
299 ARANYA_PERMISSION_DELETE_LABEL,
305 ARANYA_PERMISSION_CHANGE_LABEL_MANAGING_ROLE,
311 ARANYA_PERMISSION_ASSIGN_LABEL,
317 ARANYA_PERMISSION_REVOKE_LABEL,
322 ARANYA_PERMISSION_CAN_USE_AFC,
326 ARANYA_PERMISSION_CREATE_AFC_UNI_CHANNEL,
329typedef uint8_t AranyaPermission;
397 uint8_t __for_size_only[96];
409 uint8_t __for_size_only[3728];
423 uint8_t __for_size_only[56];
435 uint8_t __for_size_only[112];
468 uint8_t __for_size_only[72];
482 uint8_t __for_size_only[288];
496 uint8_t __for_size_only[56];
517 uint8_t __for_size_only[56];
531 uint8_t __for_size_only[288];
543 uint8_t __for_size_only[328];
555 uint8_t __for_size_only[56];
576 uint8_t __for_size_only[320];
590 uint8_t __for_size_only[56];
602 uint8_t __for_size_only[40];
616 uint8_t __for_size_only[40];
624#if defined(ENABLE_ARANYA_PREVIEW)
628typedef struct ARANYA_ALIGNED(8) AranyaHelloSubscriptionConfigBuilder {
634 uint8_t __for_size_only[40];
635} AranyaHelloSubscriptionConfigBuilder;
638#if defined(ENABLE_ARANYA_PREVIEW)
644typedef struct ARANYA_ALIGNED(8) AranyaHelloSubscriptionConfig {
650 uint8_t __for_size_only[40];
651} AranyaHelloSubscriptionConfig;
682#if defined(ENABLE_ARANYA_AFC)
692 uint8_t __for_size_only[160];
696#if defined(ENABLE_ARANYA_AFC)
706 uint8_t __for_size_only[160];
710#if defined(ENABLE_ARANYA_AFC)
723 uint8_t __for_size_only[32];
727#if defined(ENABLE_ARANYA_AFC)
739 uint8_t __for_size_only[24];
743#if defined(ENABLE_ARANYA_AFC)
765const char *aranya_error_to_str(uint32_t err);
905 const char **__output);
954 uint8_t *public_key_bundle,
955 size_t *public_key_bundle_len);
967 uint8_t *public_key_bundle,
968 size_t *public_key_bundle_len,
982ARANYA_DEPRECATED_MSG(
"Use `aranya_get_public_key_bundle`.")
984 uint8_t *public_key_bundle,
985 size_t *public_key_bundle_len);
998ARANYA_DEPRECATED_MSG("Use `aranya_get_public_key_bundle`.")
1000 uint8_t *public_key_bundle,
1001 size_t *public_key_bundle_len,
1108 const
char *address);
1119 const
char *address,
1194 const uint8_t *encap_seed,
1195 size_t encap_seed_len);
1208 const uint8_t *encap_seed,
1209 size_t encap_seed_len,
1634#if defined(ENABLE_ARANYA_PREVIEW)
1646 uint32_t sync_on_hello);
1649#if defined(ENABLE_ARANYA_PREVIEW)
1661 uint32_t sync_on_hello,
1665#if defined(ENABLE_ARANYA_PREVIEW)
1674AranyaError aranya_hello_subscription_config_builder_init(
struct AranyaHelloSubscriptionConfigBuilder *out);
1677#if defined(ENABLE_ARANYA_PREVIEW)
1685AranyaError aranya_hello_subscription_config_builder_cleanup(
struct AranyaHelloSubscriptionConfigBuilder *ptr);
1688#if defined(ENABLE_ARANYA_PREVIEW)
1700AranyaError aranya_hello_subscription_config_build(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1701 struct AranyaHelloSubscriptionConfig *out);
1704#if defined(ENABLE_ARANYA_PREVIEW)
1716AranyaError aranya_hello_subscription_config_build_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1717 struct AranyaHelloSubscriptionConfig *out,
1721#if defined(ENABLE_ARANYA_PREVIEW)
1733AranyaError aranya_hello_subscription_config_builder_set_graph_change_debounce(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1737#if defined(ENABLE_ARANYA_PREVIEW)
1749AranyaError aranya_hello_subscription_config_builder_set_graph_change_debounce_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1754#if defined(ENABLE_ARANYA_PREVIEW)
1766AranyaError aranya_hello_subscription_config_builder_set_expiration(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1770#if defined(ENABLE_ARANYA_PREVIEW)
1782AranyaError aranya_hello_subscription_config_builder_set_expiration_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1787#if defined(ENABLE_ARANYA_PREVIEW)
1798AranyaError aranya_hello_subscription_config_builder_set_periodic_interval(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1802#if defined(ENABLE_ARANYA_PREVIEW)
1813AranyaError aranya_hello_subscription_config_builder_set_periodic_interval_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1879#if defined(ENABLE_ARANYA_PREVIEW)
1896#if defined(ENABLE_ARANYA_PREVIEW)
1914#if defined(ENABLE_ARANYA_PREVIEW)
1931#if defined(ENABLE_ARANYA_PREVIEW)
1992#if defined(ENABLE_ARANYA_PREVIEW)
2008 AranyaRoleManagementPermission perm);
2011#if defined(ENABLE_ARANYA_PREVIEW)
2027 AranyaRoleManagementPermission perm,
2031#if defined(ENABLE_ARANYA_PREVIEW)
2047 AranyaRoleManagementPermission perm);
2050#if defined(ENABLE_ARANYA_PREVIEW)
2066 AranyaRoleManagementPermission perm,
2130 size_t *roles_out_len);
2149 size_t *roles_out_len,
2152#if defined(ENABLE_ARANYA_PREVIEW)
2175#if defined(ENABLE_ARANYA_PREVIEW)
2199#if defined(ENABLE_ARANYA_PREVIEW)
2219#if defined(ENABLE_ARANYA_PREVIEW)
2240#if defined(ENABLE_ARANYA_PREVIEW)
2256 AranyaPermission perm);
2259#if defined(ENABLE_ARANYA_PREVIEW)
2275 AranyaPermission perm,
2279#if defined(ENABLE_ARANYA_PREVIEW)
2295 AranyaPermission perm);
2298#if defined(ENABLE_ARANYA_PREVIEW)
2314 AranyaPermission perm,
2540#if defined(ENABLE_ARANYA_PREVIEW)
2559#if defined(ENABLE_ARANYA_PREVIEW)
2659 const uint8_t *public_key_bundle,
2660 size_t public_key_bundle_len,
2686 const uint8_t *public_key_bundle,
2687 size_t public_key_bundle_len,
2776 const uint8_t *public_key_bundle,
2777 size_t public_key_bundle_len,
2795 const uint8_t *public_key_bundle,
2796 size_t public_key_bundle_len,
2897#if defined(ENABLE_ARANYA_PREVIEW)
2913 const struct AranyaHelloSubscriptionConfig *config);
2916#if defined(ENABLE_ARANYA_PREVIEW)
2932 const struct AranyaHelloSubscriptionConfig *config,
2936#if defined(ENABLE_ARANYA_PREVIEW)
2953#if defined(ENABLE_ARANYA_PREVIEW)
3035 size_t *devices_len);
3050 size_t *devices_len,
3104 uint8_t *public_key_bundle,
3105 size_t *public_key_bundle_len);
3121 uint8_t *public_key_bundle,
3122 size_t *public_key_bundle_len,
3138ARANYA_DEPRECATED_MSG(
"Use `aranya_team_device_public_key_bundle`.")
3142 uint8_t *public_key_bundle,
3143 size_t *public_key_bundle_len);
3158ARANYA_DEPRECATED_MSG("Use `aranya_team_device_public_key_bundle`.")
3162 uint8_t *public_key_bundle,
3163 size_t *public_key_bundle_len,
3185 size_t *labels_len);
3226 size_t *labels_len);
3281#if defined(ENABLE_ARANYA_AFC)
3292#if defined(ENABLE_ARANYA_AFC)
3303#if defined(ENABLE_ARANYA_AFC)
3314#if defined(ENABLE_ARANYA_AFC)
3325#if defined(ENABLE_ARANYA_AFC)
3353#if defined(ENABLE_ARANYA_AFC)
3382#if defined(ENABLE_ARANYA_AFC)
3396 const uint8_t *control,
3401#if defined(ENABLE_ARANYA_AFC)
3415 const uint8_t *control,
3421#if defined(ENABLE_ARANYA_AFC)
3432#if defined(ENABLE_ARANYA_AFC)
3444#if defined(ENABLE_ARANYA_AFC)
3455#if defined(ENABLE_ARANYA_AFC)
3467#if defined(ENABLE_ARANYA_AFC)
3478#if defined(ENABLE_ARANYA_AFC)
3490#if defined(ENABLE_ARANYA_AFC)
3501#if defined(ENABLE_ARANYA_AFC)
3513#if defined(ENABLE_ARANYA_AFC)
3524#if defined(ENABLE_ARANYA_AFC)
3536#if defined(ENABLE_ARANYA_AFC)
3547#if defined(ENABLE_ARANYA_AFC)
3559#if defined(ENABLE_ARANYA_AFC)
3570 const uint8_t **ptr,
3574#if defined(ENABLE_ARANYA_AFC)
3585 const uint8_t **ptr,
3590#if defined(ENABLE_ARANYA_AFC)
3603#if defined(ENABLE_ARANYA_AFC)
3617#if defined(ENABLE_ARANYA_AFC)
3629 const uint8_t *plaintext,
3630 size_t plaintext_len,
3635#if defined(ENABLE_ARANYA_AFC)
3647 const uint8_t *plaintext,
3648 size_t plaintext_len,
3654#if defined(ENABLE_ARANYA_AFC)
3667 const uint8_t *ciphertext,
3668 size_t ciphertext_len,
3674#if defined(ENABLE_ARANYA_AFC)
3687 const uint8_t *ciphertext,
3688 size_t ciphertext_len,
3695#if defined(ENABLE_ARANYA_AFC)
3711#if defined(ENABLE_ARANYA_AFC)
3728#if defined(ENABLE_ARANYA_AFC)
3744#if defined(ENABLE_ARANYA_AFC)
const char * AranyaRoleName
A role name.
Definition aranya-client.h:659
#define ARANYA_SEED_IKM_LEN
The size in bytes of a PSK seed IKM.
Definition aranya-client.h:114
AranyaError aranya_afc_ctrl_msg_get_bytes_ext(const struct AranyaAfcCtrlMsg *control, const uint8_t **ptr, size_t *len, struct AranyaExtError *__ext_err)
Returns the raw data for a given `AranyaAfcCtrlMsg`.
AranyaError aranya_afc_channel_seal_ext(struct AranyaAfcSendChannel *channel, const uint8_t *plaintext, size_t plaintext_len, uint8_t *dst, size_t *dst_len, struct AranyaExtError *__ext_err)
Encrypts and authenticates plaintext, and writes it to dst.
AranyaError aranya_afc_ctrl_msg_get_bytes(const struct AranyaAfcCtrlMsg *control, const uint8_t **ptr, size_t *len)
Returns the raw data for a given `AranyaAfcCtrlMsg`.
#define ARANYA_ID_LEN
The size in bytes of an ID.
Definition aranya-client.h:104
uint64_t AranyaDuration
A type to represent a span of time in nanoseconds.
Definition aranya-client.h:622
AranyaError aranya_afc_send_channel_get_id(const struct AranyaAfcSendChannel *channel, struct AranyaAfcChannelId *__output)
Returns the `AranyaAfcChannelId` for the associated `AranyaAfcSendChannel`.
AranyaError aranya_afc_channel_open_ext(const struct AranyaAfcReceiveChannel *channel, const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *dst, size_t *dst_len, struct AranyaAfcSeq *seq, struct AranyaExtError *__ext_err)
Decrypts and authenticates ciphertext, and writes it to dst.
AranyaError aranya_afc_send_channel_get_id_ext(const struct AranyaAfcSendChannel *channel, struct AranyaAfcChannelId *__output, struct AranyaExtError *__ext_err)
Returns the `AranyaAfcChannelId` for the associated `AranyaAfcSendChannel`.
const char * AranyaAddr
A network socket address for an Aranya client.
Definition aranya-client.h:680
AranyaError aranya_init_logging(void)
Initializes logging.
AranyaError aranya_afc_receive_channel_get_peer_id_ext(const struct AranyaAfcReceiveChannel *channel, struct AranyaDeviceId *__output, struct AranyaExtError *__ext_err)
Returns the device ID of the peer on the other side of the channel.
AranyaError aranya_afc_receive_channel_get_id(const struct AranyaAfcReceiveChannel *channel, struct AranyaAfcChannelId *__output)
Returns the `AranyaAfcChannelId` for the associated `AranyaAfcReceiveChannel`.
AranyaError aranya_afc_send_channel_get_label_id_ext(const struct AranyaAfcSendChannel *channel, struct AranyaLabelId *__output, struct AranyaExtError *__ext_err)
Returns the `AranyaLabelId` for the associated `AranyaAfcSendChannel`.
AranyaError aranya_afc_receive_channel_get_peer_id(const struct AranyaAfcReceiveChannel *channel, struct AranyaDeviceId *__output)
Returns the device ID of the peer on the other side of the channel.
AranyaError aranya_afc_channel_seal(struct AranyaAfcSendChannel *channel, const uint8_t *plaintext, size_t plaintext_len, uint8_t *dst, size_t *dst_len)
Encrypts and authenticates plaintext, and writes it to dst.
AranyaError aranya_afc_send_channel_get_label_id(const struct AranyaAfcSendChannel *channel, struct AranyaLabelId *__output)
Returns the `AranyaLabelId` for the associated `AranyaAfcSendChannel`.
AranyaError aranya_afc_seq_cmp_ext(const struct AranyaAfcSeq *seq1, const struct AranyaAfcSeq *seq2, int *__output, struct AranyaExtError *__ext_err)
Returns the three-way comparison between seq1 and seq2.
const char * AranyaLabelName
A label name.
Definition aranya-client.h:666
AranyaError aranya_afc_send_channel_get_peer_id(const struct AranyaAfcSendChannel *channel, struct AranyaDeviceId *__output)
Returns the device ID of the peer on the other side of the channel.
AranyaError aranya_afc_seq_cmp(const struct AranyaAfcSeq *seq1, const struct AranyaAfcSeq *seq2, int *__output)
Returns the three-way comparison between seq1 and seq2.
AranyaError aranya_init_logging_ext(struct AranyaExtError *__ext_err)
Initializes logging.
AranyaError aranya_afc_receive_channel_get_label_id(const struct AranyaAfcReceiveChannel *channel, struct AranyaLabelId *__output)
Returns the `AranyaLabelId` for the associated `AranyaAfcReceiveChannel`.
AranyaError
An error code.
Definition aranya-client.h:140
@ ARANYA_ERROR_INVALID_ARGUMENT
Invalid argument.
Definition aranya-client.h:156
@ ARANYA_ERROR_CONFIG
Unable to create configuration info.
Definition aranya-client.h:195
@ ARANYA_ERROR_IPC
Could not send request to daemon.
Definition aranya-client.h:176
@ ARANYA_ERROR_INVALID_UTF8
Invalid UTF-8.
Definition aranya-client.h:168
@ ARANYA_ERROR_TIMEOUT
Timed out.
Definition aranya-client.h:152
@ ARANYA_ERROR_BUFFER_TOO_SMALL
Buffer is too small.
Definition aranya-client.h:164
@ ARANYA_ERROR_BUG
Internal bug discovered.
Definition aranya-client.h:148
@ ARANYA_ERROR_INVALID_ADDR
Invalid Address.
Definition aranya-client.h:172
@ ARANYA_ERROR_SERIALIZATION
Serialization error.
Definition aranya-client.h:199
@ ARANYA_ERROR_SUCCESS
Success.
Definition aranya-client.h:144
@ ARANYA_ERROR_NOT_ENABLED
Component is not enabled.
Definition aranya-client.h:160
@ ARANYA_ERROR_OTHER
Some other error occurred.
Definition aranya-client.h:203
@ ARANYA_ERROR_ARANYA
An Aranya error.
Definition aranya-client.h:180
@ ARANYA_ERROR_CLOSED
A connection got unexpectedly closed.
Definition aranya-client.h:191
@ ARANYA_ERROR_WOULD_BLOCK
Tried to poll an endpoint but nothing received yet.
Definition aranya-client.h:187
AranyaChanOp
Valid channel operations for a label assignment.
Definition aranya-client.h:340
@ ARANYA_CHAN_OP_SEND_ONLY
The device can only send data in channels with this label.
Definition aranya-client.h:350
@ ARANYA_CHAN_OP_SEND_RECV
The device can send or receive data in channels with this label.
Definition aranya-client.h:355
@ ARANYA_CHAN_OP_RECV_ONLY
The device can only receive data in channels with this label.
Definition aranya-client.h:345
AranyaError aranya_afc_channel_open(const struct AranyaAfcReceiveChannel *channel, const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *dst, size_t *dst_len, struct AranyaAfcSeq *seq)
Decrypts and authenticates ciphertext, and writes it to dst.
AranyaError aranya_afc_send_channel_get_peer_id_ext(const struct AranyaAfcSendChannel *channel, struct AranyaDeviceId *__output, struct AranyaExtError *__ext_err)
Returns the device ID of the peer on the other side of the channel.
AranyaError aranya_afc_receive_channel_get_id_ext(const struct AranyaAfcReceiveChannel *channel, struct AranyaAfcChannelId *__output, struct AranyaExtError *__ext_err)
Returns the `AranyaAfcChannelId` for the associated `AranyaAfcReceiveChannel`.
AranyaError aranya_afc_receive_channel_get_label_id_ext(const struct AranyaAfcReceiveChannel *channel, struct AranyaLabelId *__output, struct AranyaExtError *__ext_err)
Returns the `AranyaLabelId` for the associated `AranyaAfcReceiveChannel`.
A builder for initializing an `AranyaAddTeamConfig`.
Definition aranya-client.h:537
Team configuration used when joining a team.
Definition aranya-client.h:570
A builder for initializing an `AranyaAddTeamQuicSyncConfig`.
Definition aranya-client.h:476
QUIC syncer configuration.
Definition aranya-client.h:525
Channel ID for AFC channel.
Definition aranya-client.h:747
An AFC Control Message, used to create the other end of a channel.
Definition aranya-client.h:717
AranyaError aranya_afc_ctrl_msg_cleanup(struct AranyaAfcCtrlMsg *ptr)
Releases any resources associated with ptr.
An AFC Receiving Channel Object.
Definition aranya-client.h:700
AranyaError aranya_afc_receive_channel_cleanup(struct AranyaAfcReceiveChannel *ptr)
Releases any resources associated with ptr.
An AFC Sending Channel Object.
Definition aranya-client.h:686
AranyaError aranya_afc_send_channel_cleanup(struct AranyaAfcSendChannel *ptr)
Releases any resources associated with ptr.
An AFC Sequence Number, for reordering messages.
Definition aranya-client.h:733
AranyaError aranya_afc_seq_cleanup(struct AranyaAfcSeq *ptr)
Releases any resources associated with ptr.
Configuration info builder for an Aranya client config `AranyaClientConfig`.
Definition aranya-client.h:462
Configuration info for Aranya.
Definition aranya-client.h:417
A handle to an Aranya Client.
Definition aranya-client.h:403
AranyaError aranya_remove_team_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaExtError *__ext_err)
Remove a team from local device storage.
AranyaError aranya_afc_send_channel_delete_ext(const struct AranyaClient *client, struct AranyaAfcSendChannel *channel, struct AranyaExtError *__ext_err)
Removes an `AranyaAfcSendChannel` from use.
AranyaError aranya_encrypt_psk_seed_for_peer(const struct AranyaClient *client, const struct AranyaTeamId *team_id, const uint8_t *public_key_bundle, size_t public_key_bundle_len, uint8_t *seed, size_t *seed_len)
Return serialized PSK seed encrypted for another device on the team.
AranyaError aranya_afc_accept_channel_ext(const struct AranyaClient *client, const struct AranyaTeamId *team_id, const uint8_t *control, size_t control_len, struct AranyaAfcReceiveChannel *channel, struct AranyaExtError *__ext_err)
Accept a receive-only AFC channel from by a peer by processing a control message.
AranyaError aranya_assign_label_ext(const 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_sync_now_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config, struct AranyaExtError *__ext_err)
Sync with peer immediately.
AranyaError aranya_setup_default_roles_ext(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *owning_role, struct AranyaRole *roles_out, size_t *roles_len, struct AranyaExtError *__ext_err)
Assign a role to a device.
AranyaError aranya_encrypt_psk_seed_for_peer_ext(const struct AranyaClient *client, const struct AranyaTeamId *team_id, const uint8_t *public_key_bundle, size_t public_key_bundle_len, uint8_t *seed, size_t *seed_len, struct AranyaExtError *__ext_err)
Return serialized PSK seed encrypted for another device on the team.
AranyaError aranya_delete_label(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaLabelId *label_id)
Delete a channel label.
AranyaError aranya_change_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaRoleId *old_role, const struct AranyaRoleId *new_role, struct AranyaExtError *__ext_err)
Changes the role on a device
AranyaError aranya_afc_accept_channel(const struct AranyaClient *client, const struct AranyaTeamId *team_id, const uint8_t *control, size_t control_len, struct AranyaAfcReceiveChannel *channel)
Accept a receive-only AFC channel from by a peer by processing a control message.
AranyaError aranya_revoke_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaRoleId *role_id)
Revoke a role from a device.
AranyaError aranya_add_sync_peer_ext(const 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_sync_now(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config)
Sync with peer immediately.
AranyaError aranya_delete_label_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaLabelId *label_id, struct AranyaExtError *__ext_err)
Delete a channel label.
AranyaError aranya_revoke_label(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaLabelId *label_id)
Revoke a label from a device.
AranyaError aranya_team_device_public_key_bundle_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, uint8_t *public_key_bundle, size_t *public_key_bundle_len, struct AranyaExtError *__ext_err)
Query device's public key bundle.
AranyaError aranya_add_team_ext(const struct AranyaClient *client, const struct AranyaAddTeamConfig *cfg, struct AranyaExtError *__ext_err)
Add a team to the local device store.
AranyaError aranya_team_devices_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaDeviceId *devices, size_t *devices_len, struct AranyaExtError *__ext_err)
Query devices on team.
AranyaError aranya_client_cleanup(struct AranyaClient *ptr)
Releases any resources associated with ptr.
AranyaError aranya_revoke_label_ext(const 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_add_device_to_team(const struct AranyaClient *client, const struct AranyaTeamId *team, const uint8_t *public_key_bundle, size_t public_key_bundle_len, const struct AranyaRoleId *role_id)
Add a device to the team with the default role.
AranyaError aranya_team_roles(const struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaRole *roles_out, size_t *roles_out_len)
Returns all of the roles for this team.
AranyaError aranya_remove_team(const struct AranyaClient *client, const struct AranyaTeamId *team)
Remove a team from local device storage.
AranyaError aranya_team_device_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, struct AranyaRole *role_out, bool *has_role, struct AranyaExtError *__ext_err)
Returns the role assigned to the device, if any.
AranyaError aranya_remove_device_from_team(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device)
Remove a device from the team.
AranyaError aranya_team_device_public_key_bundle(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, uint8_t *public_key_bundle, size_t *public_key_bundle_len)
Query device's public key bundle.
AranyaError aranya_close_team(const struct AranyaClient *client, const struct AranyaTeamId *team)
Close the team and stop all operations on the graph.
AranyaError aranya_team_devices(const struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaDeviceId *devices, size_t *devices_len)
Query devices on team.
AranyaError aranya_afc_create_channel_ext(const struct AranyaClient *client, const struct AranyaTeamId *team_id, const struct AranyaDeviceId *peer_id, const struct AranyaLabelId *label_id, struct AranyaAfcSendChannel *channel, struct AranyaAfcCtrlMsg *control, struct AranyaExtError *__ext_err)
Create a send-only AFC channel between this device and a peer.
AranyaError aranya_add_device_to_team_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const uint8_t *public_key_bundle, size_t public_key_bundle_len, const struct AranyaRoleId *role_id, struct AranyaExtError *__ext_err)
Add a device to the team with the default role.
AranyaError aranya_afc_create_channel(const struct AranyaClient *client, const struct AranyaTeamId *team_id, const struct AranyaDeviceId *peer_id, const struct AranyaLabelId *label_id, struct AranyaAfcSendChannel *channel, struct AranyaAfcCtrlMsg *control)
Create a send-only AFC channel between this device and a peer.
AranyaError aranya_create_team(const struct AranyaClient *client, const struct AranyaCreateTeamConfig *cfg, struct AranyaTeamId *__output)
Create a new graph/team with the current device as the owner.
AranyaError aranya_client_init(struct AranyaClient *client, const struct AranyaClientConfig *config)
Initializes a new client instance.
AranyaError aranya_get_public_key_bundle(const struct AranyaClient *client, uint8_t *public_key_bundle, size_t *public_key_bundle_len)
Gets the public key bundle for this device.
AranyaError aranya_get_public_key_bundle_ext(const struct AranyaClient *client, uint8_t *public_key_bundle, size_t *public_key_bundle_len, struct AranyaExtError *__ext_err)
Gets the public key bundle for this device.
AranyaError aranya_afc_receive_channel_delete(const struct AranyaClient *client, struct AranyaAfcReceiveChannel *channel)
Removes an `AranyaAfcReceiveChannel` from use.
AranyaError aranya_role_owners_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, struct AranyaRole *roles_out, size_t *roles_len, struct AranyaExtError *__ext_err)
Returns the roles that own role.
AranyaError aranya_team_device_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, struct AranyaRole *role_out, bool *has_role)
Returns the role assigned to the device, if any.
AranyaError aranya_assign_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaRoleId *role_id)
Assign a role to a device.
AranyaError aranya_rand(const struct AranyaClient *client, uint8_t *buf, size_t buf_len)
Return random bytes from Aranya's CSPRNG.
AranyaError aranya_remove_sync_peer(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr)
Remove the peer from automatic Aranya state syncing.
AranyaError aranya_create_team_ext(const struct AranyaClient *client, const struct AranyaCreateTeamConfig *cfg, struct AranyaTeamId *__output, struct AranyaExtError *__ext_err)
Create a new graph/team with the current device as the owner.
AranyaError aranya_remove_device_from_team_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, struct AranyaExtError *__ext_err)
Remove a device from the team.
AranyaError aranya_team_roles_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaRole *roles_out, size_t *roles_out_len, struct AranyaExtError *__ext_err)
Returns all of the roles for this team.
AranyaError aranya_afc_receive_channel_delete_ext(const struct AranyaClient *client, struct AranyaAfcReceiveChannel *channel, struct AranyaExtError *__ext_err)
Removes an `AranyaAfcReceiveChannel` from use.
AranyaError aranya_add_team(const struct AranyaClient *client, const struct AranyaAddTeamConfig *cfg)
Add a team to the local device store.
AranyaError aranya_role_owners(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, struct AranyaRole *roles_out, size_t *roles_len)
Returns the roles that own role.
AranyaError aranya_setup_default_roles(struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *owning_role, struct AranyaRole *roles_out, size_t *roles_len)
Assign a role to a device.
AranyaError aranya_change_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaRoleId *old_role, const struct AranyaRoleId *new_role)
Changes the role on a device
AranyaError aranya_rand_ext(const struct AranyaClient *client, uint8_t *buf, size_t buf_len, struct AranyaExtError *__ext_err)
Return random bytes from Aranya's CSPRNG.
AranyaError aranya_client_init_ext(struct AranyaClient *client, const struct AranyaClientConfig *config, struct AranyaExtError *__ext_err)
Initializes a new client instance.
AranyaError aranya_add_sync_peer(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config)
Add the peer for automatic periodic Aranya state syncing.
AranyaError aranya_assign_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaRoleId *role_id, struct AranyaExtError *__ext_err)
Assign a role to a device.
AranyaError aranya_revoke_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaDeviceId *device, const struct AranyaRoleId *role_id, struct AranyaExtError *__ext_err)
Revoke a role from a device.
AranyaError aranya_afc_send_channel_delete(const struct AranyaClient *client, struct AranyaAfcSendChannel *channel)
Removes an `AranyaAfcSendChannel` from use.
AranyaError aranya_remove_sync_peer_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, struct AranyaExtError *__ext_err)
Remove the peer from automatic Aranya state syncing.
AranyaError aranya_close_team_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaExtError *__ext_err)
Close the team and stop all operations on the graph.
AranyaError aranya_assign_label(const 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_create_label_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaLabelName name, const struct AranyaRoleId *managing_role_id, struct AranyaLabelId *__output, struct AranyaExtError *__ext_err)
Create a channel label.
AranyaError aranya_create_label(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaLabelName name, const struct AranyaRoleId *managing_role_id, struct AranyaLabelId *__output)
Create a channel label.
A builder for initializing a `AranyaCreateTeamConfig`.
Definition aranya-client.h:549
Team configuration used when creating a team.
Definition aranya-client.h:584
A builder for initializing a `AranyaCreateTeamQuicSyncConfig`.
Definition aranya-client.h:490
QUIC syncer configuration.
Definition aranya-client.h:511
Device ID.
Definition aranya-client.h:455
Functions suffixed with _ext accept an extra struct AranyaExtError *ext_err parameter for extended er...
Definition aranya-client.h:391
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_cleanup(struct AranyaExtError *ptr)
Releases any resources associated with ptr.
Cryptographically secure Aranya ID.
Definition aranya-client.h:441
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:671
Uniquely identifies a `AranyaRole`.
Definition aranya-client.h:448
A role.
Definition aranya-client.h:429
AranyaError aranya_role_get_author(const struct AranyaRole *role, struct AranyaDeviceId *__output)
Get the author of a role.
AranyaError aranya_role_get_id_ext(const struct AranyaRole *role, struct AranyaRoleId *__output, struct AranyaExtError *__ext_err)
Get ID of role.
AranyaError aranya_role_cleanup(struct AranyaRole *ptr)
Releases any resources associated with ptr.
AranyaError aranya_role_get_name(const struct AranyaRole *role, const char **__output)
Get name of role.
AranyaError aranya_role_get_id(const struct AranyaRole *role, struct AranyaRoleId *__output)
Get ID of role.
AranyaError aranya_role_get_author_ext(const struct AranyaRole *role, struct AranyaDeviceId *__output, struct AranyaExtError *__ext_err)
Get the author of a role.
Raw PSK seed IKM for QUIC syncer.
Definition aranya-client.h:502
Builder for a Sync Peer config `AranyaSyncPeerConfig`.
Definition aranya-client.h:596
Sync Peer config.
Definition aranya-client.h:610
Team ID.
Definition aranya-client.h:561