FreeRDP
rdp.c File Reference
#include <winpr/crt.h>
#include "rdp.h"
#include "info.h"
#include "redirection.h"
#include <freerdp/crypto/per.h>
#include <freerdp/log.h>

Macros

#define TAG   FREERDP_TAG("core.rdp")
 

Functions

BOOL rdp_read_security_header (wStream *s, UINT16 *flags, UINT16 *length)
 
void rdp_write_security_header (wStream *s, UINT16 flags)
 
BOOL rdp_read_share_control_header (wStream *s, UINT16 *length, UINT16 *type, UINT16 *channel_id)
 
void rdp_write_share_control_header (wStream *s, UINT16 length, UINT16 type, UINT16 channel_id)
 
BOOL rdp_read_share_data_header (wStream *s, UINT16 *length, BYTE *type, UINT32 *shareId, BYTE *compressedType, UINT16 *compressedLength)
 
void rdp_write_share_data_header (wStream *s, UINT16 length, BYTE type, UINT32 share_id)
 
static BOOL rdp_security_stream_init (rdpRdp *rdp, wStream *s, BOOL sec_header)
 
wStream * rdp_send_stream_init (rdpRdp *rdp)
 
wStream * rdp_send_stream_pdu_init (rdpRdp *rdp)
 
wStream * rdp_data_pdu_init (rdpRdp *rdp)
 
BOOL rdp_set_error_info (rdpRdp *rdp, UINT32 errorInfo)
 
wStream * rdp_message_channel_pdu_init (rdpRdp *rdp)
 
BOOL rdp_read_header (rdpRdp *rdp, wStream *s, UINT16 *length, UINT16 *channelId)
 
void rdp_write_header (rdpRdp *rdp, wStream *s, UINT16 length, UINT16 channelId)
 
static BOOL rdp_security_stream_out (rdpRdp *rdp, wStream *s, int length, UINT32 sec_flags, UINT32 *pad)
 
static UINT32 rdp_get_sec_bytes (rdpRdp *rdp, UINT16 sec_flags)
 
BOOL rdp_send (rdpRdp *rdp, wStream *s, UINT16 channel_id)
 
BOOL rdp_send_pdu (rdpRdp *rdp, wStream *s, UINT16 type, UINT16 channel_id)
 
BOOL rdp_send_data_pdu (rdpRdp *rdp, wStream *s, BYTE type, UINT16 channel_id)
 
BOOL rdp_send_message_channel_pdu (rdpRdp *rdp, wStream *s, UINT16 sec_flags)
 
static BOOL rdp_recv_server_shutdown_denied_pdu (rdpRdp *rdp, wStream *s)
 
static BOOL rdp_recv_server_set_keyboard_indicators_pdu (rdpRdp *rdp, wStream *s)
 
static BOOL rdp_recv_server_set_keyboard_ime_status_pdu (rdpRdp *rdp, wStream *s)
 
static BOOL rdp_recv_set_error_info_data_pdu (rdpRdp *rdp, wStream *s)
 
static BOOL rdp_recv_server_auto_reconnect_status_pdu (rdpRdp *rdp, wStream *s)
 
static BOOL rdp_recv_server_status_info_pdu (rdpRdp *rdp, wStream *s)
 
static BOOL rdp_recv_monitor_layout_pdu (rdpRdp *rdp, wStream *s)
 
BOOL rdp_write_monitor_layout_pdu (wStream *s, UINT32 monitorCount, const rdpMonitor *monitorDefArray)
 
int rdp_recv_data_pdu (rdpRdp *rdp, wStream *s)
 
int rdp_recv_message_channel_pdu (rdpRdp *rdp, wStream *s, UINT16 securityFlags)
 
int rdp_recv_out_of_sequence_pdu (rdpRdp *rdp, wStream *s)
 
void rdp_read_flow_control_pdu (wStream *s, UINT16 *type)
 
BOOL rdp_decrypt (rdpRdp *rdp, wStream *s, INT32 length, UINT16 securityFlags)
 
static int rdp_recv_tpkt_pdu (rdpRdp *rdp, wStream *s)
 
static int rdp_recv_fastpath_pdu (rdpRdp *rdp, wStream *s)
 
static int rdp_recv_pdu (rdpRdp *rdp, wStream *s)
 
int rdp_recv_callback (rdpTransport *transport, wStream *s, void *extra)
 
int rdp_send_channel_data (rdpRdp *rdp, UINT16 channelId, const BYTE *data, int size)
 
BOOL rdp_send_error_info (rdpRdp *rdp)
 
int rdp_check_fds (rdpRdp *rdp)
 
rdpRdp * rdp_new (rdpContext *context)
 
void rdp_reset (rdpRdp *rdp)
 
void rdp_free (rdpRdp *rdp)
 

Variables

const char * DATA_PDU_TYPE_STRINGS [80]
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("core.rdp")

