PQS: Post Quantum Shell Protocol 1.1.0.0a (A2)
A quantum secure secure shell protocol
pqsconfig.h File Reference

PQS client and server configuration file support. More...

#include "pqscommon.h"
#include "pqslogger.h"
#include "qsms.h"

Go to the source code of this file.

Data Structures

struct  pqs_server_config
 The PQS server configuration state. More...
struct  pqs_client_config
 The PQS client configuration state. More...

Macros

#define PQS_CONFIG_LINE_MAX   1024U
 The maximum length of one configuration line.
#define PQS_CONFIG_KEY_MAX   64U
 The maximum length of a configuration key.
#define PQS_CONFIG_VALUE_MAX   QSC_SYSTEM_MAX_PATH
 The maximum length of a configuration value.
#define PQS_SERVER_CONFIG_NAME   "pqsd.conf"
 The default PQS server configuration file name.
#define PQS_CLIENT_CONFIG_NAME   "pqs.conf"
 The default PQS client configuration file name.

Typedefs

typedef PQS_EXPORT_API struct pqs_server_config pqs_server_config
 The PQS server configuration state.
typedef PQS_EXPORT_API struct pqs_client_config pqs_client_config
 The PQS client configuration state.

Functions

PQS_EXPORT_API void pqs_config_server_defaults (pqs_server_config *cfg)
 Initialize a server configuration with safe defaults.
PQS_EXPORT_API void pqs_config_client_defaults (pqs_client_config *cfg)
 Initialize a client configuration with safe defaults.
PQS_EXPORT_API bool pqs_config_server_load (pqs_server_config *cfg, const char *fpath)
 Load a PQS server configuration file.
PQS_EXPORT_API bool pqs_config_client_load (pqs_client_config *cfg, const char *fpath)
 Load a PQS client configuration file.
PQS_EXPORT_API const char * pqs_config_log_level_to_string (pqs_log_level level)
 Convert a log level to a string.

Detailed Description

PQS client and server configuration file support.

Typedef Documentation

◆ pqs_client_config

typedef PQS_EXPORT_API struct pqs_client_config pqs_client_config

The PQS client configuration state.

This structure contains the resolved client configuration used to initialize the PQS client application, including storage paths, the target host, username, host-trust settings, and logging behavior.

◆ pqs_server_config

typedef PQS_EXPORT_API struct pqs_server_config pqs_server_config

The PQS server configuration state.

This structure contains the resolved server configuration used to initialize the PQS server application, including storage paths, network binding values, authentication limits, logging behavior, and command sandbox settings.

Function Documentation

◆ pqs_config_client_defaults()

PQS_EXPORT_API void pqs_config_client_defaults ( pqs_client_config * cfg)

Initialize a client configuration with safe defaults.

Parameters
cfg[struct] The client configuration.

◆ pqs_config_client_load()

PQS_EXPORT_API bool pqs_config_client_load ( pqs_client_config * cfg,
const char * fpath )

Load a PQS client configuration file.

Parameters
cfg[struct] The client configuration.
fpath[const] The configuration file path.
Returns
[bool] Returns true if the configuration was loaded or created.

◆ pqs_config_log_level_to_string()

PQS_EXPORT_API const char * pqs_config_log_level_to_string ( pqs_log_level level)

Convert a log level to a string.

Parameters
level[enum] The log level.
Returns
[const char*] Returns the log level string.

◆ pqs_config_server_defaults()

PQS_EXPORT_API void pqs_config_server_defaults ( pqs_server_config * cfg)

Initialize a server configuration with safe defaults.

Parameters
cfg[struct] The server configuration.

◆ pqs_config_server_load()

PQS_EXPORT_API bool pqs_config_server_load ( pqs_server_config * cfg,
const char * fpath )

Load a PQS server configuration file.

Parameters
cfg[struct] The server configuration.
fpath[const] The configuration file path.
Returns
[bool] Returns true if the configuration was loaded or created.