FreeRDP
|
#include <stdio.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/path.h>
#include <winpr/collections.h>
#include <winpr/cmdline.h>
#include "pf_server.h"
#include <freerdp/server/proxy/proxy_config.h>
#include <freerdp/server/proxy/proxy_log.h>
#include <freerdp/crypto/crypto.h>
#include <freerdp/channels/cliprdr.h>
#include <freerdp/channels/rdpsnd.h>
#include <freerdp/channels/audin.h>
#include <freerdp/channels/rdpdr.h>
#include <freerdp/channels/disp.h>
#include <freerdp/channels/rail.h>
#include <freerdp/channels/rdpei.h>
#include <freerdp/channels/tsmf.h>
#include <freerdp/channels/video.h>
#include <freerdp/channels/rdpecam.h>
#include "pf_utils.h"
Macros | |
#define | TAG PROXY_TAG("config") |
#define | CONFIG_PRINT_SECTION(section) WLog_INFO(TAG, "\t%s:", section) |
#define | CONFIG_PRINT_SECTION_KEY(section, key) WLog_INFO(TAG, "\t%s/%s:", section, key) |
#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, boolstr((config)->key)) |
#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 const char * | boolstr (BOOL rc) |
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_modules (wIniFile *ini, proxyConfig *config) |
static char * | pf_config_decode_base64 (const char *data, const char *name, size_t *pLength) |
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_n (char **dst, const char *src, size_t size) |
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_unicode_event (proxyPlugin *plugin, proxyData *pdata, void *param) |
static BOOL | config_plugin_mouse_event (proxyPlugin *plugin, proxyData *pdata, void *param) |
static BOOL | config_plugin_mouse_ex_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... | |
const char * | pf_config_get (const proxyConfig *config, const char *section, const char *key) |
pf_config_get get a value for a section/key More... | |
Variables | |
static const char * | bool_str_true = "true" |
static const char * | bool_str_false = "false" |
static const char * | section_server = "Server" |
static const char * | key_host = "Host" |
static const char * | key_port = "Port" |
static const char * | section_target = "Target" |
static const char * | key_target_fixed = "FixedTarget" |
static const char * | key_target_user = "User" |
static const char * | key_target_pwd = "Password" |
static const char * | key_target_domain = "Domain" |
static const char * | key_target_tls_seclevel = "TlsSecLevel" |
static const char * | section_plugins = "Plugins" |
static const char * | key_plugins_modules = "Modules" |
static const char * | key_plugins_required = "Required" |
static const char * | section_channels = "Channels" |
static const char * | key_channels_gfx = "GFX" |
static const char * | key_channels_disp = "DisplayControl" |
static const char * | key_channels_clip = "Clipboard" |
static const char * | key_channels_mic = "AudioInput" |
static const char * | key_channels_sound = "AudioOutput" |
static const char * | key_channels_rdpdr = "DeviceRedirection" |
static const char * | key_channels_video = "VideoRedirection" |
static const char * | key_channels_camera = "CameraRedirection" |
static const char * | key_channels_rails = "RemoteApp" |
static const char * | key_channels_blacklist = "PassthroughIsBlacklist" |
static const char * | key_channels_pass = "Passthrough" |
static const char * | key_channels_intercept = "Intercept" |
static const char * | section_input = "Input" |
static const char * | key_input_kbd = "Keyboard" |
static const char * | key_input_mouse = "Mouse" |
static const char * | key_input_multitouch = "Multitouch" |
static const char * | section_security = "Security" |
static const char * | key_security_server_nla = "ServerNlaSecurity" |
static const char * | key_security_server_tls = "ServerTlsSecurity" |
static const char * | key_security_server_rdp = "ServerRdpSecurity" |
static const char * | key_security_client_nla = "ClientNlaSecurity" |
static const char * | key_security_client_tls = "ClientTlsSecurity" |
static const char * | key_security_client_rdp = "ClientRdpSecurity" |
static const char * | key_security_client_fallback = "ClientAllowFallbackToTls" |
static const char * | section_certificates = "Certificates" |
static const char * | key_private_key_file = "PrivateKeyFile" |
static const char * | key_private_key_content = "PrivateKeyContent" |
static const char * | key_cert_file = "CertificateFile" |
static const char * | key_cert_content = "CertificateContent" |
static const char | config_plugin_name [] = "config" |
static const char | config_plugin_desc [] |
#define CONFIG_PRINT_BOOL | ( | config, | |
key | |||
) | WLog_INFO(TAG, "\t\t%s: %s", #key, boolstr((config)->key)) |
#define CONFIG_PRINT_STR_CONTENT | ( | config, | |
key | |||
) | WLog_INFO(TAG, "\t\t%s: %s", #key, (config)->key ? "set" : NULL) |
#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) |
#define TAG PROXY_TAG("config") |
FreeRDP: A Remote Desktop Protocol Implementation FreeRDP Proxy Server
Copyright 2019 Kobi Mizrachi kmizr Copyright 2019 Idan Freiberg achi 18@gm ail. comspeid Copyright 2021,2023 Armin Novak y@gm ail.c omanova Copyright 2021,2023 Thincast Technologies GmbH k@th incas t.co m
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.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
BOOL pf_config_clone | ( | proxyConfig ** | dst, |
const proxyConfig * | config | ||
) |
pf_config_clone Create a copy of the configuration
dst | A pointer that receives the newly allocated copy |
config | The source configuration to copy |
|
static |
|
static |
|
static |
|
static |
const char* pf_config_get | ( | const proxyConfig * | config, |
const char * | section, | ||
const char * | key | ||
) |
pf_config_get get a value for a section/key
config | A pointer to the proxyConfig. Must NOT be NULL. |
section | The name of the section the key is in, must not be NULL |
key | The name of the key to look for. Must not be NULL |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const char** pf_config_modules | ( | const proxyConfig * | config | ) |
pf_config_modules
config | A pointer to the proxyConfig. Must NOT be NULL. |
size_t pf_config_modules_count | ( | const proxyConfig * | config | ) |
pf_config_modules_count
config | A pointer to the proxyConfig. Must NOT be NULL. |
|
static |
BOOL pf_config_plugin | ( | proxyPluginsManager * | plugins_manager, |
void * | userdata | ||
) |
pf_config_plugin Register a proxy plugin handling event filtering defined in the configuration.
plugins_manager | The plugin manager |
userdata | A proxyConfig* to use as reference |
const char* pf_config_required_plugin | ( | const proxyConfig * | config, |
size_t | index | ||
) |
pf_config_required_plugin
config | A pointer to the proxyConfig. Must NOT be NULL. |
index | The index of the plugin to return |
size_t pf_config_required_plugins_count | ( | const proxyConfig * | config | ) |
pf_config_required_plugins_count
config | A pointer to the proxyConfig. Must NOT be NULL. |
BOOL pf_server_config_dump | ( | const char * | file | ) |
pf_server_config_dump Dumps a default INI configuration file
file | The file to write to. Existing files are truncated. |
void pf_server_config_free | ( | proxyConfig * | config | ) |
pf_server_config_free Releases all resources associated with proxyConfig
config | A pointer to the proxyConfig to clean up. Might be NULL. |
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
buffer | A pointer to the '\0' terminated INI string. |
proxyConfig* pf_server_config_load_file | ( | const char * | path | ) |
pf_server_config_load_file Create a proxyConfig from a INI file found at path.
path | The path of the INI file |
void pf_server_config_print | ( | const proxyConfig * | config | ) |
pf_server_config_print Print the configuration to stdout
config | A pointer to the configuration to print. Must NOT be NULL. |
|
static |
proxyConfig* server_config_load_ini | ( | wIniFile * | ini | ) |
server_config_load_ini Create a proxyConfig from a already loaded INI file.
ini | A pointer to the parsed INI file. Must NOT be NULL. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |