FreeRDP
transport.h File Reference
#include "tcp.h"
#include "nla.h"
#include "rdstls.h"
#include "gateway/tsg.h"
#include <winpr/sspi.h>
#include <winpr/wlog.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/stream.h>
#include <winpr/collections.h>
#include <freerdp/api.h>
#include <time.h>
#include <freerdp/types.h>
#include <freerdp/settings.h>
#include <freerdp/transport_io.h>
#include "state.h"
This graph shows which files directly or indirectly include this file:

Typedefs

typedef state_run_t(* TransportRecv) (rdpTransport *transport, wStream *stream, void *extra)
 

Enumerations

enum  TRANSPORT_LAYER {
  TRANSPORT_LAYER_TCP , TRANSPORT_LAYER_TLS , TRANSPORT_LAYER_NAMEDPIPE , TRANSPORT_LAYER_TSG ,
  TRANSPORT_LAYER_TSG_TLS , TRANSPORT_LAYER_CLOSED
}
 

Functions

FREERDP_LOCAL wStreamtransport_send_stream_init (rdpTransport *transport, size_t size)
 
FREERDP_LOCAL BOOL transport_connect (rdpTransport *transport, const char *hostname, UINT16 port, DWORD timeout)
 
FREERDP_LOCAL BOOL transport_connect_childsession (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_attach (rdpTransport *transport, int sockfd)
 Attach a socket to the transport layer. More...
 
FREERDP_LOCAL BOOL transport_disconnect (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_connect_rdp (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_connect_tls (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_connect_nla (rdpTransport *transport, BOOL earlyUserAuth)
 
FREERDP_LOCAL BOOL transport_connect_rdstls (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_connect_aad (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_accept_rdp (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_accept_tls (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_accept_nla (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_accept_rdstls (rdpTransport *transport)
 
FREERDP_LOCAL int transport_read_pdu (rdpTransport *transport, wStream *s)
 Try to read a complete PDU (NLA, fast-path or tpkt) from the underlying transport. More...
 
FREERDP_LOCAL int transport_write (rdpTransport *transport, wStream *s)
 
FREERDP_LOCAL BOOL transport_get_public_key (rdpTransport *transport, const BYTE **data, DWORD *length)
 
FREERDP_LOCAL int transport_check_fds (rdpTransport *transport)
 
FREERDP_LOCAL DWORD transport_get_event_handles (rdpTransport *transport, HANDLE *events, DWORD nCount)
 
FREERDP_LOCAL HANDLE transport_get_front_bio (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_blocking_mode (rdpTransport *transport, BOOL blocking)
 
FREERDP_LOCAL void transport_set_gateway_enabled (rdpTransport *transport, BOOL GatewayEnabled)
 
FREERDP_LOCAL void transport_set_nla_mode (rdpTransport *transport, BOOL NlaMode)
 
FREERDP_LOCAL void transport_set_rdstls_mode (rdpTransport *transport, BOOL RdstlsMode)
 
FREERDP_LOCAL void transport_set_aad_mode (rdpTransport *transport, BOOL AadMode)
 
FREERDP_LOCAL BOOL transport_is_write_blocked (rdpTransport *transport)
 
FREERDP_LOCAL int transport_drain_output_buffer (rdpTransport *transport)
 
FREERDP_LOCAL wStreamtransport_receive_pool_take (rdpTransport *transport)
 
FREERDP_LOCAL int transport_receive_pool_return (rdpTransport *transport, wStream *pdu)
 
FREERDP_LOCAL BOOL transport_io_callback_set_event (rdpTransport *transport, BOOL set)
 
FREERDP_LOCAL const rdpTransportIo * transport_get_io_callbacks (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_io_callbacks (rdpTransport *transport, const rdpTransportIo *io_callbacks)
 
FREERDP_LOCAL BOOL transport_set_nla (rdpTransport *transport, rdpNla *nla)
 
FREERDP_LOCAL rdpNla * transport_get_nla (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_tls (rdpTransport *transport, rdpTls *tls)
 
FREERDP_LOCAL rdpTls * transport_get_tls (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_tsg (rdpTransport *transport, rdpTsg *tsg)
 
FREERDP_LOCAL rdpTsg * transport_get_tsg (rdpTransport *transport)
 
FREERDP_LOCAL wStreamtransport_take_from_pool (rdpTransport *transport, size_t size)
 
FREERDP_LOCAL ULONG transport_get_bytes_sent (rdpTransport *transport, BOOL resetCount)
 
FREERDP_LOCAL BOOL transport_have_more_bytes_to_read (rdpTransport *transport)
 
FREERDP_LOCAL TRANSPORT_LAYER transport_get_layer (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_layer (rdpTransport *transport, TRANSPORT_LAYER layer)
 
FREERDP_LOCAL BOOL transport_get_blocking (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_blocking (rdpTransport *transport, BOOL blocking)
 
FREERDP_LOCAL BOOL transport_set_connected_event (rdpTransport *transport)
 
FREERDP_LOCAL BOOL transport_set_recv_callbacks (rdpTransport *transport, TransportRecv recv, void *extra)
 
FREERDP_LOCAL int transport_tcp_connect (rdpTransport *transport, const char *hostname, int port, DWORD timeout)
 
FREERDP_LOCAL void transport_free (rdpTransport *transport)
 
FREERDP_LOCAL rdpTransport * transport_new (rdpContext *context)
 
FREERDP_LOCAL void transport_set_early_user_auth_mode (rdpTransport *transport, BOOL EUAMode)
 

Typedef Documentation

◆ TransportRecv

typedef state_run_t(* TransportRecv) (rdpTransport *transport, wStream *stream, void *extra)

Enumeration Type Documentation

◆ TRANSPORT_LAYER

FreeRDP: A Remote Desktop Protocol Implementation Network Transport Layer

Copyright 2011 Vic Lee

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.

Enumerator
TRANSPORT_LAYER_TCP 
TRANSPORT_LAYER_TLS 
TRANSPORT_LAYER_NAMEDPIPE 
TRANSPORT_LAYER_TSG 
TRANSPORT_LAYER_TSG_TLS 
TRANSPORT_LAYER_CLOSED 

Function Documentation

◆ transport_accept_nla()

FREERDP_LOCAL BOOL transport_accept_nla ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_accept_rdp()

FREERDP_LOCAL BOOL transport_accept_rdp ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_accept_rdstls()

FREERDP_LOCAL BOOL transport_accept_rdstls ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_accept_tls()

FREERDP_LOCAL BOOL transport_accept_tls ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_attach()

FREERDP_LOCAL BOOL transport_attach ( rdpTransport *  transport,
int  sockfd 
)

Attach a socket to the transport layer.

!

The ownership of the socket provided by sockfd is taken if and only if the function is successful. In such a case the caller must no longer close or otherwise use the socket. If the function fails it is up to the caller to close the socket.

The implementation can be overridden by transport_set_io_callbacks(rdpTransportIo::TransportAttach)

Parameters
transportThe transport instance to attach the socket to
sockfdThe socket to attach to the transport
Returns
TRUE in case of success, FALSE otherwise.
Here is the caller graph for this function:

◆ transport_check_fds()

FREERDP_LOCAL int transport_check_fds ( rdpTransport *  transport)

Note: transport_read_pdu tries to read one PDU from the transport layer. The ReceiveBuffer might have a position > 0 in case of a non blocking transport. If transport_read_pdu returns 0 the pdu couldn't be read at this point. Note that transport->ReceiveBuffer is replaced after each iteration of this loop with a fresh stream instance from a pool.

status: -1: error 0: success 1: redirection

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

◆ transport_connect()

FREERDP_LOCAL BOOL transport_connect ( rdpTransport *  transport,
const char *  hostname,
UINT16  port,
DWORD  timeout 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_connect_aad()

FREERDP_LOCAL BOOL transport_connect_aad ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_connect_childsession()

FREERDP_LOCAL BOOL transport_connect_childsession ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_connect_nla()

FREERDP_LOCAL BOOL transport_connect_nla ( rdpTransport *  transport,
BOOL  earlyUserAuth 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_connect_rdp()

FREERDP_LOCAL BOOL transport_connect_rdp ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_connect_rdstls()

FREERDP_LOCAL BOOL transport_connect_rdstls ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_connect_tls()

FREERDP_LOCAL BOOL transport_connect_tls ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_disconnect()

FREERDP_LOCAL BOOL transport_disconnect ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_drain_output_buffer()

FREERDP_LOCAL int transport_drain_output_buffer ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_free()

FREERDP_LOCAL void transport_free ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_get_blocking()

FREERDP_LOCAL BOOL transport_get_blocking ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_get_bytes_sent()

FREERDP_LOCAL ULONG transport_get_bytes_sent ( rdpTransport *  transport,
BOOL  resetCount 
)
Here is the caller graph for this function:

◆ transport_get_event_handles()

FREERDP_LOCAL DWORD transport_get_event_handles ( rdpTransport *  transport,
HANDLE *  events,
DWORD  nCount 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_get_front_bio()

FREERDP_LOCAL HANDLE transport_get_front_bio ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_get_io_callbacks()

FREERDP_LOCAL const rdpTransportIo* transport_get_io_callbacks ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_get_layer()

FREERDP_LOCAL TRANSPORT_LAYER transport_get_layer ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_get_nla()

FREERDP_LOCAL rdpNla* transport_get_nla ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_get_public_key()

FREERDP_LOCAL BOOL transport_get_public_key ( rdpTransport *  transport,
const BYTE **  data,
DWORD *  length 
)
Here is the caller graph for this function:

◆ transport_get_tls()

FREERDP_LOCAL rdpTls* transport_get_tls ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_get_tsg()

FREERDP_LOCAL rdpTsg* transport_get_tsg ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_have_more_bytes_to_read()

FREERDP_LOCAL BOOL transport_have_more_bytes_to_read ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_io_callback_set_event()

FREERDP_LOCAL BOOL transport_io_callback_set_event ( rdpTransport *  transport,
BOOL  set 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_is_write_blocked()

FREERDP_LOCAL BOOL transport_is_write_blocked ( rdpTransport *  transport)
Here is the caller graph for this function:

◆ transport_new()

FREERDP_LOCAL rdpTransport* transport_new ( rdpContext *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_read_pdu()

FREERDP_LOCAL int transport_read_pdu ( rdpTransport *  transport,
wStream s 
)

Try to read a complete PDU (NLA, fast-path or tpkt) from the underlying transport.

If possible a complete PDU is read, in case of non blocking transport this might not succeed. Except in case of an error the passed stream will point to the last byte read (correct position). When the pdu read is completed the stream is sealed and the pointer set to 0

Parameters
[in]transportrdpTransport
[in]swStream
Returns
< 0 on error; 0 if not enough data is available (non blocking mode); > 0 number of bytes of the complete pdu read
Here is the caller graph for this function:

◆ transport_receive_pool_return()

FREERDP_LOCAL int transport_receive_pool_return ( rdpTransport *  transport,
wStream pdu 
)

◆ transport_receive_pool_take()

FREERDP_LOCAL wStream* transport_receive_pool_take ( rdpTransport *  transport)

◆ transport_send_stream_init()

FREERDP_LOCAL wStream* transport_send_stream_init ( rdpTransport *  transport,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_set_aad_mode()

FREERDP_LOCAL void transport_set_aad_mode ( rdpTransport *  transport,
BOOL  AadMode 
)
Here is the caller graph for this function:

◆ transport_set_blocking()

FREERDP_LOCAL BOOL transport_set_blocking ( rdpTransport *  transport,
BOOL  blocking 
)

◆ transport_set_blocking_mode()

FREERDP_LOCAL BOOL transport_set_blocking_mode ( rdpTransport *  transport,
BOOL  blocking 
)
Here is the caller graph for this function:

◆ transport_set_connected_event()

FREERDP_LOCAL BOOL transport_set_connected_event ( rdpTransport *  transport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_set_early_user_auth_mode()

FREERDP_LOCAL void transport_set_early_user_auth_mode ( rdpTransport *  transport,
BOOL  EUAMode 
)
Here is the caller graph for this function:

◆ transport_set_gateway_enabled()

FREERDP_LOCAL void transport_set_gateway_enabled ( rdpTransport *  transport,
BOOL  GatewayEnabled 
)
Here is the caller graph for this function:

◆ transport_set_io_callbacks()

FREERDP_LOCAL BOOL transport_set_io_callbacks ( rdpTransport *  transport,
const rdpTransportIo *  io_callbacks 
)
Here is the caller graph for this function:

◆ transport_set_layer()

FREERDP_LOCAL BOOL transport_set_layer ( rdpTransport *  transport,
TRANSPORT_LAYER  layer 
)
Here is the caller graph for this function:

◆ transport_set_nla()

FREERDP_LOCAL BOOL transport_set_nla ( rdpTransport *  transport,
rdpNla *  nla 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_set_nla_mode()

FREERDP_LOCAL void transport_set_nla_mode ( rdpTransport *  transport,
BOOL  NlaMode 
)
Here is the caller graph for this function:

◆ transport_set_rdstls_mode()

FREERDP_LOCAL void transport_set_rdstls_mode ( rdpTransport *  transport,
BOOL  RdstlsMode 
)
Here is the caller graph for this function:

◆ transport_set_recv_callbacks()

FREERDP_LOCAL BOOL transport_set_recv_callbacks ( rdpTransport *  transport,
TransportRecv  recv,
void *  extra 
)
Here is the caller graph for this function:

◆ transport_set_tls()

FREERDP_LOCAL BOOL transport_set_tls ( rdpTransport *  transport,
rdpTls *  tls 
)
Here is the call graph for this function:

◆ transport_set_tsg()

FREERDP_LOCAL BOOL transport_set_tsg ( rdpTransport *  transport,
rdpTsg *  tsg 
)
Here is the call graph for this function:

◆ transport_take_from_pool()

FREERDP_LOCAL wStream* transport_take_from_pool ( rdpTransport *  transport,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_tcp_connect()

FREERDP_LOCAL int transport_tcp_connect ( rdpTransport *  transport,
const char *  hostname,
int  port,
DWORD  timeout 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_write()

FREERDP_LOCAL int transport_write ( rdpTransport *  transport,
wStream s 
)
Here is the caller graph for this function: