FreeRDP
autodetect.c File Reference
#include <freerdp/config.h>
#include <winpr/crypto.h>
#include <winpr/assert.h>
#include "autodetect.h"

Macros

#define TYPE_ID_AUTODETECT_REQUEST   0x00
 
#define TYPE_ID_AUTODETECT_RESPONSE   0x01
 
#define RDP_RTT_REQUEST_TYPE_CONTINUOUS   0x0001
 
#define RDP_RTT_REQUEST_TYPE_CONNECTTIME   0x1001
 
#define RDP_RTT_RESPONSE_TYPE   0x0000
 
#define RDP_BW_START_REQUEST_TYPE_CONTINUOUS   0x0014
 
#define RDP_BW_START_REQUEST_TYPE_TUNNEL   0x0114
 
#define RDP_BW_START_REQUEST_TYPE_CONNECTTIME   0x1014
 
#define RDP_BW_PAYLOAD_REQUEST_TYPE   0x0002
 
#define RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME   0x002B
 
#define RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS   0x0429
 
#define RDP_BW_STOP_REQUEST_TYPE_TUNNEL   0x0629
 
#define RDP_NETCHAR_SYNC_RESPONSE_TYPE   0x0018
 
#define RDP_NETCHAR_RESULTS_0x0840   0x0840U
 
#define RDP_NETCHAR_RESULTS_0x0880   0x0880U
 
#define RDP_NETCHAR_RESULTS_0x08C0   0x08C0U
 

Functions

static const char * autodetect_header_type_string (UINT8 headerType, char *buffer, size_t size)
 
static const char * autodetect_request_type_to_string (UINT32 requestType)
 
static const char * autodetect_request_type_to_string_buffer (UINT32 requestType, char *buffer, size_t size)
 
static BOOL autodetect_send_rtt_measure_request (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber)
 
static BOOL autodetect_send_rtt_measure_response (rdpAutoDetect *autodetect, UINT16 sequenceNumber)
 
static BOOL autodetect_send_bandwidth_measure_start (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber)
 
static BOOL autodetect_send_bandwidth_measure_payload (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber, UINT16 payloadLength)
 
static BOOL autodetect_send_bandwidth_measure_stop (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber, UINT16 payloadLength)
 
static BOOL autodetect_send_bandwidth_measure_results (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 responseType, UINT16 sequenceNumber)
 
static BOOL autodetect_send_netchar_result (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber, const rdpNetworkCharacteristicsResult *result)
 
static FREERDP_AUTODETECT_STATE autodetect_on_connect_time_auto_detect_begin_default (rdpAutoDetect *autodetect)
 
static FREERDP_AUTODETECT_STATE autodetect_on_connect_time_auto_detect_progress_default (rdpAutoDetect *autodetect)
 
static BOOL autodetect_send_netchar_sync (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber)
 
static BOOL autodetect_recv_rtt_measure_request (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_REQ_PDU *autodetectReqPdu)
 
static BOOL autodetect_recv_rtt_measure_response (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_RSP_PDU *autodetectRspPdu)
 
static BOOL autodetect_recv_bandwidth_measure_start (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_REQ_PDU *autodetectReqPdu)
 
static BOOL autodetect_recv_bandwidth_measure_payload (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_REQ_PDU *autodetectReqPdu)
 
static BOOL autodetect_recv_bandwidth_measure_stop (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_REQ_PDU *autodetectReqPdu)
 
static BOOL autodetect_recv_bandwidth_measure_results (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_RSP_PDU *autodetectRspPdu)
 
static BOOL autodetect_recv_netchar_sync (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_RSP_PDU *autodetectRspPdu)
 
static BOOL autodetect_recv_netchar_request (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s, const AUTODETECT_REQ_PDU *autodetectReqPdu)
 
state_run_t autodetect_recv_request_packet (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s)
 
state_run_t autodetect_recv_response_packet (rdpAutoDetect *autodetect, RDP_TRANSPORT_TYPE transport, wStream *s)
 
void autodetect_on_connect_time_auto_detect_begin (rdpAutoDetect *autodetect)
 
