FreeRDP
pf_server.c File Reference
#include <winpr/crt.h>
#include <winpr/ssl.h>
#include <winpr/synch.h>
#include <winpr/string.h>
#include <winpr/winsock.h>
#include <winpr/thread.h>
#include <errno.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/wtsvc.h>
#include <freerdp/channels/channels.h>
#include "pf_server.h"
#include "pf_log.h"
#include "pf_config.h"
#include "pf_client.h"
#include "pf_context.h"
#include "pf_update.h"
#include "pf_rdpgfx.h"
#include "pf_disp.h"
#include "pf_rail.h"
#include "pf_channels.h"
#include "pf_modules.h"

Macros

#define TAG   PROXY_TAG("server")
 
#define TARGET_MAX   (100)
 
#define ROUTING_TOKEN_PREFIX   "Cookie: msts="
 

Functions

static BOOL pf_server_parse_target_from_routing_token (rdpContext *context, char **target, DWORD *port)
 
static BOOL pf_server_get_target_info (rdpContext *context, rdpSettings *settings, proxyConfig *config)
 
static BOOL pf_server_post_connect (freerdp_peer *peer)
 
static BOOL pf_server_activate (freerdp_peer *peer)
 
static BOOL pf_server_adjust_monitor_layout (freerdp_peer *peer)
 
static BOOL pf_server_receive_channel_data_hook (freerdp_peer *peer, UINT16 channelId, const BYTE *data, size_t size, UINT32 flags, size_t totalSize)
 
static BOOL pf_server_initialize_peer_connection (freerdp_peer *peer)
 
static DWORD WINAPI pf_server_handle_peer (LPVOID arg)
 
static BOOL pf_server_peer_accepted (freerdp_listener *listener, freerdp_peer *client)
 
static DWORD WINAPI pf_server_mainloop (LPVOID arg)
 
BOOL pf_server_start (proxyServer *server)
 
static void pf_server_clients_list_client_free (void *obj)
 
proxyServer * pf_server_new (proxyConfig *config)
 
void pf_server_stop (proxyServer *server)
 
void pf_server_free (proxyServer *server)
 

Variables

static psPeerReceiveChannelData server_receive_channel_data_original = NULL
 

Macro Definition Documentation

◆ ROUTING_TOKEN_PREFIX

#define ROUTING_TOKEN_PREFIX   "Cookie: msts="

◆ TAG

#define TAG   PROXY_TAG("server")

FreeRDP: A Remote Desktop Protocol Implementation FreeRDP Proxy Server

Copyright 2019 Mati Shabtay matis.nosp@m.habt.nosp@m.ay@gm.nosp@m.ail..nosp@m.com Copyright 2019 Kobi Mizrachi kmizr.nosp@m.achi.nosp@m.18@gm.nosp@m.ail..nosp@m.com Copyright 2019 Idan Freiberg speid.nosp@m.y@gm.nosp@m.ail.c.nosp@m.om

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.

◆ TARGET_MAX

#define TARGET_MAX   (100)

Function Documentation

◆ pf_server_activate()

static BOOL pf_server_activate ( freerdp_peer *  peer)
static
Here is the caller graph for this function:

◆ pf_server_adjust_monitor_layout()

static BOOL pf_server_adjust_monitor_layout ( freerdp_peer *  peer)
static
Here is the caller graph for this function:

◆ pf_server_clients_list_client_free()

static void pf_server_clients_list_client_free ( void *  obj)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_free()

void pf_server_free ( proxyServer *  server)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_get_target_info()

static BOOL pf_server_get_target_info ( rdpContext *  context,
rdpSettings *  settings,
proxyConfig *  config 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_handle_peer()

static DWORD WINAPI pf_server_handle_peer ( LPVOID  arg)
static

Handles an incoming client connection, to be run in it's own thread.

arg is a pointer to a freerdp_peer representing the client.

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

◆ pf_server_initialize_peer_connection()

static BOOL pf_server_initialize_peer_connection ( freerdp_peer *  peer)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_mainloop()

static DWORD WINAPI pf_server_mainloop ( LPVOID  arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_new()

proxyServer* pf_server_new ( proxyConfig *  config)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_parse_target_from_routing_token()

static BOOL pf_server_parse_target_from_routing_token ( rdpContext *  context,
char **  target,
DWORD *  port 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_peer_accepted()

static BOOL pf_server_peer_accepted ( freerdp_listener *  listener,
freerdp_peer *  client 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_post_connect()

static BOOL pf_server_post_connect ( freerdp_peer *  peer)
static

This callback is called when the entire connection sequence is done (as described in MS-RDPBCGR section 1.3)

The server may start sending graphics output and receiving keyboard/mouse input after this callback returns.

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

◆ pf_server_receive_channel_data_hook()

static BOOL pf_server_receive_channel_data_hook ( freerdp_peer *  peer,
UINT16  channelId,
const BYTE data,
size_t  size,
UINT32  flags,
size_t  totalSize 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_start()

BOOL pf_server_start ( proxyServer *  server)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pf_server_stop()

void pf_server_stop ( proxyServer *  server)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ server_receive_channel_data_original

psPeerReceiveChannelData server_receive_channel_data_original = NULL
static