FreeRDP
sfreerdp.c File Reference
#include <freerdp/config.h>
#include <errno.h>
#include <signal.h>
#include <winpr/winpr.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/ssl.h>
#include <winpr/synch.h>
#include <winpr/file.h>
#include <winpr/string.h>
#include <winpr/path.h>
#include <winpr/image.h>
#include <winpr/winsock.h>
#include <freerdp/streamdump.h>
#include <freerdp/transport_io.h>
#include <freerdp/channels/wtsvc.h>
#include <freerdp/channels/channels.h>
#include <freerdp/channels/drdynvc.h>
#include <freerdp/freerdp.h>
#include <freerdp/constants.h>
#include <freerdp/server/rdpsnd.h>
#include <freerdp/settings.h>
#include "sf_ainput.h"
#include "sf_audin.h"
#include "sf_rdpsnd.h"
#include "sf_encomsp.h"
#include "sfreerdp.h"
#include <freerdp/log.h>

Macros

#define TAG   SERVER_TAG("sample")
 
#define SAMPLE_SERVER_USE_CLIENT_RESOLUTION   1
 
#define SAMPLE_SERVER_DEFAULT_WIDTH   1024
 
#define SAMPLE_SERVER_DEFAULT_HEIGHT   768
 

Functions

static void test_peer_context_free (freerdp_peer *client, rdpContext *ctx)
 
static BOOL test_peer_context_new (freerdp_peer *client, rdpContext *ctx)
 
static BOOL test_peer_init (freerdp_peer *client)
 
static wStreamtest_peer_stream_init (testPeerContext *context)
 
static void test_peer_begin_frame (freerdp_peer *client)
 
static void test_peer_end_frame (freerdp_peer *client)
 
static BOOL stream_surface_bits_supported (const rdpSettings *settings)
 
static BOOL test_peer_draw_background (freerdp_peer *client)
 
static int open_icon (wImage *img)
 
static BOOL test_peer_load_icon (freerdp_peer *client)
 
static void test_peer_draw_icon (freerdp_peer *client, UINT32 x, UINT32 y)
 
static BOOL test_sleep_tsdiff (UINT32 *old_sec, UINT32 *old_usec, UINT32 new_sec, UINT32 new_usec)
 
static BOOL tf_peer_dump_rfx (freerdp_peer *client)
 
static DWORD WINAPI tf_debug_channel_thread_func (LPVOID arg)
 
static BOOL tf_peer_post_connect (freerdp_peer *client)
 
static BOOL tf_peer_activate (freerdp_peer *client)
 
static BOOL tf_peer_synchronize_event (rdpInput *input, UINT32 flags)
 
static BOOL tf_peer_keyboard_event (rdpInput *input, UINT16 flags, UINT8 code)
 
static BOOL tf_peer_unicode_keyboard_event (rdpInput *input, UINT16 flags, UINT16 code)
 
static BOOL tf_peer_mouse_event (rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 
static BOOL tf_peer_extended_mouse_event (rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 
static BOOL tf_peer_refresh_rect (rdpContext *context, BYTE count, const RECTANGLE_16 *areas)
 
static BOOL tf_peer_suppress_output (rdpContext *context, BYTE allow, const RECTANGLE_16 *area)
 
static int hook_peer_write_pdu (rdpTransport *transport, wStream *s)
 
static DWORD WINAPI test_peer_mainloop (LPVOID arg)
 
static BOOL test_peer_accepted (freerdp_listener *instance, freerdp_peer *client)
 
static void test_server_mainloop (freerdp_listener *instance)
 
static void print_entry (FILE *fp, WINPR_FORMAT_ARG const char *fmt, const char *what, size_t size)
 
static WINPR_NORETURN (void usage(const char *app, const char *invalid))
 
int main (int argc, char *argv[])
 

Variables

struct {
   const char   spcap [7]
 
   const char   sfast [7]
 
   const char   sport [7]
 
   const char   slocal_only [13]
 
   const char   scert [7]
 
   const char   skey [6]
 
options = { "--pcap=", "--fast", "--port=", "--local-only", "--cert=", "--key=" }
 

Macro Definition Documentation

◆ SAMPLE_SERVER_DEFAULT_HEIGHT

#define SAMPLE_SERVER_DEFAULT_HEIGHT   768

◆ SAMPLE_SERVER_DEFAULT_WIDTH

#define SAMPLE_SERVER_DEFAULT_WIDTH   1024

◆ SAMPLE_SERVER_USE_CLIENT_RESOLUTION

#define SAMPLE_SERVER_USE_CLIENT_RESOLUTION   1

◆ TAG

#define TAG   SERVER_TAG("sample")

FreeRDP: A Remote Desktop Protocol Implementation FreeRDP Test Server

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2011 Vic Lee Copyright 2014 Norbert Federa norbe.nosp@m.rt.f.nosp@m.edera.nosp@m.@thi.nosp@m.ncast.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

◆ hook_peer_write_pdu()

static int hook_peer_write_pdu ( rdpTransport *  transport,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)
Here is the call graph for this function:

◆ open_icon()

static int open_icon ( wImage img)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_entry()

static void print_entry ( FILE *  fp,
WINPR_FORMAT_ARG const char *  fmt,
const char *  what,
size_t  size 
)
static
Here is the caller graph for this function:

◆ stream_surface_bits_supported()

static BOOL stream_surface_bits_supported ( const rdpSettings *  settings)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_peer_accepted()

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

◆ test_peer_begin_frame()

static void test_peer_begin_frame ( freerdp_peer *  client)
static
Here is the caller graph for this function:

◆ test_peer_context_free()

static void test_peer_context_free ( freerdp_peer *  client,
rdpContext *  ctx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_peer_context_new()

static BOOL test_peer_context_new ( freerdp_peer *  client,
rdpContext *  ctx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_peer_draw_background()

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

◆ test_peer_draw_icon()

static void test_peer_draw_icon ( freerdp_peer *  client,
UINT32  x,
UINT32  y 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_peer_end_frame()

static void test_peer_end_frame ( freerdp_peer *  client)
static
Here is the caller graph for this function:

◆ test_peer_init()

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

◆ test_peer_load_icon()

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

◆ test_peer_mainloop()

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

◆ test_peer_stream_init()

static wStream* test_peer_stream_init ( testPeerContext *  context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_server_mainloop()

static void test_server_mainloop ( freerdp_listener *  instance)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_sleep_tsdiff()

static BOOL test_sleep_tsdiff ( UINT32 *  old_sec,
UINT32 *  old_usec,
UINT32  new_sec,
UINT32  new_usec 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_debug_channel_thread_func()

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

◆ tf_peer_activate()

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

◆ tf_peer_dump_rfx()

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

◆ tf_peer_extended_mouse_event()

static BOOL tf_peer_extended_mouse_event ( rdpInput *  input,
UINT16  flags,
UINT16  x,
UINT16  y 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_peer_keyboard_event()

static BOOL tf_peer_keyboard_event ( rdpInput *  input,
UINT16  flags,
UINT8  code 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_peer_mouse_event()

static BOOL tf_peer_mouse_event ( rdpInput *  input,
UINT16  flags,
UINT16  x,
UINT16  y 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_peer_post_connect()

static BOOL tf_peer_post_connect ( freerdp_peer *  client)
static

This callback is called when the entire connection sequence is done, i.e. we've received the Font List PDU from the client and sent out the Font Map PDU. 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:

◆ tf_peer_refresh_rect()

static BOOL tf_peer_refresh_rect ( rdpContext *  context,
BYTE  count,
const RECTANGLE_16 areas 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_peer_suppress_output()

static BOOL tf_peer_suppress_output ( rdpContext *  context,
BYTE  allow,
const RECTANGLE_16 area 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_peer_synchronize_event()

static BOOL tf_peer_synchronize_event ( rdpInput *  input,
UINT32  flags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_peer_unicode_keyboard_event()

static BOOL tf_peer_unicode_keyboard_event ( rdpInput *  input,
UINT16  flags,
UINT16  code 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WINPR_NORETURN()

static WINPR_NORETURN ( void   usageconst char *app, const char *invalid)
static
Here is the call graph for this function:

Variable Documentation

◆ 

const { ... } options

◆ scert

const char scert[7]

◆ sfast

const char sfast[7]

◆ skey

const char skey[6]

◆ slocal_only

const char slocal_only[13]

◆ spcap

const char spcap[7]

◆ sport

const char sport[7]