AERN: Authenticated Encrypted Relay Network 1.0.0.0a (A1)
A post quantum authenticated and encrypted proxy chain network
server.h File Reference

The common AERN server functions. More...

#include "aerncommon.h"
#include "certificate.h"
#include "commands.h"
#include "logger.h"
#include "aern.h"
#include "topology.h"
#include "collection.h"

Go to the source code of this file.

Data Structures

struct  aern_server_application_state
 The AERN server state. More...

Macros

#define AERN_SERVER_MINIMUM_COMMAND_LENGTH   4U
 The minimum valid length for a server command.
#define AERN_SERVER_APPLICATION_STATE_SIZE
 Calculates the size of the AERN server application state.

Typedefs

typedef AERN_EXPORT_API enum aern_server_server_loop_status aern_server_server_loop_status
typedef AERN_EXPORT_API struct aern_server_application_state aern_server_application_state

Enumerations

enum  aern_server_server_loop_status { aern_server_loop_status_stopped = 0x00U , aern_server_loop_status_started = 0x01U , aern_server_loop_status_paused = 0x02U }
 The AERN server loop status. More...

Functions

AERN_EXPORT_API void aern_server_certificate_directory (const aern_server_application_state *state, char *dpath, size_t pathlen)
 Get the full delimited path to the certificate storage directory.
AERN_EXPORT_API void aern_server_certificate_path (const aern_server_application_state *state, char *fpath, size_t pathlen, const char *issuer)
 Get the full path to a certificate.
AERN_EXPORT_API bool aern_server_child_certificate_export (const aern_server_application_state *state, const char *dpath)
 Export the local certificate to a file.
AERN_EXPORT_API bool aern_server_child_certificate_from_issuer (aern_child_certificate *ccert, const aern_server_application_state *state, const char *issuer)
 Get the certificate instance from file using the issuer string.
AERN_EXPORT_API bool aern_server_child_certificate_from_serial (aern_child_certificate *ccert, const aern_server_application_state *state, const uint8_t *serial)
 Get the certificate instance from file using the serial number.
AERN_EXPORT_API void aern_server_child_certificate_generate (aern_server_application_state *state, aern_child_certificate *ccert, uint64_t period)
 Generate a new child certificate.
AERN_EXPORT_API bool aern_server_child_certificate_import (aern_child_certificate *lcert, aern_server_application_state *state, const char *fpath)
 Import the local certificate signed by the root.
AERN_EXPORT_API void aern_server_child_certificate_path (const aern_server_application_state *state, char *fpath, size_t pathlen)
 Get the full path to the child certificate.
AERN_EXPORT_API void aern_server_child_certificate_path_from_issuer (const aern_server_application_state *state, char *fpath, size_t pathlen, const char *issuer)
 Get the certificate file path from the certificate issuer name.
AERN_EXPORT_API bool aern_server_child_certificate_print (const char *fpath, size_t pathlen)
 Print the local child certificate to console.
AERN_EXPORT_API void aern_server_local_certificate_store (aern_server_application_state *state, const aern_child_certificate *ccert, const char *address)
 Store a child certificate.
AERN_EXPORT_API void aern_server_clear_config (aern_server_application_state *state)
 Erase and reset the configuration file.
AERN_EXPORT_API void aern_server_clear_log (aern_server_application_state *state)
 Erase the log file.
AERN_EXPORT_API void aern_server_erase_all (aern_server_application_state *state)
 Erase all state, including log files, and reset configuration.
AERN_EXPORT_API void aern_server_log_host (aern_server_application_state *state)
 Enable logging on the server.
AERN_EXPORT_API void aern_server_log_print (aern_server_application_state *state)
 Print the log file to the console.
AERN_EXPORT_API bool aern_server_log_write_message (aern_server_application_state *state, aern_application_messages msgtype, const char *message, size_t msglen)
 Write a message to the log.
AERN_EXPORT_API void aern_server_mfkcol_path (const aern_server_application_state *state, char *fpath, size_t pathlen)
 Get the path to the mfk collection file.
AERN_EXPORT_API bool aern_server_mfkcol_from_file (qsc_collection_state *mfkcol, const aern_server_application_state *state)
 Convert an encrypted mfk collection file to a collection state.
