FreeRDP
rts.c File Reference
#include <winpr/crt.h>
#include <winpr/crypto.h>
#include <winpr/winhttp.h>
#include <freerdp/log.h>
#include "ncacn_http.h"
#include "rpc_client.h"
#include "rts.h"

Macros

#define TAG   FREERDP_TAG("core.gateway.rts")
 

Functions

static void rts_pdu_header_init (rpcconn_rts_hdr_t *header)
 
static int rts_receive_window_size_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length, UINT32 *ReceiveWindowSize)
 
static int rts_receive_window_size_command_write (BYTE *buffer, UINT32 ReceiveWindowSize)
 
static int rts_flow_control_ack_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length, UINT32 *BytesReceived, UINT32 *AvailableWindow, BYTE *ChannelCookie)
 
static int rts_flow_control_ack_command_write (BYTE *buffer, UINT32 BytesReceived, UINT32 AvailableWindow, BYTE *ChannelCookie)
 
static int rts_connection_timeout_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length, UINT32 *ConnectionTimeout)
 
static int rts_connection_timeout_command_write (BYTE *buffer, UINT32 ConnectionTimeout)
 
static int rts_cookie_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_cookie_command_write (BYTE *buffer, BYTE *Cookie)
 
static int rts_channel_lifetime_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_channel_lifetime_command_write (BYTE *buffer, UINT32 ChannelLifetime)
 
static int rts_client_keepalive_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_client_keepalive_command_write (BYTE *buffer, UINT32 ClientKeepalive)
 
static int rts_version_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_version_command_write (BYTE *buffer)
 
static int rts_empty_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_empty_command_write (BYTE *buffer)
 
static SSIZE_T rts_padding_command_read (const BYTE *buffer, size_t length)
 
static int rts_padding_command_write (BYTE *buffer, UINT32 ConformanceCount)
 
static int rts_negative_ance_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_negative_ance_command_write (BYTE *buffer)
 
static int rts_ance_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_ance_command_write (BYTE *buffer)
 
static SSIZE_T rts_client_address_command_read (const BYTE *buffer, size_t length)
 
static int rts_client_address_command_write (BYTE *buffer, UINT32 AddressType, BYTE *ClientAddress)
 
static int rts_association_group_id_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_association_group_id_command_write (BYTE *buffer, BYTE *AssociationGroupId)
 
static int rts_destination_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length, UINT32 *Destination)
 
static int rts_destination_command_write (BYTE *buffer, UINT32 Destination)
 
static int rts_ping_traffic_sent_notify_command_read (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_ping_traffic_sent_notify_command_write (BYTE *buffer, UINT32 PingTrafficSent)
 
void rts_generate_cookie (BYTE *cookie)
 
int rts_send_CONN_A1_pdu (rdpRpc *rpc)
 
int rts_recv_CONN_A3_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
int rts_send_CONN_B1_pdu (rdpRpc *rpc)
 
int rts_recv_CONN_C2_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_send_keep_alive_pdu (rdpRpc *rpc)
 
int rts_send_flow_control_ack_pdu (rdpRpc *rpc)
 
static int rts_recv_flow_control_ack_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_recv_flow_control_ack_with_destination_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_send_ping_pdu (rdpRpc *rpc)
 
SSIZE_T rts_command_length (UINT32 CommandType, const BYTE *buffer, size_t length)
 
static int rts_send_OUT_R2_A7_pdu (rdpRpc *rpc)
 
static int rts_send_OUT_R2_C1_pdu (rdpRpc *rpc)
 
int rts_send_OUT_R1_A3_pdu (rdpRpc *rpc)
 
static int rts_recv_OUT_R1_A2_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_recv_OUT_R2_A6_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
static int rts_recv_OUT_R2_B3_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 
int rts_recv_out_of_sequence_pdu (rdpRpc *rpc, BYTE *buffer, UINT32 length)
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("core.gateway.rts")

FreeRDP: A Remote Desktop Protocol Implementation Request To Send (RTS) PDUs

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..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

static int rts_ance_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_ance_command_write ( BYTE buffer)
static
static int rts_association_group_id_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_association_group_id_command_write ( BYTE buffer,
BYTE AssociationGroupId 
)
static

Here is the caller graph for this function:

static int rts_channel_lifetime_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_channel_lifetime_command_write ( BYTE buffer,
UINT32  ChannelLifetime 
)
static

Here is the caller graph for this function:

static SSIZE_T rts_client_address_command_read ( const BYTE buffer,
size_t  length 
)
static

Here is the caller graph for this function:

static int rts_client_address_command_write ( BYTE buffer,
UINT32  AddressType,
BYTE ClientAddress 
)
static
static int rts_client_keepalive_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_client_keepalive_command_write ( BYTE buffer,
UINT32  ClientKeepalive 
)
static

An unsigned integer that specifies the keep-alive interval, in milliseconds, that this connection is configured to use. This value MUST be 0 or in the inclusive range of 60,000 through 4,294,967,295. If it is 0, it MUST be interpreted as 300,000.

Here is the caller graph for this function:

SSIZE_T rts_command_length ( UINT32  CommandType,
const BYTE buffer,
size_t  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_connection_timeout_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length,
UINT32 ConnectionTimeout 
)
static

Here is the caller graph for this function:

static int rts_connection_timeout_command_write ( BYTE buffer,
UINT32  ConnectionTimeout 
)
static
static int rts_cookie_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_cookie_command_write ( BYTE buffer,
BYTE Cookie 
)
static

Here is the caller graph for this function:

static int rts_destination_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length,
UINT32 Destination 
)
static

Here is the caller graph for this function:

static int rts_destination_command_write ( BYTE buffer,
UINT32  Destination 
)
static

Here is the caller graph for this function:

static int rts_empty_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_empty_command_write ( BYTE buffer)
static

Here is the caller graph for this function:

static int rts_flow_control_ack_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length,
UINT32 BytesReceived,
UINT32 AvailableWindow,
BYTE ChannelCookie 
)
static

Here is the caller graph for this function:

static int rts_flow_control_ack_command_write ( BYTE buffer,
UINT32  BytesReceived,
UINT32  AvailableWindow,
BYTE ChannelCookie 
)
static

Here is the caller graph for this function:

void rts_generate_cookie ( BYTE cookie)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_negative_ance_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_negative_ance_command_write ( BYTE buffer)
static
static SSIZE_T rts_padding_command_read ( const BYTE buffer,
size_t  length 
)
static

Here is the caller graph for this function:

static int rts_padding_command_write ( BYTE buffer,
UINT32  ConformanceCount 
)
static
static void rts_pdu_header_init ( rpcconn_rts_hdr_t header)
static

RTS PDU Header

The RTS PDU Header has the same layout as the common header of the connection-oriented RPC PDU as specified in [C706] section 12.6.1, with a few additional requirements around the contents of the header fields. The additional requirements are as follows:

All fields MUST use little-endian byte order.

Fragmentation MUST NOT occur for an RTS PDU.

PFC_FIRST_FRAG and PFC_LAST_FRAG MUST be present in all RTS PDUs, and all other PFC flags MUST NOT be present.

The rpc_vers and rpc_vers_minor fields MUST contain version information as described in [MS-RPCE] section 1.7.

PTYPE MUST be set to a value of 20 (0x14). This field differentiates RTS packets from other RPC packets.

The packed_drep MUST indicate little-endian integer and floating-pointer byte order, IEEE float-point format representation, and ASCII character format as specified in [C706] section 12.6.

The auth_length MUST be set to 0.

The frag_length field MUST reflect the size of the header plus the size of all commands, including the variable portion of variable-sized commands.

The call_id MUST be set to 0 by senders and MUST be 0 on receipt.

Here is the caller graph for this function:

static int rts_ping_traffic_sent_notify_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static
static int rts_ping_traffic_sent_notify_command_write ( BYTE buffer,
UINT32  PingTrafficSent 
)
static
static int rts_receive_window_size_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length,
UINT32 ReceiveWindowSize 
)
static

Here is the caller graph for this function:

static int rts_receive_window_size_command_write ( BYTE buffer,
UINT32  ReceiveWindowSize 
)
static

Here is the caller graph for this function:

int rts_recv_CONN_A3_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int rts_recv_CONN_C2_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_recv_flow_control_ack_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_recv_flow_control_ack_with_destination_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static

When the sender receives a FlowControlAck RTS PDU, it MUST use the following formula to recalculate its Sender AvailableWindow variable:

Sender AvailableWindow = Receiver AvailableWindow_from_ack - (BytesSent - BytesReceived_from_ack)

Where:

Receiver AvailableWindow_from_ack is the Available Window field in the Flow Control Acknowledgement Structure (section 2.2.3.4) in the PDU received.

BytesReceived_from_ack is the Bytes Received field in the Flow Control Acknowledgement structure in the PDU received.

Here is the call graph for this function:

Here is the caller graph for this function:

int rts_recv_out_of_sequence_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_recv_OUT_R1_A2_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_recv_OUT_R2_A6_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_recv_OUT_R2_B3_pdu ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int rts_send_CONN_A1_pdu ( rdpRpc *  rpc)

Here is the call graph for this function:

Here is the caller graph for this function:

int rts_send_CONN_B1_pdu ( rdpRpc *  rpc)

Here is the call graph for this function:

Here is the caller graph for this function:

int rts_send_flow_control_ack_pdu ( rdpRpc *  rpc)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_send_keep_alive_pdu ( rdpRpc *  rpc)
static

Here is the call graph for this function:

int rts_send_OUT_R1_A3_pdu ( rdpRpc *  rpc)

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_send_OUT_R2_A7_pdu ( rdpRpc *  rpc)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_send_OUT_R2_C1_pdu ( rdpRpc *  rpc)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_send_ping_pdu ( rdpRpc *  rpc)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int rts_version_command_read ( rdpRpc *  rpc,
BYTE buffer,
UINT32  length 
)
static

Here is the caller graph for this function:

static int rts_version_command_write ( BYTE buffer)
static

Here is the caller graph for this function: