FreeRDP
fastpath.c File Reference
#include <freerdp/config.h>
#include "settings.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/stream.h>
#include <freerdp/api.h>
#include <freerdp/log.h>
#include <freerdp/crypto/per.h>
#include "orders.h"
#include "update.h"
#include "surface.h"
#include "fastpath.h"
#include "rdp.h"
#include "../cache/pointer.h"
#include "../cache/palette.h"
#include "../cache/bitmap.h"

Macros

#define TAG   FREERDP_TAG("core.fastpath")
 

Enumerations

enum  FASTPATH_INPUT_ENCRYPTION_FLAGS { FASTPATH_INPUT_SECURE_CHECKSUM = 0x1 , FASTPATH_INPUT_ENCRYPTED = 0x2 }
 
enum  FASTPATH_OUTPUT_ENCRYPTION_FLAGS { FASTPATH_OUTPUT_SECURE_CHECKSUM = 0x1 , FASTPATH_OUTPUT_ENCRYPTED = 0x2 }
 

Functions

static const char * fastpath_update_to_string (UINT8 update)
 
static BOOL fastpath_read_update_header (wStream *s, BYTE *updateCode, BYTE *fragmentation, BYTE *compression)
 
static BOOL fastpath_write_update_header (wStream *s, const FASTPATH_UPDATE_HEADER *fpUpdateHeader)
 
static UINT32 fastpath_get_update_header_size (FASTPATH_UPDATE_HEADER *fpUpdateHeader)
 
static BOOL fastpath_write_update_pdu_header (wStream *s, const FASTPATH_UPDATE_PDU_HEADER *fpUpdatePduHeader, rdpRdp *rdp)
 
static UINT32 fastpath_get_update_pdu_header_size (FASTPATH_UPDATE_PDU_HEADER *fpUpdatePduHeader, rdpRdp *rdp)
 
BOOL fastpath_read_header_rdp (rdpFastPath *fastpath, wStream *s, UINT16 *length)
 
static BOOL fastpath_recv_orders (rdpFastPath *fastpath, wStream *s)
 
static BOOL fastpath_recv_update_common (rdpFastPath *fastpath, wStream *s)
 
static BOOL fastpath_recv_update_synchronize (rdpFastPath *fastpath, wStream *s)
 
static int fastpath_recv_update (rdpFastPath *fastpath, BYTE updateCode, wStream *s)
 
static int fastpath_recv_update_data (rdpFastPath *fastpath, wStream *s)
 
state_run_t fastpath_recv_updates (rdpFastPath *fastpath, wStream *s)
 
static BOOL fastpath_read_input_event_header (wStream *s, BYTE *eventFlags, BYTE *eventCode)
 