AERN_EXPORT_API void aern_server_mfkcol_to_file (const qsc_collection_state *mfkcol, const aern_server_application_state *state)
 Convert an mfk collection to an encrypted file.
AERN_EXPORT_API void aern_server_print_banner (const aern_server_application_state *state)
 Print the server banner.
AERN_EXPORT_API void aern_server_print_error (const aern_server_application_state *state, aern_application_messages appmsg, const char *message, aern_protocol_errors error)
 Print a network error to the console.
AERN_EXPORT_API void aern_server_print_configuration (const aern_server_application_state *state)
 Print the server configuration.
AERN_EXPORT_API bool aern_server_root_certificate_export (const aern_server_application_state *state, const char *dpath)
 Export the root certificate to a directory.
AERN_EXPORT_API bool aern_server_root_import_dialogue (aern_server_application_state *state)
 Import the root certificate.
AERN_EXPORT_API void aern_server_root_certificate_generate (aern_server_application_state *state, aern_root_certificate *rcert, uint64_t period)
 Generate a new root certificate.
AERN_EXPORT_API bool aern_server_root_certificate_load (const aern_server_application_state *state, aern_root_certificate *root, const aern_topology_list_state *tlist)
 Load a root certificate using the issuer name.
AERN_EXPORT_API bool aern_server_root_certificate_print (const char *fpath, size_t pathlen)
 Print a formatted root certificate to console.
AERN_EXPORT_API void aern_server_root_certificate_store (aern_server_application_state *state, const aern_root_certificate *rcert)
 Store a root certificate to a file.
AERN_EXPORT_API void aern_server_set_command_prompt (aern_server_application_state *state)
 Set the command prompt to the current state mode.
AERN_EXPORT_API bool aern_server_set_console_timeout (aern_server_application_state *state, const char *snum, size_t numlen)
 Set the number of idle minutes before the user is logged out.
AERN_EXPORT_API bool aern_server_set_domain_name (aern_server_application_state *state, const char *name, size_t namelen)
 Rename the network domain.
AERN_EXPORT_API bool aern_server_set_host_name (aern_server_application_state *state, const char *name, size_t namelen)
 Rename the server host.
AERN_EXPORT_API bool aern_server_set_ip_address (aern_server_application_state *state, const char *address, size_t addlen)
 Set the IP address of the server.
AERN_EXPORT_API bool aern_server_set_password_retries (aern_server_application_state *state, const char *snum, size_t numlen)
 Set the number of failed password retries.
AERN_EXPORT_API void aern_server_erase_signature_key (aern_server_application_state *state)
 Erase the signature-scheme signing key.
AERN_EXPORT_API void aern_server_state_backup_restore (const aern_server_application_state *state)
 Restore the state from backup.
AERN_EXPORT_API void aern_server_state_backup_save (const aern_server_application_state *state)
 Backup the state.
AERN_EXPORT_API void aern_server_state_initialize (aern_server_application_state *state, aern_network_designations srvtype)
 Initialize the internal state.
AERN_EXPORT_API bool aern_server_state_store (aern_server_application_state *state)
 Write the server state to file.
AERN_EXPORT_API void aern_server_state_unload (aern_server_application_state *state)
 Unload the server state from memory.
AERN_EXPORT_API bool aern_server_topology_adc_fetch (const aern_server_application_state *state, aern_child_certificate *dcert)
 Load the ADC certificate from state.
AERN_EXPORT_API bool aern_server_topology_load (aern_server_application_state *state)
 Load the topology from an encrypted file to state.
AERN_EXPORT_API void aern_server_topology_print_list (aern_server_application_state *state)
 Print the topological list to the console.
AERN_EXPORT_API void aern_server_topology_purge_externals (aern_server_application_state *state)
 Clear the topology list except for the root and local nodes.
AERN_EXPORT_API void aern_server_topology_remove_certificate (aern_server_application_state *state, const char *issuer)
 Delete the certificate.
AERN_EXPORT_API void aern_server_topology_remove_node (aern_server_application_state *state, const char *issuer)
 Remove a node from the topology.
AERN_EXPORT_API void aern_server_topology_reset (aern_server_application_state *state)
 Delete all nodes and certificates except for the root.
AERN_EXPORT_API bool aern_server_topology_local_fetch (const aern_server_application_state *state, aern_child_certificate *ccert)
 Load the local certificate from state.
AERN_EXPORT_API bool aern_server_topology_root_exists (const aern_server_application_state *state)
 Check if the root certificate exists on file.
AERN_EXPORT_API bool aern_server_topology_root_fetch (const aern_server_application_state *state, aern_root_certificate *rcert)
 Load the root certificate from state.
AERN_EXPORT_API void aern_server_topology_to_file (aern_server_application_state *state)
 Copy the topology to an encrypted file.
AERN_EXPORT_API bool aern_server_user_login (aern_server_application_state *state)
 Start the user login dialogue.
AERN_EXPORT_API void aern_server_user_logout (aern_server_application_state *state)
 Log out of the server.

Detailed Description

The common AERN server functions.

Detailed File Description: This header file defines the common functions, macros, enumerations, and data structures used by the AERN server. The functions in this file cover certificate management, logging, topology management, configuration, state backup and restore, and user login functionalities. Every public function, macro, struct, and enumeration is documented in detail below.

Macro Definition Documentation

◆ AERN_SERVER_APPLICATION_STATE_SIZE

#define AERN_SERVER_APPLICATION_STATE_SIZE
Value:
(AERN_STORAGE_DOMAINNAME_MAX + AERN_STORAGE_HOSTNAME_MAX + \
AERN_STORAGE_ADDRESS_MAX + AERN_STORAGE_PATH_MAX + AERN_STORAGE_USERNAME_MAX + AERN_CERTIFICATE_ISSUER_SIZE + \
sizeof(uint16_t) + sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint16_t) + sizeof(bool) + sizeof(bool) + \
AERN_ASYMMETRIC_SIGNING_KEY_SIZE)
#define AERN_CERTIFICATE_ISSUER_SIZE
The maximum certificate issuer string length. The last character must be a string terminator.
Definition aern.h:813

Calculates the size of the AERN server application state.

This macro sums the sizes of various maximum string lengths and fixed?size fields used in the server state structure.

Enumeration Type Documentation

◆ aern_server_server_loop_status

The AERN server loop status.

This enumeration represents the current state of the server's main loop.

Enumerator
aern_server_loop_status_stopped 

The server is stopped.

aern_server_loop_status_started 

The server is running.

aern_server_loop_status_paused 

The server is paused.

Function Documentation

◆ aern_server_certificate_directory()

AERN_EXPORT_API void aern_server_certificate_directory ( const aern_server_application_state * state,
char * dpath,
size_t pathlen )

Get the full delimited path to the certificate storage directory.

This function builds the full directory path where certificates are stored, based on the server's configuration in the application state.

Parameters
state[const] The server application state.
dpathThe output buffer that receives the certificate storage directory path.
pathlenThe length of the dpath buffer.

◆ aern_server_certificate_path()

AERN_EXPORT_API void aern_server_certificate_path ( const aern_server_application_state * state,
char * fpath,
size_t pathlen,
const char * issuer )

Get the full path to a certificate.

This function constructs the full file path to a certificate based on the certificate issuer.

Parameters
state[const] The server application state.
fpathThe output buffer that receives the certificate file path.
pathlenThe length of the fpath buffer.
issuer[const] The issuer name of the certificate.

◆ aern_server_child_certificate_export()

AERN_EXPORT_API bool aern_server_child_certificate_export ( const aern_server_application_state * state,
const char * dpath )

Export the local certificate to a file.

This function exports the local child certificate to the specified destination directory.

Parameters
state[const] The server application state.
dpathThe destination directory path.
Returns
Returns true if the certificate is successfully exported.

◆ aern_server_child_certificate_from_issuer()

AERN_EXPORT_API bool aern_server_child_certificate_from_issuer ( aern_child_certificate * ccert,
const aern_server_application_state * state,
const char * issuer )

Get the certificate instance from file using the issuer string.

This function loads a child certificate from file using the issuer string.

Parameters
ccertThe output child certificate.
state[const] The server application state.
issuer[const] The certificate issuer string.
Returns
Returns true if the certificate is successfully loaded.

