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
111#define ARANYA_SEED_IKM_LEN 32
116#define ARANYA_ID_STR_LEN (((ARANYA_ID_LEN * 1375) / 1000) + 1)
118#if defined(ENABLE_ARANYA_AFC)
125#define ARANYA_AFC_CHANNEL_OVERHEAD 24
178#if defined(ENABLE_ARANYA_AFC)
179 ARANYA_ERROR_WRONG_CHANNEL_TYPE,
357 uint8_t __for_size_only[96];
369 uint8_t __for_size_only[3728];
383 uint8_t __for_size_only[56];
395 uint8_t __for_size_only[112];
428 uint8_t __for_size_only[112];
447 uint8_t __for_size_only[72];
463 uint8_t __for_size_only[288];
479 uint8_t __for_size_only[56];
489typedef struct ARANYA_DEPRECATED_MSG(
"PSK seeds are no longer used with mTLS authentication") AranyaSeedIkm {
506 uint8_t __for_size_only[56];
522 uint8_t __for_size_only[288];
534 uint8_t __for_size_only[328];
546 uint8_t __for_size_only[56];
567 uint8_t __for_size_only[320];
581 uint8_t __for_size_only[56];
593 uint8_t __for_size_only[40];
607 uint8_t __for_size_only[40];
615#if defined(ENABLE_ARANYA_PREVIEW)
619typedef struct ARANYA_ALIGNED(8) AranyaHelloSubscriptionConfigBuilder {
625 uint8_t __for_size_only[40];
626} AranyaHelloSubscriptionConfigBuilder;
629#if defined(ENABLE_ARANYA_PREVIEW)
635typedef struct ARANYA_ALIGNED(8) AranyaHelloSubscriptionConfig {
641 uint8_t __for_size_only[40];
642} AranyaHelloSubscriptionConfig;
680#if defined(ENABLE_ARANYA_AFC)
690 uint8_t __for_size_only[160];
694#if defined(ENABLE_ARANYA_AFC)
704 uint8_t __for_size_only[160];
708#if defined(ENABLE_ARANYA_AFC)
721 uint8_t __for_size_only[32];
725#if defined(ENABLE_ARANYA_AFC)
737 uint8_t __for_size_only[24];
741#if defined(ENABLE_ARANYA_AFC)
763const char *aranya_error_to_str(uint32_t err);
903 const char **__output);
955 const char **__output);
977 const char **__output);
1005 uint8_t *public_key_bundle,
1006 size_t *public_key_bundle_len);
1018 uint8_t *public_key_bundle,
1019 size_t *public_key_bundle_len,
1035ARANYA_DEPRECATED_MSG(
"Use `aranya_get_public_key_bundle`.")
1037 uint8_t *public_key_bundle,
1038 size_t *public_key_bundle_len);
1053ARANYA_DEPRECATED_MSG("Use `aranya_get_public_key_bundle`.")
1055 uint8_t *public_key_bundle,
1056 size_t *public_key_bundle_len,
1163 const
char *address);
1174 const
char *address,
1224ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1236ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1250ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
1252 const uint8_t *_encap_seed,
1253 size_t _encap_seed_len);
1265ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
1267 const uint8_t *_encap_seed,
1268 size_t _encap_seed_len,
1281ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
1283 const struct AranyaSeedIkm *_ikm);
1295ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
1297 const struct AranyaSeedIkm *_ikm,
1310ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
1312 const struct AranyaSeedIkm *_ikm);
1324ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
1326 const struct AranyaSeedIkm *_ikm,
1342ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1359ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1377ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1394ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1449ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1465ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1538ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1554ARANYA_DEPRECATED_MSG("QUIC sync config is no longer used with mTLS authentication")
1721#if defined(ENABLE_ARANYA_PREVIEW)
1733 uint32_t sync_on_hello);
1736#if defined(ENABLE_ARANYA_PREVIEW)
1748 uint32_t sync_on_hello,
1752#if defined(ENABLE_ARANYA_PREVIEW)
1761AranyaError aranya_hello_subscription_config_builder_init(
struct AranyaHelloSubscriptionConfigBuilder *out);
1764#if defined(ENABLE_ARANYA_PREVIEW)
1772AranyaError aranya_hello_subscription_config_builder_cleanup(
struct AranyaHelloSubscriptionConfigBuilder *ptr);
1775#if defined(ENABLE_ARANYA_PREVIEW)
1787AranyaError aranya_hello_subscription_config_build(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1788 struct AranyaHelloSubscriptionConfig *out);
1791#if defined(ENABLE_ARANYA_PREVIEW)
1803AranyaError aranya_hello_subscription_config_build_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1804 struct AranyaHelloSubscriptionConfig *out,
1808#if defined(ENABLE_ARANYA_PREVIEW)
1820AranyaError aranya_hello_subscription_config_builder_set_graph_change_debounce(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1824#if defined(ENABLE_ARANYA_PREVIEW)
1836AranyaError aranya_hello_subscription_config_builder_set_graph_change_debounce_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1841#if defined(ENABLE_ARANYA_PREVIEW)
1853AranyaError aranya_hello_subscription_config_builder_set_expiration(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1857#if defined(ENABLE_ARANYA_PREVIEW)
1869AranyaError aranya_hello_subscription_config_builder_set_expiration_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1874#if defined(ENABLE_ARANYA_PREVIEW)
1885AranyaError aranya_hello_subscription_config_builder_set_periodic_interval(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
1889#if defined(ENABLE_ARANYA_PREVIEW)
1900AranyaError aranya_hello_subscription_config_builder_set_periodic_interval_ext(
struct AranyaHelloSubscriptionConfigBuilder *cfg,
2036 size_t *roles_out_len);
2055 size_t *roles_out_len,
2685ARANYA_DEPRECATED_MSG(
"PSK seeds are no longer used with mTLS authentication")
2688 const uint8_t *public_key_bundle,
2689 size_t public_key_bundle_len,
2713ARANYA_DEPRECATED_MSG("PSK seeds are no longer used with mTLS authentication")
2716 const uint8_t *public_key_bundle,
2717 size_t public_key_bundle_len,
2809 const uint8_t *keybundle,
2810 size_t keybundle_len,
2832 const uint8_t *keybundle,
2833 size_t keybundle_len,
2939#if defined(ENABLE_ARANYA_PREVIEW)
2955 const struct AranyaHelloSubscriptionConfig *config);
2958#if defined(ENABLE_ARANYA_PREVIEW)
2974 const struct AranyaHelloSubscriptionConfig *config,
2978#if defined(ENABLE_ARANYA_PREVIEW)
2995#if defined(ENABLE_ARANYA_PREVIEW)
3077 size_t *devices_len);
3092 size_t *devices_len,
3146 uint8_t *public_key_bundle,
3147 size_t *public_key_bundle_len);
3163 uint8_t *public_key_bundle,
3164 size_t *public_key_bundle_len,
3182ARANYA_DEPRECATED_MSG(
"Use `aranya_team_device_public_key_bundle`.")
3186 uint8_t *public_key_bundle,
3187 size_t *public_key_bundle_len);
3204ARANYA_DEPRECATED_MSG("Use `aranya_team_device_public_key_bundle`.")
3208 uint8_t *public_key_bundle,
3209 size_t *public_key_bundle_len,
3231 size_t *labels_len);
3272 size_t *labels_len);
3362#if defined(ENABLE_ARANYA_AFC)
3373#if defined(ENABLE_ARANYA_AFC)
3384#if defined(ENABLE_ARANYA_AFC)
3395#if defined(ENABLE_ARANYA_AFC)
3406#if defined(ENABLE_ARANYA_AFC)
3435#if defined(ENABLE_ARANYA_AFC)
3465#if defined(ENABLE_ARANYA_AFC)
3479 const uint8_t *control,
3484#if defined(ENABLE_ARANYA_AFC)
3498 const uint8_t *control,
3504#if defined(ENABLE_ARANYA_AFC)
3515#if defined(ENABLE_ARANYA_AFC)
3527#if defined(ENABLE_ARANYA_AFC)
3538#if defined(ENABLE_ARANYA_AFC)
3550#if defined(ENABLE_ARANYA_AFC)
3561#if defined(ENABLE_ARANYA_AFC)
3573#if defined(ENABLE_ARANYA_AFC)
3584#if defined(ENABLE_ARANYA_AFC)
3596#if defined(ENABLE_ARANYA_AFC)
3607#if defined(ENABLE_ARANYA_AFC)
3619#if defined(ENABLE_ARANYA_AFC)
3630#if defined(ENABLE_ARANYA_AFC)
3642#if defined(ENABLE_ARANYA_AFC)
3653 const uint8_t **ptr,
3657#if defined(ENABLE_ARANYA_AFC)
3668 const uint8_t **ptr,
3673#if defined(ENABLE_ARANYA_AFC)
3686#if defined(ENABLE_ARANYA_AFC)
3700#if defined(ENABLE_ARANYA_AFC)
3712 const uint8_t *plaintext,
3713 size_t plaintext_len,
3718#if defined(ENABLE_ARANYA_AFC)
3730 const uint8_t *plaintext,
3731 size_t plaintext_len,
3737#if defined(ENABLE_ARANYA_AFC)
3750 const uint8_t *ciphertext,
3751 size_t ciphertext_len,
3757#if defined(ENABLE_ARANYA_AFC)
3770 const uint8_t *ciphertext,
3771 size_t ciphertext_len,
3778#if defined(ENABLE_ARANYA_AFC)
3794#if defined(ENABLE_ARANYA_AFC)
3811#if defined(ENABLE_ARANYA_AFC)
3827#if defined(ENABLE_ARANYA_AFC)
const char * AranyaRoleName
A role name.
Definition aranya-client.h:650
#define ARANYA_SEED_IKM_LEN
The size in bytes of a PSK seed IKM.
Definition aranya-client.h:111
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
int64_t AranyaRank
A numerical rank used for authorization in the rank-based hierarchy.
Definition aranya-client.h:657
uint64_t AranyaDuration
A type to represent a span of time in nanoseconds.
Definition aranya-client.h:613
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:678
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_add_perm_to_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, AranyaPermission perm, struct AranyaExtError *__ext_err)
Add a permission to a role.
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:664
AranyaError aranya_remove_perm_from_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, AranyaPermission perm, struct AranyaExtError *__ext_err)
Remove a permission from a role.
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.
AranyaPermission
Simple permission.
Definition aranya-client.h:219
@ ARANYA_PERMISSION_CAN_USE_AFC
The role can use AFC.
Definition aranya-client.h:283
@ ARANYA_PERMISSION_CREATE_ROLE
The role can create a role.
Definition aranya-client.h:240
@ ARANYA_PERMISSION_TERMINATE_TEAM
The role can terminate the team.
Definition aranya-client.h:232
@ ARANYA_PERMISSION_DELETE_LABEL
The role can delete a label.
Definition aranya-client.h:270
@ ARANYA_PERMISSION_CHANGE_ROLE_PERMS
The role can change permissions on roles.
Definition aranya-client.h:256
@ ARANYA_PERMISSION_DELETE_ROLE
The role can delete a role.
Definition aranya-client.h:244
@ ARANYA_PERMISSION_ADD_DEVICE
The role can add a device to the team.
Definition aranya-client.h:223
@ ARANYA_PERMISSION_CREATE_LABEL
The role can create a label.
Definition aranya-client.h:266
@ ARANYA_PERMISSION_SETUP_DEFAULT_ROLE
The role can set up default roles.
Definition aranya-client.h:262
@ ARANYA_PERMISSION_REMOVE_DEVICE
The role can remove a device from the team.
Definition aranya-client.h:227
@ ARANYA_PERMISSION_CREATE_AFC_UNI_CHANNEL
The role can create a unidirectional AFC channel.
Definition aranya-client.h:287
@ ARANYA_PERMISSION_ASSIGN_LABEL
The role can assign a label to a device.
Definition aranya-client.h:274
@ ARANYA_PERMISSION_ASSIGN_ROLE
The role can assign a role to other devices.
Definition aranya-client.h:248
@ ARANYA_PERMISSION_REVOKE_LABEL
The role can revoke a label from a device.
Definition aranya-client.h:278
@ ARANYA_PERMISSION_CHANGE_RANK
The role can change the rank of objects.
Definition aranya-client.h:236
@ ARANYA_PERMISSION_REVOKE_ROLE
The role can revoke a role from other devices.
Definition aranya-client.h:252
AranyaError aranya_init_logging_ext(struct AranyaExtError *__ext_err)
Initializes logging.
AranyaError aranya_add_perm_to_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, AranyaPermission perm)
Add a permission to a role.
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:137
@ ARANYA_ERROR_INVALID_ARGUMENT
Invalid argument.
Definition aranya-client.h:153
@ ARANYA_ERROR_CONFIG
Unable to create configuration info.
Definition aranya-client.h:192
@ ARANYA_ERROR_IPC
Could not send request to daemon.
Definition aranya-client.h:173
@ ARANYA_ERROR_INVALID_UTF8
Invalid UTF-8.
Definition aranya-client.h:165
@ ARANYA_ERROR_TIMEOUT
Timed out.
Definition aranya-client.h:149
@ ARANYA_ERROR_BUFFER_TOO_SMALL
Buffer is too small.
Definition aranya-client.h:161
@ ARANYA_ERROR_BUG
Internal bug discovered.
Definition aranya-client.h:145
@ ARANYA_ERROR_INVALID_ADDR
Invalid Address.
Definition aranya-client.h:169
@ ARANYA_ERROR_SERIALIZATION
Serialization error.
Definition aranya-client.h:196
@ ARANYA_ERROR_SUCCESS
Success.
Definition aranya-client.h:141
@ ARANYA_ERROR_NOT_ENABLED
Component is not enabled.
Definition aranya-client.h:157
@ ARANYA_ERROR_OTHER
Some other error occurred.
Definition aranya-client.h:204
@ ARANYA_ERROR_ARANYA
An Aranya error.
Definition aranya-client.h:177
@ ARANYA_ERROR_CLOSED
A connection got unexpectedly closed.
Definition aranya-client.h:188
@ ARANYA_ERROR_WOULD_BLOCK
Tried to poll an endpoint but nothing received yet.
Definition aranya-client.h:184
@ ARANYA_ERROR_DOES_NOT_EXIST
The requested resource does not exist.
Definition aranya-client.h:200
AranyaChanOp
Valid channel operations for a label assignment.
Definition aranya-client.h:300
@ ARANYA_CHAN_OP_SEND_ONLY
The device can only send data in channels with this label.
Definition aranya-client.h:310
@ ARANYA_CHAN_OP_SEND_RECV
The device can send or receive data in channels with this label.
Definition aranya-client.h:315
@ ARANYA_CHAN_OP_RECV_ONLY
The device can only receive data in channels with this label.
Definition aranya-client.h:305
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_remove_perm_from_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, AranyaPermission perm)
Remove a permission from a role.
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:528
Team configuration used when joining a team.
Definition aranya-client.h:561
A builder for initializing an `AranyaAddTeamQuicSyncConfig`.
Definition aranya-client.h:457
QUIC syncer configuration.
Definition aranya-client.h:516
Channel ID for AFC channel.
Definition aranya-client.h:745
An AFC Control Message, used to create the other end of a channel.
Definition aranya-client.h:715
AranyaError aranya_afc_ctrl_msg_cleanup(struct AranyaAfcCtrlMsg *ptr)
Releases any resources associated with ptr.
An AFC Receiving Channel Object.
Definition aranya-client.h:698
AranyaError aranya_afc_receive_channel_cleanup(struct AranyaAfcReceiveChannel *ptr)
Releases any resources associated with ptr.
An AFC Sending Channel Object.
Definition aranya-client.h:684
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:731
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:441
Configuration info for Aranya.
Definition aranya-client.h:377
A handle to an Aranya Client.
Definition aranya-client.h:363
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_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_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_sync_now(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaAddr addr, const struct AranyaSyncPeerConfig *config)
Sync with peer immediately.
AranyaError aranya_change_rank_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaObjectId *object_id, AranyaRank old_rank, AranyaRank new_rank, struct AranyaExtError *__ext_err)
Change the rank of an object (device or label).
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_setup_default_roles(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaRole *roles_out, size_t *roles_len)
Setup default roles on team.
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_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_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_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_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_setup_default_roles_ext(struct AranyaClient *client, const struct AranyaTeamId *team, struct AranyaRole *roles_out, size_t *roles_len, struct AranyaExtError *__ext_err)
Setup default roles on team.
AranyaError aranya_query_role_perms_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, AranyaPermission *perms_out, size_t *perms_len, struct AranyaExtError *__ext_err)
Query all permissions assigned to a role.
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_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_change_rank(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaObjectId *object_id, AranyaRank old_rank, AranyaRank new_rank)
Change the rank of an object (device or label).
AranyaError aranya_delete_role(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role)
Delete a role.
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_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_create_role(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaRoleName role_name, AranyaRank rank, struct AranyaRole *role_out)
Create a role.
AranyaError aranya_rand(const struct AranyaClient *client, uint8_t *buf, size_t buf_len)
Return random bytes from Aranya's CSPRNG.
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_query_role_perms(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, AranyaPermission *perms_out, size_t *perms_len)
Query all permissions assigned to a role.
AranyaError aranya_create_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaRoleName role_name, AranyaRank rank, struct AranyaRole *role_out, struct AranyaExtError *__ext_err)
Create a role.
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_delete_role_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaRoleId *role, struct AranyaExtError *__ext_err)
Delete a role.
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_query_rank(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaObjectId *object_id, AranyaRank *__output)
Query the rank of an object.
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_create_label(const struct AranyaClient *client, const struct AranyaTeamId *team, AranyaLabelName name, AranyaRank rank, struct AranyaLabelId *__output)
Create a channel label with an explicit rank.
AranyaError aranya_query_rank_ext(const struct AranyaClient *client, const struct AranyaTeamId *team, const struct AranyaObjectId *object_id, AranyaRank *__output, struct AranyaExtError *__ext_err)
Query the rank of an object.
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_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, AranyaRank rank, struct AranyaLabelId *__output, struct AranyaExtError *__ext_err)
Create a channel label with an explicit rank.
A builder for initializing a `AranyaCreateTeamConfig`.
Definition aranya-client.h:540
Team configuration used when creating a team.
Definition aranya-client.h:575
A builder for initializing a `AranyaCreateTeamQuicSyncConfig`.
Definition aranya-client.h:473
QUIC syncer configuration.
Definition aranya-client.h:500
Device ID.
Definition aranya-client.h:415
Functions suffixed with _ext accept an extra struct AranyaExtError *ext_err parameter for extended er...
Definition aranya-client.h:351
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:401
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:434
A label.
Definition aranya-client.h:422
AranyaError aranya_label_get_author(const struct AranyaLabel *label, struct AranyaDeviceId *__output)
Get the author of a label.
AranyaError aranya_label_get_id(const struct AranyaLabel *label, struct AranyaLabelId *__output)
Get ID of label.
AranyaError aranya_label_cleanup(struct AranyaLabel *ptr)
Releases any resources associated with ptr.
AranyaError aranya_label_get_name(const struct AranyaLabel *label, const char **__output)
Get name of label.
An identifier for any object with a unique Aranya ID defined in the policy.
Definition aranya-client.h:669
Uniquely identifies a `AranyaRole`.
Definition aranya-client.h:408
A role.
Definition aranya-client.h:389
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.
Builder for a Sync Peer config `AranyaSyncPeerConfig`.
Definition aranya-client.h:587
Sync Peer config.
Definition aranya-client.h:601
Team ID.
Definition aranya-client.h:552