static BOOL fastpath_recv_input_event_scancode (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event_mouse (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event_relmouse (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event_qoe (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event_mousex (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event_sync (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event_unicode (rdpFastPath *fastpath, wStream *s, BYTE eventFlags)
 
static BOOL fastpath_recv_input_event (rdpFastPath *fastpath, wStream *s)
 
state_run_t fastpath_recv_inputs (rdpFastPath *fastpath, wStream *s)
 
static UINT32 fastpath_get_sec_bytes (rdpRdp *rdp)
 
wStreamfastpath_input_pdu_init_header (rdpFastPath *fastpath)
 
wStreamfastpath_input_pdu_init (rdpFastPath *fastpath, BYTE eventFlags, BYTE eventCode)
 
BOOL fastpath_send_multiple_input_pdu (rdpFastPath *fastpath, wStream *s, size_t iNumEvents)
 
BOOL fastpath_send_input_pdu (rdpFastPath *fastpath, wStream *s)
 
wStreamfastpath_update_pdu_init (rdpFastPath *fastpath)
 
wStreamfastpath_update_pdu_init_new (rdpFastPath *fastpath)
 
BOOL fastpath_send_update_pdu (rdpFastPath *fastpath, BYTE updateCode, wStream *s, BOOL skipCompression)
 
rdpFastPath * fastpath_new (rdpRdp *rdp)
 
void fastpath_free (rdpFastPath *fastpath)
 
BYTE fastpath_get_encryption_flags (rdpFastPath *fastpath)
 
BOOL fastpath_decrypt (rdpFastPath *fastpath, wStream *s, UINT16 *length)
 

Variables

static const char *const FASTPATH_UPDATETYPE_STRINGS []
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("core.fastpath")

FreeRDP: A Remote Desktop Protocol Implementation Fast Path

Copyright 2011 Vic Lee Copyright 2014 Norbert Federa norbe.nosp@m.rt.f.nosp@m.edera.nosp@m.@thi.nosp@m.ncast.nosp@m..com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 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.

Enumeration Type Documentation

◆ FASTPATH_INPUT_ENCRYPTION_FLAGS

Enumerator
FASTPATH_INPUT_SECURE_CHECKSUM 
FASTPATH_INPUT_ENCRYPTED 

◆ FASTPATH_OUTPUT_ENCRYPTION_FLAGS

Enumerator
FASTPATH_OUTPUT_SECURE_CHECKSUM 
FASTPATH_OUTPUT_ENCRYPTED 

Function Documentation

◆ fastpath_decrypt()

BOOL fastpath_decrypt ( rdpFastPath *  fastpath,
wStream s,
UINT16 length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_free()

void fastpath_free ( rdpFastPath *  fastpath)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_get_encryption_flags()

BYTE fastpath_get_encryption_flags ( rdpFastPath *  fastpath)
Here is the caller graph for this function:

◆ fastpath_get_sec_bytes()

static UINT32 fastpath_get_sec_bytes ( rdpRdp *  rdp)
static
Here is the caller graph for this function:

◆ fastpath_get_update_header_size()

static UINT32 fastpath_get_update_header_size ( FASTPATH_UPDATE_HEADER fpUpdateHeader)
static
Here is the caller graph for this function:

◆ fastpath_get_update_pdu_header_size()

static UINT32 fastpath_get_update_pdu_header_size ( FASTPATH_UPDATE_PDU_HEADER fpUpdatePduHeader,
rdpRdp *  rdp 
)
static
Here is the caller graph for this function:

◆ fastpath_input_pdu_init()

wStream* fastpath_input_pdu_init ( rdpFastPath *  fastpath,
BYTE  eventFlags,
BYTE  eventCode 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_input_pdu_init_header()

wStream* fastpath_input_pdu_init_header ( rdpFastPath *  fastpath)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_new()

rdpFastPath* fastpath_new ( rdpRdp *  rdp)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_read_header_rdp()

BOOL fastpath_read_header_rdp ( rdpFastPath *  fastpath,
wStream s,
UINT16 length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_read_input_event_header()

static BOOL fastpath_read_input_event_header ( wStream s,
BYTE eventFlags,
BYTE eventCode 
)
static
Here is the caller graph for this function:

◆ fastpath_read_update_header()

static BOOL fastpath_read_update_header ( wStream s,
BYTE updateCode,
BYTE fragmentation,
BYTE compression 
)
static
Here is the caller graph for this function:

◆ fastpath_recv_input_event()

static BOOL fastpath_recv_input_event ( rdpFastPath *  fastpath,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_input_event_mouse()

static BOOL fastpath_recv_input_event_mouse ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the caller graph for this function:

◆ fastpath_recv_input_event_mousex()

static BOOL fastpath_recv_input_event_mousex ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_input_event_qoe()

static BOOL fastpath_recv_input_event_qoe ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_input_event_relmouse()

static BOOL fastpath_recv_input_event_relmouse ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_input_event_scancode()

static BOOL fastpath_recv_input_event_scancode ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the caller graph for this function:

◆ fastpath_recv_input_event_sync()

static BOOL fastpath_recv_input_event_sync ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the caller graph for this function:

◆ fastpath_recv_input_event_unicode()

static BOOL fastpath_recv_input_event_unicode ( rdpFastPath *  fastpath,
wStream s,
BYTE  eventFlags 
)
static
Here is the caller graph for this function:

◆ fastpath_recv_inputs()

state_run_t fastpath_recv_inputs ( rdpFastPath *  fastpath,
wStream s 
)

If numberEvents is not provided in fpInputHeader, it will be provided as one additional byte here.

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

◆ fastpath_recv_orders()

static BOOL fastpath_recv_orders ( rdpFastPath *  fastpath,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_update()

static int fastpath_recv_update ( rdpFastPath *  fastpath,
BYTE  updateCode,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_update_common()

static BOOL fastpath_recv_update_common ( rdpFastPath *  fastpath,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_update_data()

static int fastpath_recv_update_data ( rdpFastPath *  fastpath,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_update_synchronize()

static BOOL fastpath_recv_update_synchronize ( rdpFastPath *  fastpath,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_recv_updates()

state_run_t fastpath_recv_updates ( rdpFastPath *  fastpath,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_send_input_pdu()

BOOL fastpath_send_input_pdu ( rdpFastPath *  fastpath,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_send_multiple_input_pdu()

BOOL fastpath_send_multiple_input_pdu ( rdpFastPath *  fastpath,
wStream s,
size_t  iNumEvents 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_send_update_pdu()

BOOL fastpath_send_update_pdu ( rdpFastPath *  fastpath,
BYTE  updateCode,
wStream s,
BOOL  skipCompression 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_update_pdu_init()

wStream* fastpath_update_pdu_init ( rdpFastPath *  fastpath)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_update_pdu_init_new()

wStream* fastpath_update_pdu_init_new ( rdpFastPath *  fastpath)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_update_to_string()

static const char* fastpath_update_to_string ( UINT8  update)
static
Here is the caller graph for this function:

◆ fastpath_write_update_header()

static BOOL fastpath_write_update_header ( wStream s,
const FASTPATH_UPDATE_HEADER fpUpdateHeader 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastpath_write_update_pdu_header()

static BOOL fastpath_write_update_pdu_header ( wStream s,
const FASTPATH_UPDATE_PDU_HEADER fpUpdatePduHeader,
rdpRdp *  rdp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FASTPATH_UPDATETYPE_STRINGS

const char* const FASTPATH_UPDATETYPE_STRINGS[]
static
Initial value:
= {
"Orders",
"Bitmap",
"Palette",
"Synchronize",
"Surface Commands",
"System Pointer Hidden",
"System Pointer Default",
"???",
"Pointer Position",
"Color Pointer",
"Cached Pointer",
"New Pointer",
}

Fast-Path packet format is defined in [MS-RDPBCGR] 2.2.9.1.2, which revises server output packets from the first byte with the goal of improving bandwidth.

Slow-Path packet always starts with TPKT header, which has the first byte 0x03, while Fast-Path packet starts with 2 zero bits in the first two less significant bits of the first byte.