◆ aern_server_child_certificate_from_serial()

AERN_EXPORT_API bool aern_server_child_certificate_from_serial ( aern_child_certificate * ccert,
const aern_server_application_state * state,
const uint8_t * serial )

Get the certificate instance from file using the serial number.

This function loads a child certificate from file using its serial number.

Parameters
ccertThe output child certificate.
state[const] The server application state.
serial[const] The certificate serial number.
Returns
Returns true if the certificate is successfully loaded.

◆ aern_server_child_certificate_generate()

AERN_EXPORT_API void aern_server_child_certificate_generate ( aern_server_application_state * state,
aern_child_certificate * ccert,
uint64_t period )

Generate a new child certificate.

This function generates a new child certificate, writes the signature private key to the server state, and populates the child certificate structure.

Parameters
stateThe server application state. The private key is written to state->sigkey.
ccertThe output child certificate.
periodThe number of seconds the certificate is valid.

◆ aern_server_child_certificate_import()

AERN_EXPORT_API bool aern_server_child_certificate_import ( aern_child_certificate * lcert,
aern_server_application_state * state,
const char * fpath )

Import the local certificate signed by the root.

This function imports the local certificate that has been signed by the root certificate.

Parameters
lcertThe local certificate structure to populate.
stateThe server application state.
fpathThe full file path to the certificate file.
Returns
Returns true if the certificate is successfully imported.

◆ aern_server_child_certificate_path()

AERN_EXPORT_API void aern_server_child_certificate_path ( const aern_server_application_state * state,
char * fpath,
size_t pathlen )

Get the full path to the child certificate.

This function retrieves the full file path of the child certificate based on the server state.

Parameters
state[const] The server application state.
fpathThe output buffer that receives the certificate file path.
pathlenThe length of the fpath buffer.

◆ aern_server_child_certificate_path_from_issuer()

AERN_EXPORT_API void aern_server_child_certificate_path_from_issuer ( const aern_server_application_state * state,
char * fpath,
size_t pathlen,
const char * issuer )

Get the certificate file path from the certificate issuer name.

This function constructs the file path to a certificate using the issuer name.

Parameters
state[const] The server application state.
fpathThe output buffer that receives the file path.
pathlenThe length of the file path buffer.
issuerThe certificate's issuer name.

◆ aern_server_child_certificate_print()

AERN_EXPORT_API bool aern_server_child_certificate_print ( const char * fpath,
size_t pathlen )

Print the local child certificate to console.

This function prints the local child certificate (read from file) to the console.

Parameters
fpathThe file path to the certificate.
pathlenThe length of the file path buffer.
Returns
Returns true if the certificate is successfully printed.

◆ aern_server_clear_config()

AERN_EXPORT_API void aern_server_clear_config ( aern_server_application_state * state)

Erase and reset the configuration file.

This function erases the current configuration file and resets it.

Parameters
stateThe server application state.

◆ aern_server_clear_log()

AERN_EXPORT_API void aern_server_clear_log ( aern_server_application_state * state)

Erase the log file.

This function erases the server log file.

Parameters
stateThe server application state.

◆ aern_server_erase_all()

AERN_EXPORT_API void aern_server_erase_all ( aern_server_application_state * state)

Erase all state, including log files, and reset configuration.

This function erases all persistent state and log files, effectively resetting the server.

Parameters
stateThe server application state.

◆ aern_server_erase_signature_key()

AERN_EXPORT_API void aern_server_erase_signature_key ( aern_server_application_state * state)

Erase the signature-scheme signing key.

This function erases the signing key stored in the server state.

Parameters
stateThe server application state.

◆ aern_server_local_certificate_store()

AERN_EXPORT_API void aern_server_local_certificate_store ( aern_server_application_state * state,
const aern_child_certificate * ccert,
const char * address )

Store a child certificate.

This function stores the local child certificate to file using the server state information.

Parameters
stateThe server application state.
ccertThe child certificate to store.
addressThe network address associated with the certificate.

◆ aern_server_log_host()

AERN_EXPORT_API void aern_server_log_host ( aern_server_application_state * state)

Enable logging on the server.

This function enables host logging for the server.

Parameters
stateThe server application state.

◆ aern_server_log_print()

AERN_EXPORT_API void aern_server_log_print ( aern_server_application_state * state)

Print the log file to the console.

This function outputs the contents of the server log file to the console.

Parameters
stateThe server application state.

◆ aern_server_log_write_message()

AERN_EXPORT_API bool aern_server_log_write_message ( aern_server_application_state * state,
aern_application_messages msgtype,
const char * message,
size_t msglen )

Write a message to the log.

This function writes a log message with an optional predefined message header.

Parameters
stateThe server application state.
msgtypeThe predefined message enumerator.
message[const] The optional text message.
msglenThe length of the text message.
Returns
Returns true if the log message was successfully written.

◆ aern_server_mfkcol_from_file()

AERN_EXPORT_API bool aern_server_mfkcol_from_file ( qsc_collection_state * mfkcol,
const aern_server_application_state * state )

Convert an encrypted mfk collection file to a collection state.

This function reads the encrypted mfk collection from file and converts it into the internal collection state.

Parameters
mfkcolThe empty collection state that will be populated.
state[const] The server application state.
Returns
Returns true if the mfk collection is successfully loaded.

◆ aern_server_mfkcol_path()

AERN_EXPORT_API void aern_server_mfkcol_path ( const aern_server_application_state * state,
char * fpath,
size_t pathlen )

Get the path to the mfk collection file.

This function constructs the full file path for the master fragmentation key (mfk) collection.

Parameters
state[const] The server application state.
fpathThe output buffer that receives the file path.
pathlenThe length of the fpath buffer.

◆ aern_server_mfkcol_to_file()

AERN_EXPORT_API void aern_server_mfkcol_to_file ( const qsc_collection_state * mfkcol,
const aern_server_application_state * state )

Convert an mfk collection to an encrypted file.

This function writes the current mfk collection state to an encrypted file.

Parameters
mfkcol[const] The mfk collection state.
state[const] The server application state.

◆ aern_server_print_banner()

AERN_EXPORT_API void aern_server_print_banner ( const aern_server_application_state * state)

Print the server banner.

This function prints the server banner to the console.

Parameters
state[const] The server application state.

◆ aern_server_print_configuration()

AERN_EXPORT_API void aern_server_print_configuration ( const aern_server_application_state * state)

Print the server configuration.

This function prints the current server configuration to the console.

Parameters
state[const] The server application state.

◆ aern_server_print_error()

AERN_EXPORT_API void aern_server_print_error ( const aern_server_application_state * state,
aern_application_messages appmsg,
const char * message,
aern_protocol_errors error )

Print a network error to the console.

This function prints a formatted error message for network errors.

Parameters
state[const] The server application state.
appmsgThe predefined application message enumerator.
messageThe error message text.
errorThe protocol error code.

◆ aern_server_root_certificate_export()

AERN_EXPORT_API bool aern_server_root_certificate_export ( const aern_server_application_state * state,
const char * dpath )

Export the root certificate to a directory.

This function exports the server's root certificate to the specified destination directory.

Parameters
state[const] The server application state.
dpathThe destination directory path.
Returns
Returns true if the export is successful.

◆ aern_server_root_certificate_generate()

AERN_EXPORT_API void aern_server_root_certificate_generate ( aern_server_application_state * state,
aern_root_certificate * rcert,
uint64_t period )

Generate a new root certificate.

This function generates a new root certificate, writes the signature private key to the server state, and populates the root certificate structure.

Parameters
stateThe server application state; the private key is written to state->sigkey.
rcertThe output root certificate.
periodThe validity period (in seconds) for the certificate.

◆ aern_server_root_certificate_load()

AERN_EXPORT_API bool aern_server_root_certificate_load ( const aern_server_application_state * state,
aern_root_certificate * root,
const aern_topology_list_state * tlist )

Load a root certificate using the issuer name.

This function loads the root certificate from file using the issuer name.

Parameters
state[const] The server application state.
rootThe output root certificate.
tlist[const] A pointer to the topology list.
Returns
Returns true if the root certificate is successfully loaded.

◆ aern_server_root_certificate_print()

AERN_EXPORT_API bool aern_server_root_certificate_print ( const char * fpath,
size_t pathlen )

