FreeRDP
redirection.c File Reference
#include <freerdp/config.h>
#include "settings.h"
#include <winpr/crt.h>
#include <freerdp/log.h>
#include <freerdp/crypto/certificate.h>
#include <freerdp/redirection.h>
#include <freerdp/utils/string.h>
#include "../crypto/certificate.h"
#include "redirection.h"
#include "utils.h"

Macros

#define TAG   FREERDP_TAG("core.redirection")
 

Functions

static void redirection_free_array (char ***what, UINT32 *count)
 
static void redirection_free_string (char **str)
 
static void redirection_free_data (BYTE **str, UINT32 *length)
 
static BOOL redirection_copy_string (char **dst, const char *str)
 
static BOOL redirection_copy_data (BYTE **dst, UINT32 *plen, const BYTE *str, size_t len)
 
static BOOL redirection_copy_array (char ***dst, UINT32 *plen, const char **str, size_t len)
 
static BOOL rdp_redirection_get_data (wStream *s, UINT32 *pLength, const BYTE **pData)
 
static BOOL rdp_redirection_read_unicode_string (wStream *s, char **str, size_t maxLength)
 
static BOOL rdp_redirection_write_data (wStream *s, size_t length, const void *data)
 
static BOOL rdp_redirection_write_base64_wchar (UINT32 flag, wStream *s, size_t length, const void *data)
 
static BOOL rdp_redirection_read_base64_wchar (UINT32 flag, wStream *s, UINT32 *pLength, BYTE **pData)
 
static BOOL rdp_target_cert_get_element (wStream *s, UINT32 *pType, UINT32 *pEncoding, const BYTE **ptr, size_t *pLength)
 
static BOOL rdp_target_cert_write_element (wStream *s, UINT32 Type, UINT32 Encoding, const BYTE *data, size_t length)
 
BOOL rdp_redirection_read_target_cert (rdpCertificate **ptargetCertificate, const BYTE *data, size_t length)
 
static BOOL rdp_redirection_write_target_cert (wStream *s, const rdpRedirection *redirection)
 
static BOOL rdp_redireciton_write_target_cert_stream (wStream *s, const rdpRedirection *redirection)
 
static BOOL rdp_redirection_read_target_cert_stream (wStream *s, rdpRedirection *redirection)
 
int rdp_redirection_apply_settings (rdpRdp *rdp)
 
static BOOL rdp_redirection_read_data (UINT32 flag, wStream *s, UINT32 *pLength, BYTE **pData)
 
static state_run_t rdp_recv_server_redirection_pdu (rdpRdp *rdp, wStream *s)
 
state_run_t rdp_recv_enhanced_security_redirection_packet (rdpRdp *rdp, wStream *s)
 
rdpRedirection * redirection_new (void)
 
void redirection_free (rdpRedirection *redirection)
 
static SSIZE_T redir_write_string (UINT32 flag, wStream *s, const char *str)
 
static BOOL redir_write_data (UINT32 flag, wStream *s, UINT32 length, const BYTE *data)
 
BOOL rdp_write_enhanced_security_redirection_packet (wStream *s, const rdpRedirection *redirection)
 
BOOL redirection_settings_are_valid (rdpRedirection *redirection, UINT32 *pFlags)
 This function checks if all necessary settings for a given rdpRedirection are available. More...
 
BOOL redirection_set_flags (rdpRedirection *redirection, UINT32 flags)
 
BOOL redirection_set_session_id (rdpRedirection *redirection, UINT32 session_id)
 
static BOOL redirection_unsupported (const char *fkt, UINT32 flag, UINT32 mask)
 
BOOL redirection_set_byte_option (rdpRedirection *redirection, UINT32 flag, const BYTE *data, size_t length)
 
BOOL redirection_set_string_option (rdpRedirection *redirection, UINT32 flag, const char *str)
 
BOOL redirection_set_array_option (rdpRedirection *redirection, UINT32 flag, const char **str, size_t count)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("core.redirection")

FreeRDP: A Remote Desktop Protocol Implementation RDP Server Redirection

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2023 Armin Novak anova.nosp@m.k@th.nosp@m.incas.nosp@m.t.co.nosp@m.m Copyright 2023 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

◆ rdp_recv_enhanced_security_redirection_packet()

state_run_t rdp_recv_enhanced_security_redirection_packet ( rdpRdp *  rdp,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_recv_server_redirection_pdu()

static state_run_t rdp_recv_server_redirection_pdu ( rdpRdp *  rdp,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redireciton_write_target_cert_stream()

static BOOL rdp_redireciton_write_target_cert_stream ( wStream s,
const rdpRedirection *  redirection 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_apply_settings()

int rdp_redirection_apply_settings ( rdpRdp *  rdp)

Free previous LoadBalanceInfo, if any, otherwise it may end up being reused for the redirected session, which is not what we want.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_get_data()

static BOOL rdp_redirection_get_data ( wStream s,
UINT32 *  pLength,
const BYTE **  pData 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_read_base64_wchar()

static BOOL rdp_redirection_read_base64_wchar ( UINT32  flag,
wStream s,
UINT32 *  pLength,
BYTE **  pData 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_read_data()

static BOOL rdp_redirection_read_data ( UINT32  flag,
wStream s,
UINT32 *  pLength,
BYTE **  pData 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_read_target_cert()

BOOL rdp_redirection_read_target_cert ( rdpCertificate **  ptargetCertificate,
const BYTE data,
size_t  length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_read_target_cert_stream()

static BOOL rdp_redirection_read_target_cert_stream ( wStream s,
rdpRedirection *  redirection 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_read_unicode_string()

static BOOL rdp_redirection_read_unicode_string ( wStream s,
char **  str,
size_t  maxLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_write_base64_wchar()

static BOOL rdp_redirection_write_base64_wchar ( UINT32  flag,
wStream s,
size_t  length,
const void *  data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_write_data()

static BOOL rdp_redirection_write_data ( wStream s,
size_t  length,
const void *  data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_redirection_write_target_cert()

static BOOL rdp_redirection_write_target_cert ( wStream s,
const rdpRedirection *  redirection 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_target_cert_get_element()

static BOOL rdp_target_cert_get_element ( wStream s,
UINT32 *  pType,
UINT32 *  pEncoding,
const BYTE **  ptr,
size_t *  pLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_target_cert_write_element()

static BOOL rdp_target_cert_write_element ( wStream s,
UINT32  Type,
UINT32  Encoding,
const BYTE data,
size_t  length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdp_write_enhanced_security_redirection_packet()

BOOL rdp_write_enhanced_security_redirection_packet ( wStream s,
const rdpRedirection *  redirection 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redir_write_data()

static BOOL redir_write_data ( UINT32  flag,
wStream s,
UINT32  length,
const BYTE data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redir_write_string()

static SSIZE_T redir_write_string ( UINT32  flag,
wStream s,
const char *  str 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redirection_copy_array()

static BOOL redirection_copy_array ( char ***  dst,
UINT32 *  plen,
const char **  str,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redirection_copy_data()

static BOOL redirection_copy_data ( BYTE **  dst,
UINT32 *  plen,
const BYTE str,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redirection_copy_string()

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

◆ redirection_free()

void redirection_free ( rdpRedirection *  redirection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redirection_free_array()

static void redirection_free_array ( char ***  what,
UINT32 *  count 
)
static
Here is the caller graph for this function:

◆ redirection_free_data()

static void redirection_free_data ( BYTE **  str,
UINT32 *  length 
)
static
Here is the caller graph for this function:

◆ redirection_free_string()

static void redirection_free_string ( char **  str)
static
Here is the caller graph for this function:

◆ redirection_new()

rdpRedirection* redirection_new ( void  )
Here is the caller graph for this function:

◆ redirection_set_array_option()

BOOL redirection_set_array_option ( rdpRedirection *  redirection,
UINT32  flag,
const char **  str,
size_t  count 
)
Here is the call graph for this function:

◆ redirection_set_byte_option()

BOOL redirection_set_byte_option ( rdpRedirection *  redirection,
UINT32  flag,
const BYTE data,
size_t  length 
)
Here is the call graph for this function:

◆ redirection_set_flags()

BOOL redirection_set_flags ( rdpRedirection *  redirection,
UINT32  flags 
)

◆ redirection_set_session_id()

BOOL redirection_set_session_id ( rdpRedirection *  redirection,
UINT32  session_id 
)

◆ redirection_set_string_option()

BOOL redirection_set_string_option ( rdpRedirection *  redirection,
UINT32  flag,
const char *  str 
)
Here is the call graph for this function:

◆ redirection_settings_are_valid()

BOOL redirection_settings_are_valid ( rdpRedirection *  redirection,
UINT32 *  pFlags 
)

This function checks if all necessary settings for a given rdpRedirection are available.

Parameters
redirectionThe redirection settings to check
pFlagsAn (optional) pointer to UINT32. Is set to the flags that do not have necessary data available.
Returns
TRUE if the redirection settings are ready to use, FALSE otherwise.
Here is the call graph for this function:

◆ redirection_unsupported()

static BOOL redirection_unsupported ( const char *  fkt,
UINT32  flag,
UINT32  mask 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: