FreeRDP
|
#include <freerdp/config.h>
#include "settings.h"
#include <winpr/crt.h>
#include <winpr/string.h>
#include <winpr/synch.h>
#include <winpr/assert.h>
#include "rdp.h"
#include "state.h"
#include "info.h"
#include "utils.h"
#include "mcs.h"
#include "redirection.h"
#include <freerdp/codec/bulk.h>
#include <freerdp/crypto/per.h>
#include <freerdp/log.h>
#include <freerdp/buildflags.h>
Macros | |
#define | RDP_TAG FREERDP_TAG("core.rdp") |
#define | rdp_check_monitor_layout_pdu_state(rdp, expected) rdp_check_monitor_layout_pdu_state_(rdp, expected, __FILE__, __func__, __LINE__) |
#define | rdp_set_monitor_layout_pdu_state(rdp, expected) rdp_set_monitor_layout_pdu_state_(rdp, expected, __FILE__, __func__, __LINE__) |
#define | STR(x) #x |
Functions | |
static BOOL | rdp_check_monitor_layout_pdu_state_ (const rdpRdp *rdp, BOOL expected, const char *file, const char *fkt, size_t line) |
static BOOL | rdp_set_monitor_layout_pdu_state_ (rdpRdp *rdp, BOOL value, const char *file, const char *fkt, size_t line) |
const char * | data_pdu_type_to_string (UINT8 type) |
static BOOL | rdp_read_flow_control_pdu (rdpRdp *rdp, wStream *s, UINT16 *type, UINT16 *channel_id) |
static BOOL | rdp_write_share_control_header (rdpRdp *rdp, wStream *s, size_t length, UINT16 type, UINT16 channel_id) |
static BOOL | rdp_write_share_data_header (rdpRdp *rdp, wStream *s, size_t length, BYTE type, UINT32 share_id) |
BOOL | rdp_read_security_header (rdpRdp *rdp, wStream *s, UINT16 *flags, UINT16 *length) |
Read RDP Security Header. msdn{cc240579}. More... | |
BOOL | rdp_write_security_header (rdpRdp *rdp, wStream *s, UINT16 flags) |
BOOL | rdp_read_share_control_header (rdpRdp *rdp, wStream *s, UINT16 *tpktLength, UINT16 *remainingLength, UINT16 *type, UINT16 *channel_id) |
BOOL | rdp_read_share_data_header (rdpRdp *rdp, wStream *s, UINT16 *length, BYTE *type, UINT32 *shareId, BYTE *compressedType, UINT16 *compressedLength) |
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) |
BOOL | rdp_write_header (rdpRdp *rdp, wStream *s, size_t length, UINT16 channelId) |
static BOOL | rdp_security_stream_out (rdpRdp *rdp, wStream *s, size_t 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) |
state_run_t | rdp_recv_data_pdu (rdpRdp *rdp, wStream *s) |
state_run_t | rdp_recv_message_channel_pdu (rdpRdp *rdp, wStream *s, UINT16 securityFlags) |
state_run_t | rdp_recv_out_of_sequence_pdu (rdpRdp *rdp, wStream *s, UINT16 pduType, UINT16 length) |
BOOL | rdp_decrypt (rdpRdp *rdp, wStream *s, UINT16 *pLength, UINT16 securityFlags) |
const char * | pdu_type_to_str (UINT16 pduType, char *buffer, size_t length) |
static state_run_t | rdp_recv_tpkt_pdu (rdpRdp *rdp, wStream *s) |
static state_run_t | rdp_recv_fastpath_pdu (rdpRdp *rdp, wStream *s) |
static state_run_t | rdp_recv_pdu (rdpRdp *rdp, wStream *s) |
static state_run_t | rdp_handle_sc_flags (rdpRdp *rdp, wStream *s, UINT32 flag, CONNECTION_STATE nextState) |
static state_run_t | rdp_client_exchange_monitor_layout (rdpRdp *rdp, wStream *s) |
static state_run_t | rdp_recv_callback_int (rdpTransport *transport, wStream *s, void *extra) |
state_run_t | rdp_recv_callback (rdpTransport *transport, wStream *s, void *extra) |
BOOL | rdp_send_channel_data (rdpRdp *rdp, UINT16 channelId, const BYTE *data, size_t size) |
BOOL | rdp_channel_send_packet (rdpRdp *rdp, UINT16 channelId, size_t totalSize, UINT32 flags, const BYTE *data, size_t chunkSize) |
BOOL | rdp_send_error_info (rdpRdp *rdp) |
int | rdp_check_fds (rdpRdp *rdp) |
BOOL | freerdp_get_stats (rdpRdp *rdp, UINT64 *inBytes, UINT64 *outBytes, UINT64 *inPackets, UINT64 *outPackets) |
rdpRdp * | rdp_new (rdpContext *context) |
static void | rdp_reset_free (rdpRdp *rdp) |
BOOL | rdp_reset (rdpRdp *rdp) |
void | rdp_free (rdpRdp *rdp) |
BOOL | rdp_io_callback_set_event (rdpRdp *rdp, BOOL set) |
const rdpTransportIo * | rdp_get_io_callbacks (rdpRdp *rdp) |
BOOL | rdp_set_io_callbacks (rdpRdp *rdp, const rdpTransportIo *io_callbacks) |
BOOL | rdp_set_io_callback_context (rdpRdp *rdp, void *usercontext) |
void * | rdp_get_io_callback_context (rdpRdp *rdp) |
const char * | rdp_finalize_flags_to_str (UINT32 flags, char *buffer, size_t size) |
BOOL | rdp_finalize_reset_flags (rdpRdp *rdp, BOOL clearAll) |
BOOL | rdp_finalize_set_flag (rdpRdp *rdp, UINT32 flag) |
BOOL | rdp_finalize_is_flag_set (rdpRdp *rdp, UINT32 flag) |
BOOL | rdp_reset_rc4_encrypt_keys (rdpRdp *rdp) |
void | rdp_free_rc4_encrypt_keys (rdpRdp *rdp) |
void | rdp_free_rc4_decrypt_keys (rdpRdp *rdp) |
BOOL | rdp_reset_rc4_decrypt_keys (rdpRdp *rdp) |
const char * | rdp_security_flag_string (UINT32 securityFlags, char *buffer, size_t size) |
static BOOL | rdp_reset_remote_settings (rdpRdp *rdp) |
BOOL | rdp_set_backup_settings (rdpRdp *rdp) |
BOOL | rdp_reset_runtime_settings (rdpRdp *rdp) |
static BOOL | starts_with (const char *tok, const char *val) |
static BOOL | option_equals (const char *what, const char *val) |
static BOOL | parse_on_off_option (const char *value) |
static BOOL | option_is_experimental (wLog *log, const char *tok) |
static BOOL | option_is_debug (wLog *log, const char *tok) |
static void | log_build_warn (rdpRdp *rdp, const char *what, const char *msg, BOOL(*cmp)(wLog *log, const char *tok)) |
void | rdp_log_build_warnings (rdpRdp *rdp) |
Variables | |
static const char * | DATA_PDU_TYPE_STRINGS [80] |
#define rdp_check_monitor_layout_pdu_state | ( | rdp, | |
expected | |||
) | rdp_check_monitor_layout_pdu_state_(rdp, expected, __FILE__, __func__, __LINE__) |
#define rdp_set_monitor_layout_pdu_state | ( | rdp, | |
expected | |||
) | rdp_set_monitor_layout_pdu_state_(rdp, expected, __FILE__, __func__, __LINE__) |
#define RDP_TAG FREERDP_TAG("core.rdp") |
FreeRDP: A Remote Desktop Protocol Implementation RDP Core
Copyright 2011 Marc-Andre Moreau marca Copyright 2014 DI (FH) Martin Haimberger ndre .more au@g mail. commarti n.ha imber ger@ thinc ast. 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.
const char* data_pdu_type_to_string | ( | UINT8 | type | ) |
BOOL freerdp_get_stats | ( | rdpRdp * | rdp, |
UINT64 * | inBytes, | ||
UINT64 * | outBytes, | ||
UINT64 * | inPackets, | ||
UINT64 * | outPackets | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
const char* pdu_type_to_str | ( | UINT16 | pduType, |
char * | buffer, | ||
size_t | length | ||
) |
BOOL rdp_channel_send_packet | ( | rdpRdp * | rdp, |
UINT16 | channelId, | ||
size_t | totalSize, | ||
UINT32 | flags, | ||
const BYTE * | data, | ||
size_t | chunkSize | ||
) |
int rdp_check_fds | ( | rdpRdp * | rdp | ) |
|
static |
|
static |
wStream* rdp_data_pdu_init | ( | rdpRdp * | rdp | ) |
Decrypt an RDP packet.
rdp | RDP module |
s | stream |
pLength | A pointer to the result variable, must not be NULL |
securityFlags | the security flags to apply |
const char* rdp_finalize_flags_to_str | ( | UINT32 | flags, |
char * | buffer, | ||
size_t | size | ||
) |
BOOL rdp_finalize_is_flag_set | ( | rdpRdp * | rdp, |
UINT32 | flag | ||
) |
BOOL rdp_finalize_reset_flags | ( | rdpRdp * | rdp, |
BOOL | clearAll | ||
) |
BOOL rdp_finalize_set_flag | ( | rdpRdp * | rdp, |
UINT32 | flag | ||
) |
void rdp_free | ( | rdpRdp * | rdp | ) |
Free RDP module.
rdp | RDP module to be freed |
void rdp_free_rc4_decrypt_keys | ( | rdpRdp * | rdp | ) |
void rdp_free_rc4_encrypt_keys | ( | rdpRdp * | rdp | ) |
void* rdp_get_io_callback_context | ( | rdpRdp * | rdp | ) |
const rdpTransportIo* rdp_get_io_callbacks | ( | rdpRdp * | rdp | ) |
|
static |
|
static |
BOOL rdp_io_callback_set_event | ( | rdpRdp * | rdp, |
BOOL | set | ||
) |
void rdp_log_build_warnings | ( | rdpRdp * | rdp | ) |
wStream* rdp_message_channel_pdu_init | ( | rdpRdp * | rdp | ) |
rdpRdp* rdp_new | ( | rdpContext * | context | ) |
Instantiate new RDP module.
|
static |
Read an RDP packet header.
rdp | rdp module |
s | stream |
length | RDP packet length |
channelId | channel 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.
Read RDP Security Header. msdn{cc240579}.
s | stream |
flags | security flags |
BOOL rdp_read_share_control_header | ( | rdpRdp * | rdp, |
wStream * | s, | ||
UINT16 * | tpktLength, | ||
UINT16 * | remainingLength, | ||
UINT16 * | type, | ||
UINT16 * | channel_id | ||
) |
BOOL rdp_read_share_data_header | ( | rdpRdp * | rdp, |
wStream * | s, | ||
UINT16 * | length, | ||
BYTE * | type, | ||
UINT32 * | shareId, | ||
BYTE * | compressedType, | ||
UINT16 * | compressedLength | ||
) |
state_run_t rdp_recv_callback | ( | rdpTransport * | transport, |
wStream * | s, | ||
void * | extra | ||
) |
|
static |
state_run_t rdp_recv_data_pdu | ( | rdpRdp * | rdp, |
wStream * | s | ||
) |
|
static |
state_run_t rdp_recv_message_channel_pdu | ( | rdpRdp * | rdp, |
wStream * | s, | ||
UINT16 | securityFlags | ||
) |
|
static |
state_run_t rdp_recv_out_of_sequence_pdu | ( | rdpRdp * | rdp, |
wStream * | s, | ||
UINT16 | pduType, | ||
UINT16 | length | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Process an RDP packet.
rdp | RDP module |
s | stream |
BOOL rdp_reset | ( | rdpRdp * | rdp | ) |
|
static |
BOOL rdp_reset_rc4_decrypt_keys | ( | rdpRdp * | rdp | ) |
BOOL rdp_reset_rc4_encrypt_keys | ( | rdpRdp * | rdp | ) |
|
static |
BOOL rdp_reset_runtime_settings | ( | rdpRdp * | rdp | ) |
const char* rdp_security_flag_string | ( | UINT32 | securityFlags, |
char * | buffer, | ||
size_t | size | ||
) |
|
static |
|
static |
Send an RDP packet.
rdp | RDP module |
s | stream |
channel_id | channel id |
BOOL rdp_send_error_info | ( | rdpRdp * | rdp | ) |
wStream* rdp_send_stream_init | ( | rdpRdp * | rdp | ) |
wStream* rdp_send_stream_pdu_init | ( | rdpRdp * | rdp | ) |
BOOL rdp_set_backup_settings | ( | rdpRdp * | rdp | ) |
BOOL rdp_set_error_info | ( | rdpRdp * | rdp, |
UINT32 | errorInfo | ||
) |
BOOL rdp_set_io_callback_context | ( | rdpRdp * | rdp, |
void * | usercontext | ||
) |
BOOL rdp_set_io_callbacks | ( | rdpRdp * | rdp, |
const rdpTransportIo * | io_callbacks | ||
) |
|
static |
Write an RDP packet header.
rdp | rdp module |
s | stream |
length | RDP packet length |
channelId | channel id |
Write RDP Security Header. msdn{cc240579}
s | stream |
flags | security flags |
|
static |
|
static |
|
static |
|
static |