void autodetect_on_connect_time_auto_detect_progress (rdpAutoDetect *autodetect)
 
rdpAutoDetect * autodetect_new (rdpContext *context)
 
void autodetect_free (rdpAutoDetect *autoDetect)
 
void autodetect_register_server_callbacks (rdpAutoDetect *autodetect)
 
FREERDP_AUTODETECT_STATE autodetect_get_state (rdpAutoDetect *autodetect)
 
rdpAutoDetect * autodetect_get (rdpContext *context)
 

Macro Definition Documentation

◆ RDP_BW_PAYLOAD_REQUEST_TYPE

#define RDP_BW_PAYLOAD_REQUEST_TYPE   0x0002

◆ RDP_BW_START_REQUEST_TYPE_CONNECTTIME

#define RDP_BW_START_REQUEST_TYPE_CONNECTTIME   0x1014

◆ RDP_BW_START_REQUEST_TYPE_CONTINUOUS

#define RDP_BW_START_REQUEST_TYPE_CONTINUOUS   0x0014

◆ RDP_BW_START_REQUEST_TYPE_TUNNEL

#define RDP_BW_START_REQUEST_TYPE_TUNNEL   0x0114

◆ RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME

#define RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME   0x002B

◆ RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS

#define RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS   0x0429

◆ RDP_BW_STOP_REQUEST_TYPE_TUNNEL

#define RDP_BW_STOP_REQUEST_TYPE_TUNNEL   0x0629

◆ RDP_NETCHAR_RESULTS_0x0840

#define RDP_NETCHAR_RESULTS_0x0840   0x0840U

◆ RDP_NETCHAR_RESULTS_0x0880

#define RDP_NETCHAR_RESULTS_0x0880   0x0880U

◆ RDP_NETCHAR_RESULTS_0x08C0

#define RDP_NETCHAR_RESULTS_0x08C0   0x08C0U

◆ RDP_NETCHAR_SYNC_RESPONSE_TYPE

#define RDP_NETCHAR_SYNC_RESPONSE_TYPE   0x0018

◆ RDP_RTT_REQUEST_TYPE_CONNECTTIME

#define RDP_RTT_REQUEST_TYPE_CONNECTTIME   0x1001

◆ RDP_RTT_REQUEST_TYPE_CONTINUOUS

#define RDP_RTT_REQUEST_TYPE_CONTINUOUS   0x0001

◆ RDP_RTT_RESPONSE_TYPE

#define RDP_RTT_RESPONSE_TYPE   0x0000

◆ TYPE_ID_AUTODETECT_REQUEST

#define TYPE_ID_AUTODETECT_REQUEST   0x00

FreeRDP: A Remote Desktop Protocol Implementation Auto-Detect PDUs

Copyright 2014 Dell Software Mike..nosp@m.McDo.nosp@m.nald@.nosp@m.soft.nosp@m.ware..nosp@m.dell.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.

◆ TYPE_ID_AUTODETECT_RESPONSE

#define TYPE_ID_AUTODETECT_RESPONSE   0x01

Function Documentation

◆ autodetect_free()

void autodetect_free ( rdpAutoDetect *  autodetect)

FreeRDP: A Remote Desktop Protocol Implementation Auto-Detect PDUs

Copyright 2014 Dell Software Mike..nosp@m.McDo.nosp@m.nald@.nosp@m.soft.nosp@m.ware..nosp@m.dell.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.

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

◆ autodetect_get()

rdpAutoDetect* autodetect_get ( rdpContext *  context)

◆ autodetect_get_state()

FREERDP_AUTODETECT_STATE autodetect_get_state ( rdpAutoDetect *  autodetect)
Here is the caller graph for this function:

◆ autodetect_header_type_string()

static const char* autodetect_header_type_string ( UINT8  headerType,
char *  buffer,
size_t  size 
)
static
Here is the caller graph for this function:

◆ autodetect_new()

rdpAutoDetect* autodetect_new ( rdpContext *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_on_connect_time_auto_detect_begin()

void autodetect_on_connect_time_auto_detect_begin ( rdpAutoDetect *  autodetect)
Here is the caller graph for this function:

◆ autodetect_on_connect_time_auto_detect_begin_default()

static FREERDP_AUTODETECT_STATE autodetect_on_connect_time_auto_detect_begin_default ( rdpAutoDetect *  autodetect)
static
Here is the caller graph for this function:

◆ autodetect_on_connect_time_auto_detect_progress()

void autodetect_on_connect_time_auto_detect_progress ( rdpAutoDetect *  autodetect)
Here is the caller graph for this function:

◆ autodetect_on_connect_time_auto_detect_progress_default()

static FREERDP_AUTODETECT_STATE autodetect_on_connect_time_auto_detect_progress_default ( rdpAutoDetect *  autodetect)
static
Here is the caller graph for this function:

◆ autodetect_recv_bandwidth_measure_payload()

static BOOL autodetect_recv_bandwidth_measure_payload ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_REQ_PDU *  autodetectReqPdu 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_recv_bandwidth_measure_results()

static BOOL autodetect_recv_bandwidth_measure_results ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_RSP_PDU *  autodetectRspPdu 
)
static
Here is the caller graph for this function:

◆ autodetect_recv_bandwidth_measure_start()

static BOOL autodetect_recv_bandwidth_measure_start ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_REQ_PDU *  autodetectReqPdu 
)
static
Here is the caller graph for this function:

◆ autodetect_recv_bandwidth_measure_stop()

static BOOL autodetect_recv_bandwidth_measure_stop ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_REQ_PDU *  autodetectReqPdu 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_recv_netchar_request()

static BOOL autodetect_recv_netchar_request ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_REQ_PDU *  autodetectReqPdu 
)
static
Here is the caller graph for this function:

◆ autodetect_recv_netchar_sync()

static BOOL autodetect_recv_netchar_sync ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_RSP_PDU *  autodetectRspPdu 
)
static
Here is the caller graph for this function:

◆ autodetect_recv_request_packet()

state_run_t autodetect_recv_request_packet ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_recv_response_packet()

state_run_t autodetect_recv_response_packet ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_recv_rtt_measure_request()

static BOOL autodetect_recv_rtt_measure_request ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_REQ_PDU *  autodetectReqPdu 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_recv_rtt_measure_response()

static BOOL autodetect_recv_rtt_measure_response ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
wStream s,
const AUTODETECT_RSP_PDU *  autodetectRspPdu 
)
static
Here is the caller graph for this function:

◆ autodetect_register_server_callbacks()

void autodetect_register_server_callbacks ( rdpAutoDetect *  autodetect)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_request_type_to_string()

static const char* autodetect_request_type_to_string ( UINT32  requestType)
static
Here is the caller graph for this function:

◆ autodetect_request_type_to_string_buffer()

static const char* autodetect_request_type_to_string_buffer ( UINT32  requestType,
char *  buffer,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_bandwidth_measure_payload()

static BOOL autodetect_send_bandwidth_measure_payload ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  sequenceNumber,
UINT16  payloadLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_bandwidth_measure_results()

static BOOL autodetect_send_bandwidth_measure_results ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  responseType,
UINT16  sequenceNumber 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_bandwidth_measure_start()

static BOOL autodetect_send_bandwidth_measure_start ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  sequenceNumber 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_bandwidth_measure_stop()

static BOOL autodetect_send_bandwidth_measure_stop ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  sequenceNumber,
UINT16  payloadLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_netchar_result()

static BOOL autodetect_send_netchar_result ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  sequenceNumber,
const rdpNetworkCharacteristicsResult *  result 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_netchar_sync()

static BOOL autodetect_send_netchar_sync ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  sequenceNumber 
)
static
Here is the call graph for this function:

◆ autodetect_send_rtt_measure_request()

static BOOL autodetect_send_rtt_measure_request ( rdpAutoDetect *  autodetect,
RDP_TRANSPORT_TYPE  transport,
UINT16  sequenceNumber 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autodetect_send_rtt_measure_response()

static BOOL autodetect_send_rtt_measure_response ( rdpAutoDetect *  autodetect,
UINT16  sequenceNumber 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: