Aranya
Loading...
Searching...
No Matches
aranya-client.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  AranyaExtError
 Extended error information. More...
 
struct  AranyaClient
 A handle to an Aranya Client. More...
 
struct  AranyaAfcConfig
 Aranya Fast Channels (AFC) config. More...
 
struct  AranyaClientConfig
 Aranya client configuration. More...
 
struct  AranyaKeyBundle
 Public Key bundle for a device. More...
 
struct  AranyaDeviceId
 Device ID. More...
 
struct  AranyaTeamId
 Team ID. More...
 
struct  AranyaChannelId
 Channel ID for a fast channel. More...
 
struct  AranyaAfcMsgInfo
 Aranya Fast Channels (AFC) message info. More...
 

Macros

#define __has_attribute(x)
 
#define ARANYA_NO_RETURN
 
#define ARANYA_NON_NULL
 
#define ARANYA_PACKED
 
#define ARANYA_DURATION_SECONDS   (1000 * ARANYA_DURATION_MILLISECONDS)
 
#define ARANYA_DURATION_MILLISECONDS   (1000 * ARANYA_DURATION_MICROSECONDS)
 
#define ARANYA_DURATION_MICROSECONDS   (1000 * ARANYA_DURATION_NANOSECONDS)
 
#define ARANYA_DURATION_NANOSECONDS   1
 

Typedefs

typedef uint32_t AranyaError
 
typedef uint8_t AranyaRole
 
typedef struct AranyaExtError AranyaExtError
 Extended error information.
 
typedef struct AranyaClient AranyaClient
 A handle to an Aranya Client.
 
typedef struct AranyaAfcConfig AranyaAfcConfig
 Aranya Fast Channels (AFC) config.
 
typedef struct AranyaClientConfig AranyaClientConfig
 Aranya client configuration.
 
typedef struct AranyaKeyBundle AranyaKeyBundle
 Public Key bundle for a device.
 
typedef struct AranyaDeviceId AranyaDeviceId
 Device ID.
 
typedef struct AranyaTeamId AranyaTeamId
 Team ID.
 
typedef const char * AranyaAddr
 A network socket address for an Aranya client.
 
typedef uint64_t AranyaDuration
 A type to represent a span of time.
 
typedef const char * AranyaNetIdentifier
 A network identifier for an Aranya client.
 
typedef uint32_t AranyaLabel
 Label is an Aranya Fast Channel label.
 
typedef struct AranyaChannelId AranyaChannelId
 Channel ID for a fast channel.
 
typedef struct sockaddr_storage AranyaSocketAddr
 Network socket address.
 
typedef struct AranyaAfcMsgInfo AranyaAfcMsgInfo
 Aranya Fast Channels (AFC) message info.
 

Enumerations

enum  AranyaError {
  ARANYA_ERROR_SUCCESS , ARANYA_ERROR_BUG , ARANYA_ERROR_TIMEOUT , ARANYA_ERROR_LOG_INIT ,
  ARANYA_ERROR_INVALID_ARGUMENT , ARANYA_ERROR_BUFFER_TOO_SMALL , ARANYA_ERROR_INVALID_UTF8 , ARANYA_ERROR_INVALID_ADDR ,
  ARANYA_ERROR_CONNECTING , ARANYA_ERROR_AFC_ROUTER , ARANYA_ERROR_RPC , ARANYA_ERROR_DAEMON ,
  ARANYA_ERROR_AFC_SHM , ARANYA_ERROR_AFC , ARANYA_ERROR_RUNTIME
}
 An error code. More...
 
enum  AranyaRole { ARANYA_ROLE_OWNER , ARANYA_ROLE_ADMIN , ARANYA_ROLE_OPERATOR , ARANYA_ROLE_MEMBER }
 An enum containing team roles defined in the Aranya policy. More...
 

Functions

AranyaError aranya_init_logging (void)
 Initializes logging.
 
AranyaError aranya_init_logging_ext (struct AranyaExtError *__ext_err)
 Initializes logging.
 

Detailed Description

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

Macro Definition Documentation

◆ __has_attribute

#define __has_attribute ( x)
Value:
0

Typedef Documentation

◆ AranyaAddr

typedef const char* AranyaAddr

A network socket address for an Aranya client.

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

◆ AranyaNetIdentifier

typedef const char* AranyaNetIdentifier

A network identifier for an Aranya client.

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

Enumeration Type Documentation

◆ AranyaError

An error code.

For extended error information, see AranyaExtError.

Enumerator
ARANYA_ERROR_SUCCESS 

Success.

ARANYA_ERROR_BUG 

Internal bug discovered.

ARANYA_ERROR_TIMEOUT 

Timed out.

ARANYA_ERROR_LOG_INIT 

Logging initialization failure.

ARANYA_ERROR_INVALID_ARGUMENT 

Invalid argument.

ARANYA_ERROR_BUFFER_TOO_SMALL 

Buffer is too small.

ARANYA_ERROR_INVALID_UTF8 

Invalid UTF-8.

ARANYA_ERROR_INVALID_ADDR 

Invalid Address.

ARANYA_ERROR_CONNECTING 

Error connecting to daemon.

ARANYA_ERROR_AFC_ROUTER 

AFC router error.

ARANYA_ERROR_RPC 

Could not send request to daemon.

ARANYA_ERROR_DAEMON 

Daemon reported error.

ARANYA_ERROR_AFC_SHM 

AFC shared memory error.

ARANYA_ERROR_AFC 

AFC library error.

◆ AranyaRole

enum AranyaRole

An enum containing team roles defined in the Aranya policy.

Enumerator
ARANYA_ROLE_OWNER 

Owner role.

ARANYA_ROLE_ADMIN 

Admin role.

ARANYA_ROLE_OPERATOR 

Operator role.

ARANYA_ROLE_MEMBER 

Member role.

Function Documentation

◆ aranya_init_logging()

AranyaError aranya_init_logging ( void )

Initializes logging.

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

◆ aranya_init_logging_ext()

AranyaError aranya_init_logging_ext ( struct AranyaExtError * __ext_err)

Initializes logging.

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