FreeRDP
|
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include "../core/settings.h"
#include "../core/capabilities.h"
#include <freerdp/crypto/certificate.h>
#include <freerdp/settings.h>
#include <freerdp/freerdp.h>
#include <freerdp/log.h>
Macros | |
#define | TAG FREERDP_TAG("common") |
Functions | |
BOOL | freerdp_addin_argv_add_argument_ex (ADDIN_ARGV *args, const char *argument, size_t len) |
BOOL | freerdp_addin_argv_add_argument (ADDIN_ARGV *args, const char *argument) |
BOOL | freerdp_addin_argv_del_argument (ADDIN_ARGV *args, const char *argument) |
int | freerdp_addin_set_argument (ADDIN_ARGV *args, const char *argument) |
int | freerdp_addin_replace_argument (ADDIN_ARGV *args, const char *previous, const char *argument) |
int | freerdp_addin_set_argument_value (ADDIN_ARGV *args, const char *option, const char *value) |
int | freerdp_addin_replace_argument_value (ADDIN_ARGV *args, const char *previous, const char *option, const char *value) |
BOOL | freerdp_device_collection_add (rdpSettings *settings, RDPDR_DEVICE *device) |
BOOL | freerdp_device_collection_del (rdpSettings *settings, const RDPDR_DEVICE *device) |
Removed a device from the settings, returns ownership of the allocated device to caller. More... | |
RDPDR_DEVICE * | freerdp_device_collection_find (rdpSettings *settings, const char *name) |
RDPDR_DEVICE * | freerdp_device_collection_find_type (rdpSettings *settings, UINT32 type) |
RDPDR_DEVICE * | freerdp_device_new (UINT32 Type, size_t count, const char *args[]) |
void | freerdp_device_free (RDPDR_DEVICE *device) |
RDPDR_DEVICE * | freerdp_device_clone (const RDPDR_DEVICE *device) |
void | freerdp_device_collection_free (rdpSettings *settings) |
BOOL | freerdp_static_channel_collection_del (rdpSettings *settings, const char *name) |
BOOL | freerdp_static_channel_collection_add (rdpSettings *settings, ADDIN_ARGV *channel) |
ADDIN_ARGV * | freerdp_static_channel_collection_find (rdpSettings *settings, const char *name) |
void | freerdp_static_channel_collection_free (rdpSettings *settings) |
BOOL | freerdp_dynamic_channel_collection_del (rdpSettings *settings, const char *name) |
BOOL | freerdp_dynamic_channel_collection_add (rdpSettings *settings, ADDIN_ARGV *channel) |
ADDIN_ARGV * | freerdp_dynamic_channel_collection_find (const rdpSettings *settings, const char *name) |
void | freerdp_addin_argv_free (ADDIN_ARGV *args) |
ADDIN_ARGV * | freerdp_addin_argv_new (size_t argc, const char *argv[]) |
ADDIN_ARGV * | freerdp_addin_argv_clone (const ADDIN_ARGV *args) |
void | freerdp_dynamic_channel_collection_free (rdpSettings *settings) |
void | freerdp_capability_buffer_free (rdpSettings *settings) |
BOOL | freerdp_capability_buffer_copy (rdpSettings *settings, const rdpSettings *src) |
void | freerdp_target_net_addresses_free (rdpSettings *settings) |
void | freerdp_server_license_issuers_free (rdpSettings *settings) |
BOOL | freerdp_server_license_issuers_copy (rdpSettings *settings, char **issuers, UINT32 count) |
void | freerdp_performance_flags_make (rdpSettings *settings) |
void | freerdp_performance_flags_split (rdpSettings *settings) |
BOOL | freerdp_set_gateway_usage_method (rdpSettings *settings, UINT32 GatewayUsageMethod) |
void | freerdp_update_gateway_usage_method (rdpSettings *settings, UINT32 GatewayEnabled, UINT32 GatewayBypassLocal) |
static BOOL | value_to_uint (const char *value, ULONGLONG *result, ULONGLONG min, ULONGLONG max) |
static BOOL | value_to_int (const char *value, LONGLONG *result, LONGLONG min, LONGLONG max) |
static BOOL | parsing_fail (const char *key, const char *type, const char *value) |
BOOL | freerdp_settings_set_value_for_name (rdpSettings *settings, const char *name, const char *value) |
BOOL | freerdp_settings_set_pointer_len_ (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, SSIZE_T lenId, const void *data, size_t len, size_t size) |
const void * | freerdp_settings_get_pointer (const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id) |
Returns a immutable pointer settings value. More... | |
BOOL | freerdp_settings_set_pointer_len (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data, size_t len) |
Set a pointer to value data. More... | |
void * | freerdp_settings_get_pointer_array_writable (const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, size_t offset) |
BOOL | freerdp_settings_set_pointer_array (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, size_t offset, const void *data) |
const void * | freerdp_settings_get_pointer_array (const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, size_t offset) |
UINT32 | freerdp_settings_get_codecs_flags (const rdpSettings *settings) |
helper function to get a mask of supported codec flags. More... | |
const char * | freerdp_settings_get_server_name (const rdpSettings *settings) |
A helper function to return the correct server name. More... | |
BOOL | freerdp_target_net_addresses_copy (rdpSettings *settings, char **addresses, UINT32 count) |
BOOL | freerdp_device_equal (const RDPDR_DEVICE *what, const RDPDR_DEVICE *expect) |
char * | freerdp_rail_support_flags_to_string (UINT32 flags, char *buffer, size_t length) |
Returns a stringified representation of RAIL support flags. More... | |
BOOL | freerdp_settings_update_from_caps (rdpSettings *settings, const BYTE *capsFlags, const BYTE **capsData, const UINT32 *capsSizes, UINT32 capsCount, BOOL serverReceivedCaps) |
Parse capability data and apply to settings. More... | |
const char * | freerdp_rdp_version_string (UINT32 version) |
Returns a stringified representation of the RDP protocol version. More... | |
BOOL | freerdp_settings_set_string_from_utf16 (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const WCHAR *param) |
Sets a string settings value. The param is converted to UTF-8 and the copy stored. More... | |
BOOL | freerdp_settings_set_string_from_utf16N (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const WCHAR *param, size_t length) |
Sets a string settings value. The param is converted to UTF-8 and the copy stored. More... | |
WCHAR * | freerdp_settings_get_string_as_utf16 (const rdpSettings *settings, FreeRDP_Settings_Keys_String id, size_t *pCharLen) |
Return an allocated UTF16 string. More... | |
const char * | freerdp_rdpdr_dtyp_string (UINT32 type) |
Returns a string representation of RDPDR_DTYP_*. More... | |
const char * | freerdp_encryption_level_string (UINT32 EncryptionLevel) |
const char * | freerdp_encryption_methods_string (UINT32 EncryptionMethods, char *buffer, size_t size) |
const char * | freerdp_supported_color_depths_string (UINT16 mask, char *buffer, size_t size) |
returns a string representation of RNS_UD_XXBPP_SUPPORT values More... | |
BOOL | freerdp_settings_append_string (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *separator, const char *param) |
appends a string to a settings value. The param is copied. If the initial value of the setting was not empty, <old value><separator> is created More... | |
BOOL | freerdp_settings_are_valid (const rdpSettings *settings) |
Returns TRUE if settings are in a valid state, FALSE otherwise. More... | |
#define TAG FREERDP_TAG("common") |
FreeRDP: A Remote Desktop Protocol Implementation Settings Management
Copyright 2012 Marc-Andre Moreau marca Copyright 2016 Armin Novak ndre .more au@g mail. comarmin Copyright 2023 Armin Novak .nov ak@gm ail. comanova Copyright 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.
BOOL freerdp_addin_argv_add_argument | ( | ADDIN_ARGV * | args, |
const char * | argument | ||
) |
BOOL freerdp_addin_argv_add_argument_ex | ( | ADDIN_ARGV * | args, |
const char * | argument, | ||
size_t | len | ||
) |
ADDIN_ARGV* freerdp_addin_argv_clone | ( | const ADDIN_ARGV * | args | ) |
BOOL freerdp_addin_argv_del_argument | ( | ADDIN_ARGV * | args, |
const char * | argument | ||
) |
void freerdp_addin_argv_free | ( | ADDIN_ARGV * | args | ) |
ADDIN_ARGV* freerdp_addin_argv_new | ( | size_t | argc, |
const char * | argv[] | ||
) |
int freerdp_addin_replace_argument | ( | ADDIN_ARGV * | args, |
const char * | previous, | ||
const char * | argument | ||
) |
int freerdp_addin_replace_argument_value | ( | ADDIN_ARGV * | args, |
const char * | previous, | ||
const char * | option, | ||
const char * | value | ||
) |
int freerdp_addin_set_argument | ( | ADDIN_ARGV * | args, |
const char * | argument | ||
) |
int freerdp_addin_set_argument_value | ( | ADDIN_ARGV * | args, |
const char * | option, | ||
const char * | value | ||
) |
BOOL freerdp_capability_buffer_copy | ( | rdpSettings * | settings, |
const rdpSettings * | src | ||
) |
void freerdp_capability_buffer_free | ( | rdpSettings * | settings | ) |
RDPDR_DEVICE* freerdp_device_clone | ( | const RDPDR_DEVICE * | device | ) |
BOOL freerdp_device_collection_add | ( | rdpSettings * | settings, |
RDPDR_DEVICE * | device | ||
) |
BOOL freerdp_device_collection_del | ( | rdpSettings * | settings, |
const RDPDR_DEVICE * | device | ||
) |
Removed a device from the settings, returns ownership of the allocated device to caller.
settings | the settings to remove the device from |
device | the device to remove |
RDPDR_DEVICE* freerdp_device_collection_find | ( | rdpSettings * | settings, |
const char * | name | ||
) |
RDPDR_DEVICE* freerdp_device_collection_find_type | ( | rdpSettings * | settings, |
UINT32 | type | ||
) |
void freerdp_device_collection_free | ( | rdpSettings * | settings | ) |
BOOL freerdp_device_equal | ( | const RDPDR_DEVICE * | what, |
const RDPDR_DEVICE * | expect | ||
) |
void freerdp_device_free | ( | RDPDR_DEVICE * | device | ) |
RDPDR_DEVICE* freerdp_device_new | ( | UINT32 | Type, |
size_t | count, | ||
const char * | args[] | ||
) |
BOOL freerdp_dynamic_channel_collection_add | ( | rdpSettings * | settings, |
ADDIN_ARGV * | channel | ||
) |
BOOL freerdp_dynamic_channel_collection_del | ( | rdpSettings * | settings, |
const char * | name | ||
) |
ADDIN_ARGV* freerdp_dynamic_channel_collection_find | ( | const rdpSettings * | settings, |
const char * | name | ||
) |
void freerdp_dynamic_channel_collection_free | ( | rdpSettings * | settings | ) |
const char* freerdp_encryption_level_string | ( | UINT32 | EncryptionLevel | ) |
const char* freerdp_encryption_methods_string | ( | UINT32 | EncryptionMethods, |
char * | buffer, | ||
size_t | size | ||
) |
void freerdp_performance_flags_make | ( | rdpSettings * | settings | ) |
void freerdp_performance_flags_split | ( | rdpSettings * | settings | ) |
char* freerdp_rail_support_flags_to_string | ( | UINT32 | flags, |
char * | buffer, | ||
size_t | length | ||
) |
Returns a stringified representation of RAIL support flags.
flags | The flags to stringify |
buffer | A pointer to the string buffer to write to |
length | The size of the string buffer |
const char* freerdp_rdp_version_string | ( | UINT32 | version | ) |
Returns a stringified representation of the RDP protocol version.
version | The RDP protocol version number. |
const char* freerdp_rdpdr_dtyp_string | ( | UINT32 | type | ) |
Returns a string representation of RDPDR_DTYP_*.
type | The integer of the RDPDR_DTYP_* to stringify |
BOOL freerdp_server_license_issuers_copy | ( | rdpSettings * | settings, |
char ** | issuers, | ||
UINT32 | count | ||
) |
void freerdp_server_license_issuers_free | ( | rdpSettings * | settings | ) |
BOOL freerdp_set_gateway_usage_method | ( | rdpSettings * | settings, |
UINT32 | GatewayUsageMethod | ||
) |
This corresponds to "Automatically detect RD Gateway server settings", which means the client attempts to use gateway group policy settings http://technet.microsoft.com/en-us/library/cc770601.aspx
BOOL freerdp_settings_append_string | ( | rdpSettings * | settings, |
FreeRDP_Settings_Keys_String | id, | ||
const char * | separator, | ||
const char * | param | ||
) |
appends a string to a settings value. The param is copied. If the initial value of the setting was not empty, <old value><separator> is created
settings | A pointer to the settings to query, must not be NULL. |
id | The key to query |
separator | The separator string to use. May be NULL (no separator) |
param | The value to append |
BOOL freerdp_settings_are_valid | ( | const rdpSettings * | settings | ) |
Returns TRUE if settings are in a valid state, FALSE otherwise.
This function is meant to replace tideous return checks for freerdp_settings_set_* with a single check after these calls.
settings | the settings instance to check |
UINT32 freerdp_settings_get_codecs_flags | ( | const rdpSettings * | settings | ) |
helper function to get a mask of supported codec flags.
This function checks various settings to create a mask of supported codecs FreeRDP_CodecFlags defines the codecs
settings | the settings to check |
const void* freerdp_settings_get_pointer | ( | const rdpSettings * | settings, |
FreeRDP_Settings_Keys_Pointer | id | ||
) |
Returns a immutable pointer settings value.
settings | A pointer to the settings to query, must not be NULL. |
id | The key to query |
const void* freerdp_settings_get_pointer_array | ( | const rdpSettings * | settings, |
FreeRDP_Settings_Keys_Pointer | id, | ||
size_t | offset | ||
) |
void* freerdp_settings_get_pointer_array_writable | ( | const rdpSettings * | settings, |
FreeRDP_Settings_Keys_Pointer | id, | ||
size_t | offset | ||
) |
const char* freerdp_settings_get_server_name | ( | const rdpSettings * | settings | ) |
A helper function to return the correct server name.
The server name might be in key FreeRDP_ServerHostname or if used in FreeRDP_UserSpecifiedServerName. This function returns the correct name to use.
settings | The settings to query, must not be NULL. |
WCHAR* freerdp_settings_get_string_as_utf16 | ( | const rdpSettings * | settings, |
FreeRDP_Settings_Keys_String | id, | ||
size_t * | pCharLen | ||
) |
Return an allocated UTF16 string.
settings | A pointer to the settings struct to use |
id | The settings identifier |
BOOL freerdp_settings_set_pointer_array | ( | rdpSettings * | settings, |
FreeRDP_Settings_Keys_Pointer | id, | ||
size_t | offset, | ||
const void * | data | ||
) |
BOOL freerdp_settings_set_pointer_len | ( | rdpSettings * | settings, |
FreeRDP_Settings_Keys_Pointer | id, | ||
const void * | data, | ||
size_t | len | ||
) |
Set a pointer to value data.
settings | A pointer to the settings to query, must not be NULL. |
id | The key to update |
data | The data to set (copy created, previous value freed) |
BOOL freerdp_settings_set_pointer_len_ | ( | rdpSettings * | settings, |
FreeRDP_Settings_Keys_Pointer | id, | ||
SSIZE_T | lenId, | ||
const void * | data, | ||
size_t | len, | ||
size_t | size | ||
) |
BOOL freerdp_settings_set_string_from_utf16 | ( | rdpSettings * | settings, |
FreeRDP_Settings_Keys_String | id, | ||
const WCHAR * | param | ||
) |
Sets a string settings value. The param is converted to UTF-8 and the copy stored.
settings | A pointer to the settings to query, must not be NULL. |
id | The key to query |
param | The value to set. If NULL removes the old entry, otherwise a copy is created. |
BOOL freerdp_settings_set_string_from_utf16N | ( | rdpSettings * | settings, |
FreeRDP_Settings_Keys_String | id, | ||
const WCHAR * | param, | ||
size_t | length | ||
) |
Sets a string settings value. The param is converted to UTF-8 and the copy stored.
settings | A pointer to the settings to query, must not be NULL. |
id | The key to query |
param | The value to set. If NULL removes the old entry, otherwise a copy is created. |
length | The length of the WCHAR string in number of WCHAR characters |
BOOL freerdp_settings_set_value_for_name | ( | rdpSettings * | settings, |
const char * | name, | ||
const char * | value | ||
) |
BOOL freerdp_settings_update_from_caps | ( | rdpSettings * | settings, |
const BYTE * | capsFlags, | ||
const BYTE ** | capsData, | ||
const UINT32 * | capsSizes, | ||
UINT32 | capsCount, | ||
BOOL | serverReceivedCaps | ||
) |
Parse capability data and apply to settings.
The capability message is stored in raw form in the settings, the data parsed and applied to the settings.
settings | A pointer to the settings to use |
capsFlags | A pointer to the capablity flags, must have capsCount fields |
capsData | A pointer array to the RAW capability data, must have capsCount fields |
capsSizes | A pointer to an array of RAW capability sizes, must have capsCount fields |
capsCount | The number of capabilities contained in the RAW data |
serverReceivedCaps | Indicates if the parser should assume to be a server or client instance |
BOOL freerdp_static_channel_collection_add | ( | rdpSettings * | settings, |
ADDIN_ARGV * | channel | ||
) |
BOOL freerdp_static_channel_collection_del | ( | rdpSettings * | settings, |
const char * | name | ||
) |
ADDIN_ARGV* freerdp_static_channel_collection_find | ( | rdpSettings * | settings, |
const char * | name | ||
) |
void freerdp_static_channel_collection_free | ( | rdpSettings * | settings | ) |
const char* freerdp_supported_color_depths_string | ( | UINT16 | mask, |
char * | buffer, | ||
size_t | size | ||
) |
returns a string representation of RNS_UD_XXBPP_SUPPORT values
return A string reprenentation of the bitmask.
BOOL freerdp_target_net_addresses_copy | ( | rdpSettings * | settings, |
char ** | addresses, | ||
UINT32 | count | ||
) |
void freerdp_target_net_addresses_free | ( | rdpSettings * | settings | ) |
void freerdp_update_gateway_usage_method | ( | rdpSettings * | settings, |
UINT32 | GatewayEnabled, | ||
UINT32 | GatewayBypassLocal | ||
) |
|
static |
|
static |
|
static |