Commit Graph

82 Commits

Author SHA1 Message Date
akallabeth
90ce22283d Replaced direct settings access with getter/setter 2022-06-23 07:45:55 +02:00
akallabeth
f44554e16d
Added proxy module callbacks for session init and started (#7976) 2022-06-20 13:02:25 +02:00
David Fort
aff8fdac26 proxy: correctly handle dynamic channel fragmentation
This big patch fixes fragmentation handling in the dynamic channel. We used to
have a single state to handle fragmentation at the main dynamic channel level, but
in fact packets can be fragmented per sub channel. So we have to maintain a fragmentation
state per sub channel, this involve treating dynamic and static channels differentely
(so the size of the patch that has to implement state tracking per dynamic channels).
2022-06-17 08:38:57 +02:00
David Fort
cfe80694da proxy: add fixed user/domain/passwd
This adds a User, Domain and Password parameter in the Target section of the configuration
to specify and use a fixed backend user, domain or password (overriding the one
passed by the front user).
2022-06-15 14:05:45 +02:00
akallabeth
37d0a9e2b7 Assert function pointers in proxy 2022-04-15 12:13:03 +02:00
David Fort
63d0d3e4cf proxy: rework proxy channel treatments for statefull drdynvc
The rework introduce a stateful dynamic channel treatment, so that we can take early decisions
for data packet (dropping all the current packet or pass it), but also reassemble important
packets like channel creation.
2022-04-15 09:06:09 +02:00
akallabeth
14568872a9
Instance cleanup (#7738)
* Cleaned up freerdp::autodetect

* Deprecate freerdp::input

* Deprecated freerdp::update

* Deprecated freerdp::settings

* Deprecated freerdp::autodetect

* Removed rdpTransport::settings

* Deprecated freerdp_per::update|settings|autodetect

* Fixed mac client and server compilation

* Fixed windows compilation

* Added deprecation warnings

* Fixed initialization of structs.

* Fixed android build

* Fixed freerdp_client_context_new const correctness

* Fixed checks for android implementation

Replaced checks with assertions where appropriate

* Fixed checks for windows client

Replaced checks with assertions where appropriate

* Fixed proxy client pointer dereference
2022-03-23 13:18:35 +01:00
Armin Novak
4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak
b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
David Fort
46eb50df2c proxy: improve channel treatment
This PR introduces per channel context so that we can speed up operations like
retrieving the channel name from its id, or knowing what shall be done for a
packet (no config ACL recomputation at each packet).
2022-02-04 08:44:22 +00:00
Armin Novak
cefb4e1237 Use freerdp_settings_set and _strdup 2022-02-02 13:43:31 +00: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
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
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
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
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
4463e5eda9 Added config dump function, improved resource cleanup 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
Armin Novak
1fd72ded43 Fixed compilation warnings 2021-06-16 14:26:06 +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
akallabeth
6e3c00725a Cleaned up collections:
ArrayList, MessageQueue, Queue, PubSub, BipBuffer
ObjectPool and BufferPool
2020-11-06 12:30:13 +01: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
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
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
9de59051f6 server: proxy: refactor 2020-05-19 14:42:26 +03: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
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
Kobi Mizrachi
079871ac65 server: proxy: support static vc passthrough 2020-02-26 11:47:01 +01:00
Kobi Mizrachi
8c8e5e4239 server: proxy: show indicative log on bind failure. 2020-01-27 07:57:45 +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
92c3f76809 server: proxy: disconnect all active sessions on shutdown 2020-01-21 12:08:39 +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
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
Mati Shabtay
97606edeee proxy: Implement RAIL support in proxy 2019-12-12 11:10:44 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
f01e042211 Code cleanups (strlen, casts, size_t, ...) 2019-10-29 11:58:43 +01:00
kubistika
16d4d46da6 server: proxy: implement session capture feature 2019-10-24 12:19:31 +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