Print a formatted root certificate to console.

This function prints a formatted version of the root certificate to the console.

Parameters
fpathThe file path to the root certificate.
pathlenThe length of the file path buffer.
Returns
Returns true if the certificate is successfully printed.

◆ aern_server_root_certificate_store()

AERN_EXPORT_API void aern_server_root_certificate_store ( aern_server_application_state * state,
const aern_root_certificate * rcert )

Store a root certificate to a file.

This function stores the root certificate to file.

Parameters
stateThe server application state.
rcertThe root certificate to store.
addressThe root certificate's address.

◆ aern_server_root_import_dialogue()

AERN_EXPORT_API bool aern_server_root_import_dialogue ( aern_server_application_state * state)

Import the root certificate.

This function prompts the user to import the root certificate through a dialogue.

Parameters
stateThe server application state.
Returns
Returns true if the root certificate is successfully imported.

◆ aern_server_set_command_prompt()

AERN_EXPORT_API void aern_server_set_command_prompt ( aern_server_application_state * state)

Set the command prompt to the current state mode.

This function sets the command prompt based on the current console mode in the server state.

Parameters
stateThe server application state.

◆ aern_server_set_console_timeout()

AERN_EXPORT_API bool aern_server_set_console_timeout ( aern_server_application_state * state,
const char * snum,
size_t numlen )

Set the number of idle minutes before the user is logged out.

This function configures the console timeout period (in minutes) for automatic user logout.

Parameters
stateThe server application state.
snumThe number string representing the timeout period in minutes.
numlenThe length of the number string.
Returns
Returns true if the timeout is successfully set.

◆ aern_server_set_domain_name()

AERN_EXPORT_API bool aern_server_set_domain_name ( aern_server_application_state * state,
const char * name,
size_t namelen )

Rename the network domain.

This function renames the network domain in the server configuration.

Parameters
stateThe server application state.
nameThe new domain name.
namelenThe length of the domain name string.
Returns
Returns true if the domain name is successfully changed.

◆ aern_server_set_host_name()

AERN_EXPORT_API bool aern_server_set_host_name ( aern_server_application_state * state,
const char * name,
size_t namelen )

Rename the server host.

This function renames the server host in the configuration.

Parameters
stateThe server application state.
nameThe new host name.
namelenThe length of the host name string.
Returns
Returns true if the host name is successfully changed.

◆ aern_server_set_ip_address()

AERN_EXPORT_API bool aern_server_set_ip_address ( aern_server_application_state * state,
const char * address,
size_t addlen )

Set the IP address of the server.

This function sets the server's IP address.

Parameters
stateThe server application state.
addressThe IP address string.
addlenThe length of the address string.
Returns
Returns true if the IP address is successfully set.

◆ aern_server_set_password_retries()

AERN_EXPORT_API bool aern_server_set_password_retries ( aern_server_application_state * state,
const char * snum,
size_t numlen )

Set the number of failed password retries.

This function sets the maximum number of failed password attempts allowed.

Parameters
stateThe server application state.
snumThe number string representing the number of retries.
numlenThe length of the number string.
Returns
Returns true if the number of retries is successfully set.

◆ aern_server_state_backup_restore()

AERN_EXPORT_API void aern_server_state_backup_restore ( const aern_server_application_state * state)

Restore the state from backup.

This function restores the server state from a previously saved backup.

Parameters
stateThe server application state.

◆ aern_server_state_backup_save()

AERN_EXPORT_API void aern_server_state_backup_save ( const aern_server_application_state * state)

Backup the state.

This function saves the current server state to a backup file.

Parameters
stateThe server application state.

◆ aern_server_state_initialize()

AERN_EXPORT_API void aern_server_state_initialize ( aern_server_application_state * state,
aern_network_designations srvtype )

Initialize the internal state.

This function initializes the AERN server state for a given server type.

Parameters
stateThe server application state.
srvtypeThe server type designation.

◆ aern_server_state_store()

AERN_EXPORT_API bool aern_server_state_store ( aern_server_application_state * state)

Write the server state to file.

This function writes the current server state to an encrypted file.

Parameters
stateThe server application state.
Returns
Returns true if the state is successfully stored.