FreeRDP: A Remote Desktop Protocol Implementation RDP Core

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2014 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com

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

int rdp_check_fds ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

wStream* rdp_data_pdu_init ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_decrypt ( rdpRdp *  rdp,
wStream *  s,
INT32  length,
UINT16  securityFlags 
)

Decrypt an RDP packet.

Parameters
rdpRDP module
sstream
lengthint

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_free ( rdpRdp *  rdp)

Free RDP module.

Parameters
rdpRDP module to be freed

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT32 rdp_get_sec_bytes ( rdpRdp *  rdp,
UINT16  sec_flags 
)
static

Here is the caller graph for this function:

wStream* rdp_message_channel_pdu_init ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

rdpRdp* rdp_new ( rdpContext *  context)

Instantiate new RDP module.

Returns
new RDP module

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_read_flow_control_pdu ( wStream *  s,
UINT16 type 
)

Here is the caller graph for this function:

BOOL rdp_read_header ( rdpRdp *  rdp,
wStream *  s,
UINT16 length,
UINT16 channelId 
)

Read an RDP packet header.

Parameters
rdprdp module
sstream
lengthRDP packet length
channel_idchannel id

Some servers like Windows Server 2008 R2 do not send the error info pdu when the user logs off like they should. Map DisconnectProviderUltimatum to a ERRINFO_LOGOFF_BY_USER when the errinfo code is ERRINFO_SUCCESS.

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_read_security_header ( wStream *  s,
UINT16 flags,
UINT16 length 
)

Read RDP Security Header.
http://msdn.microsoft.com/en-us/library/cc240579/

Parameters
sstream
flagssecurity flags

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_read_share_control_header ( wStream *  s,
UINT16 length,
UINT16 type,
UINT16 channel_id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_read_share_data_header ( wStream *  s,
UINT16 length,
BYTE type,
UINT32 shareId,
BYTE compressedType,
UINT16 compressedLength 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int rdp_recv_callback ( rdpTransport *  transport,
wStream *  s,
void extra 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int rdp_recv_data_pdu ( rdpRdp *  rdp,
wStream *  s 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rdp_recv_fastpath_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int rdp_recv_message_channel_pdu ( rdpRdp *  rdp,
wStream *  s,
UINT16  securityFlags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_recv_monitor_layout_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int rdp_recv_out_of_sequence_pdu ( rdpRdp *  rdp,
wStream *  s 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rdp_recv_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_recv_server_auto_reconnect_status_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_recv_server_set_keyboard_ime_status_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_recv_server_set_keyboard_indicators_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_recv_server_shutdown_denied_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the caller graph for this function:

static BOOL rdp_recv_server_status_info_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_recv_set_error_info_data_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rdp_recv_tpkt_pdu ( rdpRdp *  rdp,
wStream *  s 
)
static

Process an RDP packet.

Parameters
rdpRDP module
sstream

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_reset ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_security_stream_init ( rdpRdp *  rdp,
wStream *  s,
BOOL  sec_header 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL rdp_security_stream_out ( rdpRdp *  rdp,
wStream *  s,
int  length,
UINT32  sec_flags,
UINT32 pad 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_send ( rdpRdp *  rdp,
wStream *  s,
UINT16  channel_id 
)

Send an RDP packet.

Parameters
rdpRDP module
sstream
channel_idchannel id

Here is the call graph for this function:

Here is the caller graph for this function:

int rdp_send_channel_data ( rdpRdp *  rdp,
UINT16  channelId,
const BYTE data,
int  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_send_data_pdu ( rdpRdp *  rdp,
wStream *  s,
BYTE  type,
UINT16  channel_id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_send_error_info ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_send_message_channel_pdu ( rdpRdp *  rdp,
wStream *  s,
UINT16  sec_flags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_send_pdu ( rdpRdp *  rdp,
wStream *  s,
UINT16  type,
UINT16  channel_id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

wStream* rdp_send_stream_init ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

wStream* rdp_send_stream_pdu_init ( rdpRdp *  rdp)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_set_error_info ( rdpRdp *  rdp,
UINT32  errorInfo 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_write_header ( rdpRdp *  rdp,
wStream *  s,
UINT16  length,
UINT16  channelId 
)

Write an RDP packet header.

Parameters
rdprdp module
sstream
lengthRDP packet length
channel_idchannel id

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL rdp_write_monitor_layout_pdu ( wStream *  s,
UINT32  monitorCount,
const rdpMonitor *  monitorDefArray 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_write_security_header ( wStream *  s,
UINT16  flags 
)

Write RDP Security Header.
http://msdn.microsoft.com/en-us/library/cc240579/

Parameters
sstream
flagssecurity flags

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_write_share_control_header ( wStream *  s,
UINT16  length,
UINT16  type,
UINT16  channel_id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void rdp_write_share_data_header ( wStream *  s,
UINT16  length,
BYTE  type,
UINT32  share_id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* DATA_PDU_TYPE_STRINGS[80]