FreeRDP
pf_config.c File Reference

Macros

#define TAG   PROXY_TAG("config")
 
#define CONFIG_PRINT_SECTION(section)   WLog_INFO(TAG, "\t%s:", section)
 
#define CONFIG_PRINT_STR(config, key)   WLog_INFO(TAG, "\t\t%s: %s", #key, config->key)
 
#define CONFIG_PRINT_STR_CONTENT(config, key)   WLog_INFO(TAG, "\t\t%s: %s", #key, config->key ? "set" : NULL)
 
#define CONFIG_PRINT_BOOL(config, key)   WLog_INFO(TAG, "\t\t%s: %s", #key, config->key ? "TRUE" : "FALSE")
 
#define CONFIG_PRINT_UINT16(config, key)   WLog_INFO(TAG, "\t\t%s: %" PRIu16 "", #key, config->key)
 
#define CONFIG_PRINT_UINT32(config, key)   WLog_INFO(TAG, "\t\t%s: %" PRIu32 "", #key, config->key)
 

Functions

static char ** pf_config_parse_comma_separated_list (const char *list, size_t *count)
 
static BOOL pf_config_get_uint16 (wIniFile *ini, const char *section, const char *key, UINT16 *result, BOOL required)
 
static BOOL pf_config_get_uint32 (wIniFile *ini, const char *section, const char *key, UINT32 *result, BOOL required)
 
static BOOL pf_config_get_bool (wIniFile *ini, const char *section, const char *key, BOOL fallback)
 
static const char * pf_config_get_str (wIniFile *ini, const char *section, const char *key, BOOL required)
 
static BOOL pf_config_load_server (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_target (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_channels (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_input (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_security (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_clipboard (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_modules (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_gfx_settings (wIniFile *ini, proxyConfig *config)
 
static BOOL pf_config_load_certificates (wIniFile *ini, proxyConfig *config)
 
proxyConfig * server_config_load_ini (wIniFile *ini)
 server_config_load_ini Create a proxyConfig from a already loaded INI file. More...
 
BOOL pf_server_config_dump (const char *file)
 pf_server_config_dump Dumps a default INI configuration file More...
 
proxyConfig * pf_server_config_load_buffer (const char *buffer)
 pf_server_config_load_buffer Create a proxyConfig from a memory string buffer in INI file format More...
 
proxyConfig * pf_server_config_load_file (const char *path)
 pf_server_config_load_file Create a proxyConfig from a INI file found at path. More...
 
static void pf_server_config_print_list (char **list, size_t count)
 
void pf_server_config_print (const proxyConfig *config)
 pf_server_config_print Print the configuration to stdout More...
 
void pf_server_config_free (proxyConfig *config)
 pf_server_config_free Releases all resources associated with proxyConfig More...
 
size_t pf_config_required_plugins_count (const proxyConfig *config)
 pf_config_required_plugins_count More...
 
const char * pf_config_required_plugin (const proxyConfig *config, size_t index)
 pf_config_required_plugin More...
 
size_t pf_config_modules_count (const proxyConfig *config)
 pf_config_modules_count More...
 
const char ** pf_config_modules (const proxyConfig *config)
 pf_config_modules More...
 
static BOOL pf_config_copy_string (char **dst, const char *src)
 
static BOOL pf_config_copy_string_list (char ***dst, size_t *size, char **src, size_t srcSize)
 
BOOL pf_config_clone (proxyConfig **dst, const proxyConfig *config)
 pf_config_clone Create a copy of the configuration More...
 
static BOOL config_plugin_unload (proxyPlugin *plugin)
 
static BOOL config_plugin_keyboard_event (proxyPlugin *plugin, proxyData *pdata, void *param)
 
static BOOL config_plugin_mouse_event (proxyPlugin *plugin, proxyData *pdata, void *param)
 
static BOOL config_plugin_client_channel_data (proxyPlugin *plugin, proxyData *pdata, void *param)
 
static BOOL config_plugin_server_channel_data (proxyPlugin *plugin, proxyData *pdata, void *param)
 
static BOOL config_plugin_dynamic_channel_create (proxyPlugin *plugin, proxyData *pdata, void *param)
 
static BOOL config_plugin_channel_create (proxyPlugin *plugin, proxyData *pdata, void *param)
 
BOOL pf_config_plugin (proxyPluginsManager *plugins_manager, void *userdata)
 pf_config_plugin Register a proxy plugin handling event filtering defined in the configuration. More...
 

Variables

static const char config_plugin_name [] = "config"
 
static const char config_plugin_desc []
 

Macro Definition Documentation

◆ CONFIG_PRINT_BOOL

#define CONFIG_PRINT_BOOL (   config,
  key 
)    WLog_INFO(TAG, "\t\t%s: %s", #key, config->key ? "TRUE" : "FALSE")

◆ CONFIG_PRINT_SECTION

#define CONFIG_PRINT_SECTION (   section)    WLog_INFO(TAG, "\t%s:", section)

◆ CONFIG_PRINT_STR

#define CONFIG_PRINT_STR (   config,
  key 
)    WLog_INFO(TAG, "\t\t%s: %s", #key, config->key)

◆ CONFIG_PRINT_STR_CONTENT

#define CONFIG_PRINT_STR_CONTENT (   config,
  key 
)    WLog_INFO(TAG, "\t\t%s: %s", #key, config->key ? "set" : NULL)

◆ CONFIG_PRINT_UINT16

#define CONFIG_PRINT_UINT16 (   config,
  key 
)    WLog_INFO(TAG, "\t\t%s: %" PRIu16 "", #key, config->key)

◆ CONFIG_PRINT_UINT32

#define CONFIG_PRINT_UINT32 (   config,
  key 
)    WLog_INFO(TAG, "\t\t%s: %" PRIu32 "", #key, config->key)

◆ TAG

#define TAG   PROXY_TAG("config")

FreeRDP: A Remote Desktop Protocol Implementation FreeRDP Proxy Server

Copyright 2019 Kobi Mizrachi kmizr.nosp@m.achi.nosp@m.18@gm.nosp@m.ail..nosp@m.com Copyright 2019 Idan Freiberg speid.nosp@m.y@gm.nosp@m.ail.c.nosp@m.om Copyright 2021 Armin Novak anova.nosp@m.k@th.nosp@m.incas.nosp@m.t.co.nosp@m.m Copyright 2021 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ config_plugin_channel_create()

static BOOL config_plugin_channel_create ( proxyPlugin *  plugin,
proxyData *  pdata,
void *  param 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_plugin_client_channel_data()

static BOOL config_plugin_client_channel_data ( proxyPlugin *  plugin,
proxyData *  pdata,
void *  param 
)
static
Here is the caller graph for this function:

◆ config_plugin_dynamic_channel_create()

static BOOL config_plugin_dynamic_channel_create ( proxyPlugin *  plugin,
proxyData *  pdata,
void *  param 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_plugin_keyboard_event()

static BOOL config_plugin_keyboard_event ( proxyPlugin *  plugin,
proxyData *  pdata,
void *  param 
)
static
Here is the caller graph for this function:

◆ config_plugin_mouse_event()

static BOOL config_plugin_mouse_event ( proxyPlugin *  plugin,
proxyData *  pdata,
void *  param 
)
static
Here is the caller graph for this function:

◆ config_plugin_server_channel_data()

static BOOL config_plugin_server_channel_data ( proxyPlugin *  plugin,
proxyData *  pdata,
void *  param 
)
static
Here is the caller graph for this function:

◆ config_plugin_unload()

static BOOL config_plugin_unload ( proxyPlugin *  plugin)
static
Here is the caller graph for this function:

◆ pf_config_clone()

BOOL pf_config_clone ( proxyConfig **  dst,
const proxyConfig *  config 
)

pf_config_clone Create a copy of the configuration

Parameters
dstA pointer that receives the newly allocated copy
configThe source configuration to copy
Returns
TRUE for success, FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_copy_string()

static BOOL pf_config_copy_string ( char **  dst,
const char *  src 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_copy_string_list()

static BOOL pf_config_copy_string_list ( char ***  dst,
size_t *  size,
char **  src,
size_t  srcSize 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_get_bool()

static BOOL pf_config_get_bool ( wIniFile *  ini,
const char *  section,
const char *  key,
BOOL  fallback 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_get_str()

static const char* pf_config_get_str ( wIniFile *  ini,
const char *  section,
const char *  key,
BOOL  required 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_get_uint16()

static BOOL pf_config_get_uint16 ( wIniFile *  ini,
const char *  section,
const char *  key,
UINT16 result,
BOOL  required 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_get_uint32()

static BOOL pf_config_get_uint32 ( wIniFile *  ini,
const char *  section,
const char *  key,
UINT32 *  result,
BOOL  required 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_certificates()

static BOOL pf_config_load_certificates ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_channels()

static BOOL pf_config_load_channels ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_clipboard()

static BOOL pf_config_load_clipboard ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_gfx_settings()

static BOOL pf_config_load_gfx_settings ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_input()

static BOOL pf_config_load_input ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_modules()

static BOOL pf_config_load_modules ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_security()

static BOOL pf_config_load_security ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_server()

static BOOL pf_config_load_server ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_load_target()

static BOOL pf_config_load_target ( wIniFile *  ini,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_modules()

const char** pf_config_modules ( const proxyConfig *  config)

pf_config_modules

Parameters
configA pointer to the proxyConfig. Must NOT be NULL.
Returns
An array of strings of size pf_config_modules_count with the module names.
Here is the caller graph for this function:

◆ pf_config_modules_count()

size_t pf_config_modules_count ( const proxyConfig *  config)

pf_config_modules_count

Parameters
configA pointer to the proxyConfig. Must NOT be NULL.
Returns
The number of proxy modules configured.
Here is the caller graph for this function:

◆ pf_config_parse_comma_separated_list()

static char** pf_config_parse_comma_separated_list ( const char *  list,
size_t *  count 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_plugin()

BOOL pf_config_plugin ( proxyPluginsManager *  plugins_manager,
void *  userdata 
)

pf_config_plugin Register a proxy plugin handling event filtering defined in the configuration.

Parameters
plugins_manager
userdataA proxyConfig* to use as reference
Returns
TRUE for success, FALSE for failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_config_required_plugin()

const char* pf_config_required_plugin ( const proxyConfig *  config,
size_t  index 
)

pf_config_required_plugin

Parameters
configA pointer to the proxyConfig. Must NOT be NULL.
indexThe index of the plugin to return
Returns
The name of the plugin or NULL.
Here is the caller graph for this function:

◆ pf_config_required_plugins_count()

size_t pf_config_required_plugins_count ( const proxyConfig *  config)

pf_config_required_plugins_count

Parameters
configA pointer to the proxyConfig. Must NOT be NULL.
Returns
The number of required plugins configured.
Here is the caller graph for this function:

◆ pf_server_config_dump()

BOOL pf_server_config_dump ( const char *  file)

pf_server_config_dump Dumps a default INI configuration file

Parameters
fileThe file to write to. Existing files are truncated.
Returns
TRUE for success, FALSE if the file could not be written.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_config_free()

void pf_server_config_free ( proxyConfig *  config)

pf_server_config_free Releases all resources associated with proxyConfig

Parameters
configA pointer to the proxyConfig to clean up. Might be NULL.
Here is the caller graph for this function:

◆ pf_server_config_load_buffer()

proxyConfig* pf_server_config_load_buffer ( const char *  buffer)

pf_server_config_load_buffer Create a proxyConfig from a memory string buffer in INI file format

Parameters
bufferA pointer to the '\0' terminated INI string.
Returns
A proxyConfig or NULL in case of failure.
Here is the call graph for this function:

◆ pf_server_config_load_file()

proxyConfig* pf_server_config_load_file ( const char *  path)

pf_server_config_load_file Create a proxyConfig from a INI file found at path.

Parameters
pathThe path of the INI file
Returns
A proxyConfig or NULL in case of failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_config_print()

void pf_server_config_print ( const proxyConfig *  config)

pf_server_config_print Print the configuration to stdout

Parameters
configA pointer to the configuration to print. Must NOT be NULL.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_config_print_list()

static void pf_server_config_print_list ( char **  list,
size_t  count 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ server_config_load_ini()

proxyConfig* server_config_load_ini ( wIniFile *  ini)

server_config_load_ini Create a proxyConfig from a already loaded INI file.

Parameters
iniA pointer to the parsed INI file. Must NOT be NULL.
Returns
A proxyConfig or NULL in case of failure.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ config_plugin_desc

const char config_plugin_desc[]
static
Initial value:
=
"A plugin filtering according to proxy configuration file rules"

◆ config_plugin_name

const char config_plugin_name[] = "config"
static