Commit Graph

407 Commits

Author SHA1 Message Date
Armin Novak
f1adfb0e5c Added client redirect to proxy demo module 2022-01-11 12:34:43 +01:00
Armin Novak
4e6e5be654 Added proxy intercept channels
* New configuration to intercept certain channels
* Added rdpdr intercept implementation
2022-01-11 12:34:43 +01:00
Armin Novak
41d03143b8 Always call HOOK_TYPE_CLIENT_LOGIN_FAILURE if NLA failed 2021-11-03 11:12:00 +01:00
Armin Novak
149b9bf2cc Fixed StreamStaticInit warnings. 2021-10-18 10:53:05 +02:00
Armin Novak
73fbbcf0fb Fixed const warnings 2021-10-14 13:04:59 +02:00
akallabeth
a4be45dd5d
Fixed proxy to string functions (#7333) 2021-10-07 10:25:59 +02:00
akallabeth
32994b02f5
Fix pf_server_new: pass own copy of proxyConfig (#7328)
* Fix pf_server_new: pass own copy of proxyConfig

The lifecycle of proxyConfig passed to pf_server_new is unknown,
so pass proxyServer->config copy to modules.

* Early free parsed proxyConfig
2021-10-06 09:17:59 +02:00
Alexandru Bagu
7f7bf2d731 Remove passthrough channel name limit 2021-10-05 09:40:53 +02:00
Alexandru Bagu
1f4ae26a6f add missing filter type strings
* fixes crash that happens while debugging the proxy
2021-10-05 09:32:21 +02:00
akallabeth
03a9ca80c8
Refactor proxy (#7312)
* Added hidden transport dump and replay options

* Added settings to enable transport dump and replay
* Added check in freerdp_connect to skip authentication on
  dump replay

* Fixed proxy issues

* Proper shutdown handling
* Uninitialized variables
* Skip proxy-client channels, initialize from peer channels and
  config
* Filter static channels like dynamic ones
* Added proxy module filtering from config data (channels, input, ...)

* Removed oboslete proxy decoding related files

* Added defines for RDPECAM channel

* Added proxy config options:

* VideoRedirection
* CameraRedirection

* Fixed duplicate channel free
2021-09-23 14:52:03 +02:00
akallabeth
e4cd8674d7
Win proxy fix (#7311)
* Do not change warning level for MSVC builds

* Fixed windows PDB paths.
2021-09-22 16:00:00 +02:00
Armin Novak
fceb108fc5 Fixed comments and duplicate checks. 2021-09-20 10:59:59 +02:00
akallabeth
695e38398d Refactored proxy
* Removed unnecessary global data lists
* Improved error handling
* Do not initialize channel code in passthrough mode
2021-09-20 10:59:59 +02:00
akallabeth
4d23bc9372
Added proxy input state sync (#7282)
The proxy server component might receive input related events
before the proxy client has established the connection to the
target machine.
With this change, the current keyboard state is cached and sent
to the target when it is ready. All input events received before
the target is ready are discarded.
2021-09-10 10:39:07 +02:00
Armin Novak
673fb46836 Fixed uninitialized warnings 2021-09-10 08:16:25 +02:00
Armin Novak
0fe1e2359e Fixed all reserved-id-macro warnings 2021-09-10 08:16:25 +02:00
Armin Novak
ba0da04217 Fixed compilation warnings and duplicate defines 2021-09-09 08:53:20 +02:00
Armin Novak
5bd096cfc2 Fixed client context cleanup 2021-09-09 08:53:20 +02:00
Armin Novak
680dc81bad Added dump option for proxy config. 2021-09-09 08:53:20 +02:00
Armin Novak
3afd147bc0 Use wStream in pf_client_receive_channel_data_hook 2021-09-09 08:53:20 +02:00
Armin Novak
4463e5eda9 Added config dump function, improved resource cleanup 2021-09-09 08:53:20 +02:00
Armin Novak
0f8c52b9ca Fixed const warnings with argument parser 2021-09-09 08:53:20 +02:00
Armin Novak
f7c7211aad Fixed compilation warnings 2021-09-09 08:53:20 +02:00
Armin Novak
4cc0fbca33 Proxy client cleanups
* Use proper maximum handle defines
* Gracefully handle out of memory instead of assert
2021-09-09 08:53:20 +02:00
Armin Novak
4e44003832 Expose dynamic channel PDU types 2021-09-09 08:53:20 +02:00
Armin Novak
5a2231172c Updated copyright for proxy 2021-09-09 08:53:20 +02:00
Armin Novak
976c3c2ab9 Refactored proxy and proxy-modules:
* Split out proxy headers and moved to public API to allow external
  modules to be built.
* Split proxy into proxy library and proxy binary. The library
  can be used by other applications and provides a simple API
* Improved channel passthrough, now all channels including dynamic
  channels work.
* Extended module API to hook more events, improved module samples
* Cleaned up proxy code, removed global static variables used,
  added WINPR_ASSERT
2021-09-09 08:53:20 +02:00
akallabeth
c2f1562a4b Removed freerdp_peer::input 2021-09-09 08:36:01 +02:00
Armin Novak
bc9ef8327e Fixed #5382: Remove checked in test certificates
The sample servers did have checked in test certificates.
Remove them and let the user generate them when required.
2021-09-04 18:01:30 +02:00
Armin Novak
737f5a2036 Fixed argument const correctness 2021-08-27 13:21:02 +02:00
Armin Novak
413dcd3c28 Fixed RDPSND_CHANNEL_NAME
RDPSND channel is special, as it has many names.
(e.g. static channel, dynamic channel and UDP one.
Use RDPSND_CHANNEL_NAME to identify the module name instad of
RDPSND_DVC_CHANNEL_NAME
2021-08-25 13:40:47 +02:00
Armin Novak
054f0ea260 Use defines instad of channel names 2021-08-25 10:54:24 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
akallabeth
242f1734ec Fixed dpkg-buildpackage warnings 2021-06-30 11:57:23 +02:00
Armin Novak
8ef57bf296 Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR
Thanks @Pollux42 for the hint in #7096
2021-06-22 08:54:18 +02:00
Armin Novak
299c962b28 Fixed warnings 2021-06-17 10:35:22 +02:00
Armin Novak
1fd72ded43 Fixed compilation warnings 2021-06-16 14:26:06 +02:00
Armin Novak
216f65336e Fixed HashTable and ArrayList use errors 2021-06-16 11:46:42 +02:00
Armin Novak
d6c84c28fb Renamed ArrayList_Add to ArrayList_Append
* Do not break API silently
2021-06-16 11:46:42 +02:00
Armin Novak
a1c8e4cf85 Refactored ArrayList_Add to conform to other functions 2021-06-16 11:46:42 +02:00
Armin Novak
880c603c26 Renamed HashTable_Add to HashTable_Insert
* Since the changes break HashTable_Add rename it so that it will
  not fail silently
2021-06-16 11:46:42 +02:00
Armin Novak
cb642699c8 Modified HashTable API to be opaque
* Reuse wObject function pointers
* Add missing getters/setters
* Clean up return types, const correctness of arguments
2021-06-16 11:46:42 +02:00
Armin Novak
d36d94766e Replaced assert with WINPR_ASSERT 2021-06-14 09:37:07 +02:00
Armin Novak
6f2c6625e4 Added FREERDP/WINPR prefix to define GIT_REVISION 2021-05-18 13:37:34 +02:00
sss
6574fdf6e4 reverted changes from clang-format 2021-02-25 14:05:40 +01:00
Gluzskiy Alexandr
bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
akallabeth
e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
akallabeth
e3445eefab Fixed progressive decoding without subbanddiff 2020-12-15 14:47:05 +01:00
akallabeth
66dc4cc9ee Fixed compilation warnings. 2020-11-10 08:53:43 +01:00
akallabeth
dc392dea3e Fixed #6560: Missing return value. 2020-11-09 17:24:27 +01:00
akallabeth
6e3c00725a Cleaned up collections:
ArrayList, MessageQueue, Queue, PubSub, BipBuffer
ObjectPool and BufferPool
2020-11-06 12:30:13 +01:00
akallabeth
f282c55c7a Added clipboard CB_HUGE_FILE_SUPPORT_ENABLED flag 2020-09-29 09:03:49 +02:00
kubistika
5daba89e83 server: proxy: add more info on proxy logs 2020-09-21 14:16:31 +03:00
Kobi Mizrachi
67cfcb0af6 server: proxy: implement external routing 2020-09-18 09:51:12 +02:00
Armin Novak
57de0aebb5 Refactored socket warning fixes to be more readable. 2020-08-10 16:39:19 +02:00
Armin Novak
57b405ca26 Fixed compilation warnings. 2020-08-10 12:14:11 +02:00
Kobi Mizrachi
763f7ae2c8 server: proxy: add extern C for c++ plugins 2020-07-08 11:31:41 +02:00
Kobi Mizrachi
cc9ef8f74e server: proxy: rail: Fix rail handshake flags sync issue at reconnect 2020-07-07 15:31:57 +03:00
Kobi Mizrachi
b2d15eedc9 server: proxy: proxy rdp heartbeats 2020-07-07 09:57:53 +02:00
Kobi Mizrachi
2ae7c2a6d4 server: proxy: fix race issue
Proxy server might receive input updates while client side being
redirected (and reset), then a heap-after-free might occur. To solve
this, we register server input/update callbacks only after client is
fully activated.
2020-07-06 09:14:44 +02:00
Kobi Mizrachi
6e1581443b server: proxy: rename SessionCapture.Enabled -> GFXSettings.DecodeGFX 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
564b784ebc server: proxy: do not start client if post connect hook failed 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
0bf225ec60 server: proxy: capture: send sid in SessionInfo 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
181f2ba846 server: proxy: remove unused struct members 2020-06-22 12:37:53 +02:00
Kubistika
0cf764f170 server: proxy: cap plugin: fix var and func declaration 2020-06-05 09:22:26 +02:00
Kobi Mizrachi
19809bf338 server: proxy: implement session capture plugin 2020-06-05 09:22:26 +02:00
Kobi Mizrachi
44c50ff1d5 server: proxy: remove old session capture code 2020-06-05 09:22:26 +02:00
Kobi Mizrachi
6269243091 server: proxy: print server host ip on new conn (for clustering info) 2020-05-20 10:36:42 +03:00
Kobi Mizrachi
7d48a587d2 server: proxy: prepare for exporting gfx capture to a module 2020-05-20 10:31:51 +03:00
Kobi Mizrachi
715c3f293a server: proxy: vc hook: check if proxy client is not null 2020-05-19 14:43:30 +03:00
Kobi Mizrachi
215e41b4ee server: proxy: config: fix comma separated list parsing 2020-05-19 14:42:59 +03:00
Kobi Mizrachi
9de59051f6 server: proxy: refactor 2020-05-19 14:42:26 +03:00
Kobi Mizrachi
d28ad95fbe server: proxy: use peer load balance info when host is fetched from config 2020-05-12 12:43:08 +02:00
Kobi Mizrachi
de0802a352 server: proxy: Register signal handler after modules finished loading.
This prevents a race where the signal handler free's structs that
modules use while initializing.
2020-05-11 09:11:29 +02:00
Kobi Mizrachi
00c25eada0 server: proxy: print version and buildconfig on startup 2020-05-11 09:11:29 +02:00
akallabeth
cbee45aace Fixed clipboard 'called with invalid type' warning 2020-05-06 13:31:57 +02:00
Armin Novak
24bd601f8d Fixed data type warnings 2020-04-11 09:43:14 +02:00
Kobi Mizrachi
3b673be378 server: proxy: fix wrong log level used in pf_modules_run_filter 2020-03-12 08:36:05 +01:00
Kobi Mizrachi
1484d0ac48 server: proxy: removed unnecessary cast after #5955 2020-03-12 08:36:05 +01:00
Kobi Mizrachi
73445e1462 server: proxy: use config path from argv if provided 2020-03-12 08:36:05 +01:00
Armin Novak
3ba66db99d Unify pReceiveChannelData and psPeerReceiveChannelData
Fix definitions of the two function pointers.
Use and definition did not match, fix that.
Will create warnings in external projects
2020-03-10 12:21:14 +01:00
Armin Novak
d5b5088eac Fixed misinterpretation of SendChannelData
SendChannelData was defined with a return value of type int, but
used as BOOL everywhere. Fix the definition to match use.
2020-03-10 12:21:14 +01:00
Armin Novak
cffbbacccd Default proxy modules to OFF
The proxy module sample is c++ 11 which some older build targets
do not like. Deactivate this by default.
2020-03-09 09:16:41 +01:00
Armin Novak
a6d0b67ca6 Set C++ standard for proxy demo target 2020-03-09 09:03:19 +01:00
Armin Novak
d7ba252cd7 Fixed arguments for peer->ReceiveChannelData 2020-03-04 14:52:19 +01:00
Armin Novak
0f729d2b2c Fixed conversion and return checks.
* Fix some missing argument checks for function pointer implementations
* Fix broken return value check for client->SendChannelData
* Updated const correctness for function pointer implementations
2020-03-04 14:44:03 +01:00
Armin Novak
829497b313 Made CHANNEL_TSMF optional and deprecated. 2020-02-26 13:56:43 +01:00
Kobi Mizrachi
b574876986 server: proxy: client: change ClientFree->ContextFree 2020-02-26 11:47:01 +01:00
Kobi Mizrachi
079871ac65 server: proxy: support static vc passthrough 2020-02-26 11:47:01 +01:00
Armin Novak
436b68e416 Fixed #5895: cast warnings. 2020-02-19 10:21:43 +01:00
Martin Fleisz
e304428a5f
Merge pull request #5857 from akallabeth/scanbuild_fixes
Scanbuild fixes
2020-02-12 10:16:54 +01:00
Kobi Mizrachi
4823f41274 server: proxy: improve logs 2020-02-10 09:37:54 +01:00
Kobi Mizrachi
8c8e5e4239 server: proxy: show indicative log on bind failure. 2020-01-27 07:57:45 +01:00
Armin Novak
5ba7061a18 Fixed type of index variables. 2020-01-23 10:12:12 +01:00
Armin Novak
d67cea9b1a Fixed NULL dereference. 2020-01-23 10:09:23 +01:00
Kobi Mizrachi
18be45eca1 server: proxy: specify which modules to load in config 2020-01-22 14:18:21 +01:00
Kobi Mizrachi
6d3f658983 server: proxy: add an indicative log listener->Open fails. fixes #5850 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
c0cc676a4e server: proxy: pf_client.c: remove unused includes 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
92c3f76809 server: proxy: disconnect all active sessions on shutdown 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
424e73a895 server: proxy: modules_init: create modules dir if not exists 2020-01-21 11:43:13 +01:00
Kobi Mizrachi
9d82f5305a server: proxy: update config.ini 2020-01-21 11:43:13 +01:00
Kobi Mizrachi
ab3a096353 server: proxy: fix race condition when between client thread and server update thread 2020-01-15 11:23:14 +02:00
Kobi Mizrachi
15909af766 server: proxy: fix pf_modules_init 2020-01-14 10:40:49 +01:00
David Fort
0cc3af2282
Merge pull request #5796 from akallabeth/rdp_10_7_large_pointers
Added RDP 10.7 large pointer support
2020-01-14 10:17:13 +01:00
Kobi Mizrachi
e3728c1822 server: proxy: do not compile modules by default 2020-01-14 07:58:47 +01:00
Kobi Mizrachi
706e13c312 server: proxy: shutdown gracefully 2020-01-14 07:58:47 +01:00
Kobi Mizrachi
b2fad50cd3 server: proxy: rewrite modules API
* Add support for C++ plugins.
* Seperate between a "module" and a "plugin": a module is a shared
library that exposes a function called "proxy_module_entry_point". This
function gets a parameter to `proxyPluginsManager*`, which can be used to
register plugins.
* Refine the API of the modules infrastructure:
 * use proxyData* instead of rdpContext* when firing a hook or calling a filter.
 * use clearer names.
* Instead of having to specify a path for each module to be loaded in
the configuration, the proxy now loads modules from specificed
directory, using the CMAKE variable PROXY_PLUGINDIR.
* Add an option to specify required plugins: plugins that the proxy
wouldn't start without having them fully loaded.
2020-01-14 07:58:47 +01:00
Kobi Mizrachi
29dee84a2b rail/server: rename rdpContext to rdpcontext
Fixes a compilation error when mixing c++ and c code.
2020-01-14 07:58:47 +01:00
Kobi Mizrachi
47ca28b5c3 server: proxy: fix leak in pf_context_copy_settings 2020-01-13 13:41:44 +01:00
Kobi Mizrachi
ca2e578acc server: proxy: add a unique id to each session and improve logs 2020-01-08 11:59:34 +01:00
Kobi Mizrachi
ab3a72f825 server: proxy: move peer initialization to seperate function 2020-01-08 11:59:34 +01:00
Kobi Mizrachi
77ca7ac2ad server: proxy: make fallback to tls configurable 2020-01-08 07:58:03 +01:00
Armin Novak
182d0ce548 Added RDP 10.7 large pointer support
* Implements [MS-RDPBCGR] version 51 large pointer support.
* Logs unknown large pointer capability flags as warning.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2019-12-19 09:53:40 +01:00
Kobi Mizrachi
2e1d719ab1 server: proxy: proxy keyboard leds and imei 2019-12-17 15:33:11 +01:00
Mati Shabtay
97606edeee proxy: Implement RAIL support in proxy 2019-12-12 11:10:44 +01:00
kubistika
09648834a0 server: proxy: fix sync issue in gfx opening 2019-11-12 12:45:01 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Martin Fleisz
5b6663fe3a
Merge pull request #5689 from akallabeth/cleanups
Cleanups
2019-11-05 15:28:02 +01:00
akallabeth
acad36465d Fix #5693: Add missing link to gfx client channel library 2019-11-02 09:57:03 +01:00
kubistika
59ba044ccd server: proxy: client: always do NLA fallback 2019-10-31 11:26:13 +02:00
Armin Novak
f01e042211 Code cleanups (strlen, casts, size_t, ...) 2019-10-29 11:58:43 +01:00
kubistika
d5245e1263 server: proxy: export config utils functions to be used by modules 2019-10-28 13:31:10 +01:00
kubistika
160446e093 server: proxy: stop loading session captures config if it is disabled 2019-10-28 13:31:10 +01:00
kubistika
ab2b288f87 server: proxy: refactor config loader 2019-10-24 12:57:48 +02:00
kubistika
d92485899d server: proxy: capture: refactor path creation 2019-10-24 12:19:31 +02:00
kubistika
c723980a2f server: proxy: add python script to create a video from session frames 2019-10-24 12:19:31 +02:00
kubistika
16d4d46da6 server: proxy: implement session capture feature 2019-10-24 12:19:31 +02:00
kubistika
5e09ac9a7a server: proxy: client use PIXEL_FORMAT_BGRA32 (easier to write frames to bitmap) 2019-10-24 12:19:31 +02:00
kubistika
40463bb2f2 server: proxy: client: terminate the connection if pre connect hook fails 2019-10-22 10:16:17 +02:00
Armin Novak
59b4988f56 Fixed compilation warnings. 2019-10-16 14:54:05 +02:00
kubistika
f4d169fb75 server: proxy: register input and update callbacks in post connect
To avoid a race in which the server received an input event before
proxy's client is initialized, we now only register input and update
callbacks after client is initialized and safe to use.
2019-09-30 10:08:28 +02:00
kubistika
4d175f6008 server: proxy: refactor pf_context_create_client_context 2019-09-30 10:08:28 +02:00
kubistika
b6730ea31e server: proxy: support auto reconnect 2019-09-30 10:08:28 +02:00
kubistika
32913850d5 server: proxy: separate client and server security settings 2019-09-30 10:07:43 +02:00
kubistika
53a92421b1 server: proxy: config: fix mem leak 2019-09-11 14:29:04 +03:00
kubistika
867843eef7 server: proxy: client: only try NLA if credentials available 2019-09-10 10:11:00 +03:00
kubistika
a87065ed67 server: proxy: get rid of unnecessary casts 2019-09-09 17:42:18 +03:00
kubistika
0b340b784c server: proxy: drop local unix socket listen option 2019-09-09 17:42:18 +03:00
kubistika
8a75e8f54e server: proxy: refactor 2019-09-09 17:42:18 +03:00
kubistika
f5d32f4617 server: proxy: refactor usage of pf_context_copy_settings 2019-09-09 17:35:07 +03:00
kubistika
7ed39ce724 server: proxy: make sure module's pre connect only called once 2019-09-08 15:08:15 +03:00
kubistika
8cf8da3e41 server: proxy: config: remove duplicate declaration of config macros 2019-09-08 15:06:22 +03:00
Martin Fleisz
c90b7a9714
Merge pull request #5563 from akallabeth/scanbuild_fixes
Scanbuild fixes
2019-09-03 10:57:24 +02:00
kubistika
62b32fbab9 server: proxy: only wait for server dynvc when needed 2019-09-03 09:09:27 +02:00
Armin Novak
4ff24d074b Fixed memory leak in error branch 2019-09-03 08:56:36 +02:00
kubistika
e135106731 server: proxy: rdpsnd support 2019-08-29 14:39:17 +02:00
kubistika
dc11bcc9f0 server: proxy: fix nla fallback (introuduced in #5522) 2019-08-28 17:03:40 +02:00
kubistika
067b7dfd1c server: proxy: disp: fix copyright 2019-08-23 11:58:08 +02:00
kubistika
04e1708df1 server: proxy: use new hooks api 2019-08-23 11:58:08 +02:00
kubistika
32fff644da server: proxy: improve modules api 2019-08-23 11:58:08 +02:00
kubistika
d1c5862f54 server: proxy: sync cliprdr opening 2019-08-19 17:03:13 +02:00
kubistika
0ad87d98ca server: proxy: load proxy clipboard config 2019-08-19 09:30:40 +02:00
kubistika
7dc70b86d6 server: proxy: cliprdr support 2019-08-19 09:30:40 +02:00
kubistika
ef306fbff6 server: proxy: pf_context.c: Fix nla crash
Because the proxy uses freerdp_settings_copy to do re-negotiation after
first connection to remote server, all redirection information
(RedirectionPassword, RedirectionDomain, etc.) pointers were duplicated
(to both client and server settings structs). Then, at disconnection, a
double-free occured.
2019-08-14 19:39:34 +02:00
kubistika
ddb811cbc8 server: proxy: client: before loading client addins, wait for serve's dynvc to be in ready state 2019-08-13 16:28:05 +02:00
kubistika
1da91444c0 server: proxy: client: set glyph support level to NONE 2019-08-13 16:28:05 +02:00
kubistika
cb833ed45c server: proxy: print configuration on startup 2019-08-05 11:01:31 +03:00
kubistika
595f23b8fe server: proxy: channels: only open allowed channels 2019-08-05 11:01:31 +03:00
kubistika
0b6864a273 server: proxy: filters: demo: log instead of dropping the connection 2019-08-05 11:01:31 +03:00
kubistika
c5e6e0ba31 server: proxy: filters: make sure filter_init is exported in filters compilation 2019-08-05 11:01:31 +03:00
kubistika
31cd7b844f server: proxy: refactor configuration loader 2019-08-05 10:54:07 +03:00
kubistika
3051a4b4b4 server: proxy: ensure client termination 2019-08-02 10:17:45 +02:00
kubistika
038c933f98 server: proxy: sync server and client channels
when disconnections/redirections occured, sometimes server/client
channels were not synced, meaning that for example the gfx server
received a message, then tried to use gfx client that was already freed.
2019-08-02 10:17:45 +02:00
kubistika
a9758a8c0c server: proxy: fix rdpgfx close race 2019-07-30 09:56:06 +02:00
kubistika
908d6ebe1e server: proxy: Add logs, call client->Close to send disconnection ultimatum 2019-07-16 16:20:06 +03:00
kubistika
d0065ee9a1 server: proxy: remove unnecessary function handle_client_disconnection 2019-07-16 16:20:06 +03:00
kubistika
b12ee3288c server: proxy: adjust log levels 2019-07-16 16:20:06 +03:00
kubistika
95851b25e7 server: proxy: set nla fallback flag flag only if NLASecurity is enabled 2019-07-16 16:20:06 +03:00
kubistika
e9e1c5d748 server: proxy: naming refactor 2019-07-16 16:20:06 +03:00
kubistika
70ca028453 server: proxy: remove unnecessary files 2019-07-16 16:12:12 +03:00
kubistika
1b4371ed22 server: proxy: use freerdp_settings_copy 2019-07-16 13:47:35 +02:00
kubistika
ab00d90f03 server: proxy: implement NLA fallback 2019-07-15 11:52:30 +02:00
kubistika
02a65b8867 Declare support for multimon in proxy server.
It was broken in the DISP PR.
2019-07-08 11:09:29 +03:00
kubistika
8954e1646b server/proxy: Add check after calling p_client_context_create 2019-06-26 14:25:07 +02:00
kubistika
8fbee28dd7 server/proxy: Logging and comments improvements 2019-06-26 14:25:07 +02:00
kubistika
fb3f7f3908 server/proxy: pf_update: Update ps->settings in DesktopResize 2019-06-26 14:25:07 +02:00
kubistika
74a66f6651 server/proxy: set ps->thread to NULL on disconnect
freerdp_abort_connect calls the proxy's client stop function,
that closes the thread handle. if it already closed by the server,
a segfault will occur because CloseHandle will try to access free()'ed
memory.
2019-06-26 14:25:07 +02:00
kubistika
8a115f2020 server/proxy: Refactor pdata_set_connection_info
Connection info must be set after the proxy's client connection
established, because if the client didn't provide credentials in .rdp
file, we don't know its username yet.
2019-06-26 14:25:07 +02:00
kubistika
98973dd0da server/proxy: pf_filters: Update filter_free to accept NULL 2019-06-26 14:25:07 +02:00
kubistika
f795fc2670 server/proxy: Fix race-condition
The client's `ClientStop` callback wasn't set, therefore calling
freerdp_client_stop wasn't really blocking until it has stopped, and a
race condition occured. Fixed by registring to `ClientStop` callback and
waiting for the client thread to finish.
2019-06-26 14:25:07 +02:00
kubistika
255fab201a server/proxy: Fix rdpgfx and events leak 2019-06-26 14:25:07 +02:00
kubistika
c0cece1064 server/proxy: Fix double-call to disconnect 2019-06-26 14:25:07 +02:00
David Fort
2da425aa03
Merge pull request #5424 from kubistika/rdpgfx
rdpgfx: CacheImportOffer implementation
2019-06-13 11:35:15 +02:00
David Fort
1f128b6142
Merge pull request #5423 from kubistika/feat/bitmap-auto-flag-calculate
rdpUpdate: add autoBitmapDataCalculate
2019-06-12 21:15:59 +02:00
Kobi
d9366df448 RDPEDISP server side implementation (#5414)
* libfreerdp: Add RDPEDISP server implementation

* server/proxy: Add RDPEDISP support
2019-06-11 16:13:42 +02:00
kubistika
896ba119d1 server/proxy: Proxy CacheImportOffer & QoeFrameAck 2019-06-06 07:53:34 +03:00
kubistika
c8b38fb66e server/proxy: Fix bitmap update crash when target is win7 2019-06-04 17:33:48 +03:00
David Fort
5d1fc68629
Merge pull request #5405 from m4ntis/proxy/filters-api
Proxy: Filters API
2019-06-03 15:45:24 +02:00
kubistika
6224109a1d server/proxy: Add multimon support 2019-06-03 14:33:15 +03:00
kubistika
cd135ceacb libfreerdp/core: Export monitor layout PDU
* Move update notification related functions to new display.c: Not
related to `rdp.c`.
    * Rename `rdp_write_monitor_layout_pdu` to `display_write_monitor_layout_pdu`.
* Add internal `display_convert_rdp_monitor_to_monitor_def` instead of
doing the conversion inside `display_write_monitor_layout_pdu`.
2019-06-03 14:30:17 +03:00
kubistika
340d877cce server/proxy: Proxy pointer updates
* Moved update callbacks of client to pf_update.h
2019-05-29 10:06:18 +03:00
kubistika
72952c679f fix vs2010 errors 2019-05-28 09:30:39 +03:00
kubistika
52e4baa949 server/proxy: Code refactor 2019-05-28 09:30:38 +03:00
kubistika
aa262d341d server/proxy: Use winpr library in proxy/filters 2019-05-26 15:32:49 +03:00
kubistika
7477ac19a7 server/proxy: Fix free invalid memory when pf_server_parse_target_from_routing_token fails 2019-05-26 10:48:10 +03:00
kubistika
76012fb5d6 server/proxy: Fix mem leak in pf_server_parse_target_from_routing_token 2019-05-26 10:48:10 +03:00
kubistika
20e503421e server/proxy: Remove unnecessary wrap for connection info 2019-05-26 10:48:10 +03:00
kubistika
2126024321 server/proxy: Add docs in filters_api.h 2019-05-26 10:48:10 +03:00
kubistika
8e642c9d00 server/proxy: Add return statement in demo_filter.c 2019-05-26 10:48:10 +03:00
kubistika
98f698cf2b Add README for filters API 2019-05-26 10:48:10 +03:00
kubistika
7237624b37 bugfix: segfault when calling an event which is not implemented by filter 2019-05-26 10:48:10 +03:00
kubistika
96616bb18c server/proxy: Use new parse_string_array_from_str implementation (using ArrayList) 2019-05-26 10:48:10 +03:00
kubistika
3a750810f7 server/proxy: Refactor pf_server.c 2019-05-26 10:48:10 +03:00
kubistika
c4d72c6ad2 server/proxy: Refactor pf_server_parse_target_from_routing_token 2019-05-26 10:48:10 +03:00
kubistika
a39658fc2a server/proxy: Add external filters support 2019-05-26 10:48:10 +03:00
kubistika
6bb5a1d579 server/proxy: Proxy errors back to client 2019-05-19 14:42:27 +03:00
Mati Shabtay
b907324009 First version of an RDP proxy (#5372)
* server: Add proxy dir with barebones server

* sever/proxy: Remove licensing

* server/proxy: Add client files

* server/proxy: rm binary

* server/proxy: Formatting

* server/proxy: Fixed includes and added basic client creation functionality

* server/proxy: Remove licensing and fix ifndef

* proxy/server: Fix cmake indentation

* server/proxy: Fix licensing

* server/proxy: Forward connection on peer_post_connect

* server/proxy: Fix function signature

* server/proxy: Changed function signature of proxy_client_start

* server/proxy: Now peer_post_connect calls proxy_client_start in a new thread

* pfreerdp.c: Clean up useless comments and logs

* server/proxy: Fix license

* server/proxy: Remove all non-connection related data from proxy_context

* server/proxy: Move Log Tag definition to pf_log.h

* server/proxy: Move context definition to pf_context

* server/proxy: Delete pfreerdp.h

* pfreerdp.c: Move context callbacks to pf_context.c

* server/proxy: Update CMakeLists.txt

* pf_channels: Use new proxy context API

* pf_client: Move context to pf_context

* pf_client.c: Remove unnessecary event handling

* server/proxy: Formatting

* proxy/server: Move server logic to pf_server.c

* server/proxy: Handle client disconnection

* Merge stash

* pf_server.c: Open GFX Connection to client

* server: CMakeLists: build proxy along with other servers

* server: proxy: get target server from rdpNego->RoutingToken

Iv'e omitted a check from  which im not sure is right. Should check in docs

* server/proxy: Handle remote server -> client disconnection

* server/proxy: Move common function  to pf_common.c

* server/proxy: Move common function  to pf_common.c

* rdpgfx.h: Add reference to freerdp.h for rdpContext

* pf_channels: Pipe GFX on channel connection

* server/proxy: Add pf_rdpgfx for proxy gfx callbacks

* pf_client: Declare dynvc and gfx capabilities on connection

* server/proxy: Add graphics callbacks

* server/proxy: Add graphics callbacks

* pf_server: Listen to channel events

* Pass user settings to server

* pf_server: Proxy mouse events

* fixup! server/proxy: Add graphics callbacks

* pf_client: Fix setting initialization

* Merge feat/proxy-gfx to feat/proxy

* pf_server: Fix double freed credentials

* server/proxy: Remove unnecessary call to freerdp_client_settings_parse_command_line

* server/proxy: Refactor re-activation code

* server/proxy: Run format scripts

* server/proxy: Fix segfault when post_disconnect return FALSE

* server/proxy: Refactor proxy_settings_mirror

* server/proxy: Redirect credentials

* server/proxy: move proxy_settings_mirror to pf_common.c

* server/proxy: Redirect desktop_resize event

* pf_client: Remove interactive CLI auth methods

* fixup! server/proxy: Redirect credentials

* server/proxy: Rename proxy_mirror_settings to pf_common_copy_settings

* pf_server.c: Fixed non-freed context

When the disconnection is forced by the target server, the function
`pf_server_handle_client_disconnection` isn't called. Therefore, the
context of the connection between the proxy to tagrget isn't freed.

* fixup! pf_server.c: Fixed non-freed context

* pf_client: Prefix all client methods with pf_client

* pf_context: Add init client to proxy context method

* pf_server: Confirm all GFX caps regardless of settings

* pf_server: Prefix all methods with pf_server

* pf_server: Move variable decleration to start of method

* pf_server: Fix client setting

* pf_server: Fix GFX init method

* pf_server: Move variable decleration to start of methods

* server/proxy: Formatting

* Merge feat/proxy

* pf_server: Proxy synchronize event

* pf_server: Proxy refresh rect update events

* pf_server: Proxy suppress output messages

* server/proxy: Fix licensing

* server/proxy: Move client input callbacks to pf_input

* server/proxy: Move client update callbacks to pf_update

* server/proxy: Fix non-terminated target host string

* Feat/proxy config (#2)

* server/proxy: Add config loading support

* server/proxy: Add config file

* server/proxy: Format code

* server/proxy: Code refactor, rename update_register_callbacks and input_register_callbacks

* server/proxy: Update config file

* server/proxy: Remove config.ini from root directory

* Remove comment from config file

* server/proxy: Fix leak in pf_server_load_config

* server/proxy: Add rdpServerProxy struct and embed it in proxyContext

* server/proxy: Load configuration and pass it inside every proxyContext instance

* server/proxy: Move rdpProxyServer to proxy.h

* server/proxy: Use configuration while proxying input events

* server/proxy: Update CMakeLists

* server/proxy: Refactor pf_input.c

* server/proxy: Add AllowedChannels, DeniedChannels in configuration

* server/proxy: Remove unnecessary variable from parse_channels_from_str

* server/proxy: Update config file

* server/proxy: config: Rename  to

* server/proxy: config: Add mode - blacklist/whitelist

* server/proxy: Refactor, fix NULL deref

* server/proxy: Add license to proxy.h

* server/proxy: Fix newline in pf_config.c

* server/proxy: config: Rename Mode to WhitelistMode

* Add target in config. Add checks for configuration validity (#3)

* Add target in config. Add checks for configuration validity

* Update config file

* libfreerdp: nego: revert commented out check of routingToken length

* pf_server: Fix target host info from RoutingToken

* pf_server: Remove hardcoded lenght of routing token prefix

* Feat/refactor context (#8)

* Refactor main structs

* Update CMakeLists.txt

* pf_server.c: Free pdata at the end of the connection

* Run format scripts

* Rename tf to pc

* Fix licenses

* pf_server: Refactor names of structs and functions

* proxy: gfx: sync caps (#4)

* proxy: gfx: sync caps

* proxy: gfx: sync caps, hook gfx client's OnClose() call and close server resources

* fixup! Feat/refactor context (#8)

* fixup! fixup! Feat/refactor context (#8)

* rdpgfx/client: Fix rdpgfx_recv_caps_confirm_pdu caps set length parsing

* Run format scripts

* proxy config.ini: Change default port to 3389

* pf_rdpgfx: Limit caps version to freerdp's supported versions

* Gfx OnOpen() wait for dynvc ready (#10)

* proxy/gfx: Wait for dynvc ready state before open

* pf_channels: Initialize pc->gfx

* pf_rdpgfx: Add log and fix comments

* rdpgfx: Fix GFX v10.6 PDUs parsing and naming according to the spec

* pf_rdpgfx: Proxy rdpgfx v10.6 PDUs

* gfx client: Publish FrameAck sending and add auto ack flag

* proxy/gfx: Forward frame ack messages

* pf_context: Forward domain on connection

* pf_rdpgfx: Change max supported caps to 10.6

* proxy: Update config

* server/proxy: Use configuration in pf_server_handle_client

* rdpgfx/client: Fix size of surface_to_scaled_window, surface_to_window

* pf_rdpgfx: Fix formatting

* pf_server.c: Fix comments

* Move pf_server_rdpgfx_init to pf_rdpgfx

* server/proxy/CMakeLists.txt: Fix formatting

* pf_client.c: Add comment in proxy_server_reactivate

* Fixed const correctness of gfx function pointer

Signed-off-by: Mati Shabtay <matishabtay@gmail.com>

* server: proxy: update copyright

* server: proxy: wrap rdpNego and add a getter for routing token

* Refactor routing token getter (#14)

* Refactor routing token getter

* pf_server_parse_target_from_routing_token change routing_token_length to be DWORD

* libfreerdp/core/nego.c: Run format script

* pf_server: Run format script

* server/proxy: Fix os msbuild tests

* pf_channels.c: Remove unused channels

* pf_client: Remove unused callbacks

* proxy: Remove encomsp callbacks from proxy's client

* client/rdpgfx_main.c: Fix msbuild test

* pf_config.c: Use StrSep instead of strsep for Windows builds

* Removed nego struct from direct access.

Signed-off-by: Mati Shabtay <matishabtay@gmail.com>

* proxy: Rename binary to freerdp-proxy

* rdpgfx_main.c: Revert unwanted double change to send_supported_caps

* Cleaned up proxy server code.

* All internal functions static
* Added simple command line argument to supply a config file
* Silence compiler warnings

Signed-off-by: kubistika <kmizrachi18@gmail.com>
2019-05-17 14:32:54 +02:00