◆ aern_server_state_unload()

AERN_EXPORT_API void aern_server_state_unload ( aern_server_application_state * state)

Unload the server state from memory.

This function unloads and clears the current server state from memory.

Parameters
stateThe server application state.

◆ aern_server_topology_adc_fetch()

AERN_EXPORT_API bool aern_server_topology_adc_fetch ( const aern_server_application_state * state,
aern_child_certificate * dcert )

Load the ADC certificate from state.

This function loads the ADC certificate from the server state.

Parameters
state[const] The server application state.
dcertThe output ADC certificate.
Returns
Returns true if the ADC certificate is successfully loaded.

◆ aern_server_topology_load()

AERN_EXPORT_API bool aern_server_topology_load ( aern_server_application_state * state)

Load the topology from an encrypted file to state.

This function loads the network topology from an encrypted file into the server state.

Parameters
stateThe server application state.
Returns
Returns true if the topology is successfully loaded.

◆ aern_server_topology_local_fetch()

AERN_EXPORT_API bool aern_server_topology_local_fetch ( const aern_server_application_state * state,
aern_child_certificate * ccert )

Load the local certificate from state.

This function loads the local child certificate from the server state.

Parameters
state[const] The server application state.
ccertThe output local certificate.
Returns
Returns true if the certificate is successfully loaded.

◆ aern_server_topology_print_list()

AERN_EXPORT_API void aern_server_topology_print_list ( aern_server_application_state * state)

Print the topological list to the console.

This function prints the network topology list to the console.

Parameters
state[const] The server application state.

◆ aern_server_topology_purge_externals()

AERN_EXPORT_API void aern_server_topology_purge_externals ( aern_server_application_state * state)

Clear the topology list except for the root and local nodes.

This function purges the topology list by deleting all nodes except for the root and local nodes.

Parameters
stateThe server application state.

◆ aern_server_topology_remove_certificate()

AERN_EXPORT_API void aern_server_topology_remove_certificate ( aern_server_application_state * state,
const char * issuer )

Delete the certificate.

This function deletes a certificate from the topology based on its issuer.

Parameters
stateThe server application state.
issuerThe target node's issuer string.

◆ aern_server_topology_remove_node()

AERN_EXPORT_API void aern_server_topology_remove_node ( aern_server_application_state * state,
const char * issuer )

Remove a node from the topology.

This function removes a node from the topology list based on its issuer.

Parameters
stateThe server application state.
issuerThe target node's issuer string.

◆ aern_server_topology_reset()

AERN_EXPORT_API void aern_server_topology_reset ( aern_server_application_state * state)

Delete all nodes and certificates except for the root.

This function resets the topology list by deleting all nodes and certificates except the root.

Parameters
stateThe server application state.

◆ aern_server_topology_root_exists()

AERN_EXPORT_API bool aern_server_topology_root_exists ( const aern_server_application_state * state)

Check if the root certificate exists on file.

This function checks whether the root certificate file exists.

Parameters
state[const] The server application state.
Returns
Returns true if the root certificate exists.

◆ aern_server_topology_root_fetch()

AERN_EXPORT_API bool aern_server_topology_root_fetch ( const aern_server_application_state * state,
aern_root_certificate * rcert )

Load the root certificate from state.

This function loads the root certificate from the server state.

Parameters
state[const] The server application state.
rcertThe output root certificate.
Returns
Returns true if the root certificate is successfully loaded.

◆ aern_server_topology_to_file()

AERN_EXPORT_API void aern_server_topology_to_file ( aern_server_application_state * state)

Copy the topology to an encrypted file.

This function writes the current network topology from the server state to an encrypted file.

Parameters
stateThe server application state.

◆ aern_server_user_login()

AERN_EXPORT_API bool aern_server_user_login ( aern_server_application_state * state)

Start the user login dialogue.

This function initiates the user login process and prompts for credentials.

Parameters
stateThe server application state.
Returns
Returns true if the user logged in successfully.

◆ aern_server_user_logout()

AERN_EXPORT_API void aern_server_user_logout ( aern_server_application_state * state)

Log out of the server.

This function logs out the current user and resets the session.

Parameters
stateThe server application state.