FreeRDP
fastpath.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.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")
 

Functions

static const char * fastpath_update_to_string (UINT8 update)
 
UINT16 fastpath_header_length (wStream *s)
 
UINT16 fastpath_read_header (rdpFastPath *fastpath, wStream *s)
 
static BOOL fastpath_read_update_header (wStream *s, BYTE *updateCode, BYTE *fragmentation, BYTE *compression)
 
static BOOL fastpath_write_update_header (wStream *s, FASTPATH_UPDATE_HEADER *fpUpdateHeader)
 
static UINT32 fastpath_get_update_header_size (FASTPATH_UPDATE_HEADER *fpUpdateHeader)
 
static BOOL fastpath_write_update_pdu_header (wStream *s, 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)
 
int 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_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)
 
int fastpath_recv_inputs (rdpFastPath *fastpath, wStream *s)
 
static UINT32 fastpath_get_sec_bytes (rdpRdp *rdp)
 
wStream * fastpath_input_pdu_init_header (rdpFastPath *fastpath)
 
wStream * fastpath_input_pdu_init (rdpFastPath *fastpath, BYTE eventFlags, BYTE eventCode)
 
BOOL fastpath_send_multiple_input_pdu (rdpFastPath *fastpath, wStream *s, int iNumEvents)
 
BOOL fastpath_send_input_pdu (rdpFastPath *fastpath, wStream *s)
 
wStream * fastpath_update_pdu_init (rdpFastPath *fastpath)
 
wStream * fastpath_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)
 

Variables

static const char *const FASTPATH_UPDATETYPE_STRINGS []
 

Macro Definition Documentation

#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.

Function Documentation

void fastpath_free ( rdpFastPath *  fastpath)

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT32 fastpath_get_sec_bytes ( rdpRdp *  rdp)
static

Here is the caller graph for this function:

static UINT32 fastpath_get_update_header_size ( FASTPATH_UPDATE_HEADER *  fpUpdateHeader)
static

Here is the caller graph for this function:

static UINT32 fastpath_get_update_pdu_header_size ( FASTPATH_UPDATE_PDU_HEADER *  fpUpdatePduHeader,
rdpRdp *  rdp 
)
static

Here is the caller graph for this function:

UINT16 fastpath_header_length ( wStream *  s)

Here is the call graph for this function:

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:

wStream* fastpath_input_pdu_init_header ( rdpFastPath *  fastpath)

Here is the call graph for this function:

Here is the caller graph for this function:

rdpFastPath* fastpath_new ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

UINT16 fastpath_read_header ( rdpFastPath *  fastpath,
wStream *  s 
)

Read a Fast-Path packet header.

Parameters
sstream
encryptionFlags
Returns
length

Here is the call graph for this function:

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:

static BOOL fastpath_read_input_event_header ( wStream *  s,
BYTE eventFlags,
BYTE eventCode 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL fastpath_read_update_header ( wStream *  s,
BYTE updateCode,
BYTE fragmentation,
BYTE compression 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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:

static BOOL fastpath_recv_input_event_mouse ( rdpFastPath *  fastpath,
wStream *  s,
BYTE  eventFlags 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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:

static BOOL fastpath_recv_input_event_scancode ( rdpFastPath *  fastpath,
wStream *  s,
BYTE  eventFlags 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL fastpath_recv_input_event_sync ( rdpFastPath *  fastpath,
wStream *  s,
BYTE  eventFlags 
)
static

Here is the caller graph for this function:

static BOOL fastpath_recv_input_event_unicode ( rdpFastPath *  fastpath,
wStream *  s,
BYTE  eventFlags 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int 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:

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:

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:

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:

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:

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:

int fastpath_recv_updates ( rdpFastPath *  fastpath,
wStream *  s 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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:

BOOL fastpath_send_multiple_input_pdu ( rdpFastPath *  fastpath,
wStream *  s,
int  iNumEvents 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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:

wStream* fastpath_update_pdu_init ( rdpFastPath *  fastpath)

Here is the call graph for this function:

Here is the caller graph for this function:

wStream* fastpath_update_pdu_init_new ( rdpFastPath *  fastpath)

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* fastpath_update_to_string ( UINT8  update)
static

Here is the caller graph for this function:

static BOOL fastpath_write_update_header ( wStream *  s,
FASTPATH_UPDATE_HEADER *  fpUpdateHeader 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL fastpath_write_update_pdu_header ( wStream *  s,
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

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.