summaryrefslogtreecommitdiff
path: root/src/rdp/rdp_impl.h
diff options
context:
space:
mode:
authorsss <sss@dark-alexandr.net>2023-01-17 00:38:19 +0300
committersss <sss@dark-alexandr.net>2023-01-17 00:38:19 +0300
commitcc3f33db7a8d3c4ad373e646b199808e01bc5d9b (patch)
treeec09d690c7656ab5f2cc72607e05fb359c24d8b2 /src/rdp/rdp_impl.h
added webrdp public code
Diffstat (limited to 'src/rdp/rdp_impl.h')
-rw-r--r--src/rdp/rdp_impl.h127
1 files changed, 127 insertions, 0 deletions
diff --git a/src/rdp/rdp_impl.h b/src/rdp/rdp_impl.h
new file mode 100644
index 0000000..0e561ed
--- /dev/null
+++ b/src/rdp/rdp_impl.h
@@ -0,0 +1,127 @@
+/* BSD-2-Clause license
+ *
+ * Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>.
+ *
+ */
+
+#pragma once
+
+#include <ev.h>
+
+#include <freerdp/freerdp.h>
+#include <winpr/clipboard.h>
+#include <freerdp/client/cliprdr.h>
+
+#define CLRCONV_ALPHA 1
+#define CLRCONV_INVERT 2
+/* if defined RGB555 format is used when rendering with a 16-bit frame buffer
+ */
+#define CLRCONV_RGB555 4
+/* Supported Internal Buffer Formats */
+#define CLRBUF_16BPP 8
+#define CLRBUF_32BPP 32
+
+struct _CLRCONV
+{
+ int alpha;
+ int invert;
+ int rgb555;
+ rdpPalette *palette;
+};
+typedef struct _CLRCONV CLRCONV;
+typedef CLRCONV *HCLRCONV;
+
+/* #define TAG CLIENT_TAG ("RDP")*/
+
+typedef struct
+{
+ /* TODO: make variables list instead of static set */
+ backend_setting_str host, pcb, user, password,
+ /* new settings from freerdp header:*/
+ Domain, PasswordHash, AcceptedCert, ClientHostname, ClientProductId,
+ AlternateShell, ShellWorkingDirectory, ClientAddress, ClientDir,
+ DynamicDSTTimeZoneKeyName, RemoteAssistanceSessionId,
+ RemoteAssistancePassStub, RemoteAssistancePassword,
+ RemoteAssistanceRCTicket, AuthenticationServiceClass,
+ AllowedTlsCiphers, NtlmSamFile, PreconnectionBlob,
+ RedirectionAcceptedCert, KerberosKdc, KerberosRealm,
+ CertificateName, CertificateFile, PrivateKeyFile,
+ CertificateContent, PrivateKeyContent, WindowTitle, WmClass,
+ ComputerName, ConnectionFile, AssistanceFile, HomePath, ConfigPath,
+ CurrentPath, DumpRemoteFxFile, PlayRemoteFxFile, GatewayHostname,
+ GatewayUsername, GatewayPassword, GatewayDomain, GatewayAccessToken,
+ GatewayAcceptedCert, ProxyHostname, RemoteApplicationName,
+ RemoteApplicationIcon, RemoteApplicationProgram,
+ RemoteApplicationFile, RemoteApplicationGuid,
+ RemoteApplicationCmdLine, ImeFileName, DrivesToRedirect,
+ ActionScript;
+ backend_setting_int port, perf, fntlm, nowallp, nowdrag, nomani,
+ notheme, nonla, notls, width, height,
+ /* new settings from freerdp header:*/
+ ServerMode, WaitForOutputBufferFlush, MaxTimeInCheckLoop,
+ DesktopWidth, DesktopHeight, Workarea, Fullscreen, GrabKeyboard,
+ Decorations, RdpVersion, ColorDepth, ExtSecurity, NlaSecurity,
+ TlsSecurity, RdpSecurity, NegotiateSecurityLayer,
+ RestrictedAdminModeRequired, MstscCookieMode, CookieMaxLength,
+ ClientBuild, KeyboardType, KeyboardSubType, KeyboardFunctionKey,
+ KeyboardLayout, UseRdpSecurityLayer, SaltedChecksum, ServerPort,
+ GatewayPort, DesktopResize, ToggleFullscreen, Floatbar, DesktopPosX,
+ DesktopPosY, SoftwareGdi, UnmapButtons, PerformanceFlags,
+ AllowFontSmoothing, AllowDesktopComposition, DisableWallpaper,
+ DisableFullWindowDrag, DisableMenuAnims, DisableThemes,
+ ConnectionType, EncryptionMethods, EncryptionLevel, FIPSMode,
+ CompressionEnabled, LogonNotify, BrushSupportLevel,
+ RemoteApplicationMode, TcpAckTimeout;
+} my_rdp_settings;
+
+typedef struct
+{
+ rdpPointer pointer;
+ uint32_t id;
+} my_rdp_pointer;
+
+struct rdp_internals_s;
+typedef struct rdp_internals_s rdp_internals;
+
+struct my_rdp_clipboard_s;
+typedef struct my_rdp_clipboard_s my_rdp_clipboard;
+
+struct my_rdp_ft_s;
+typedef struct my_rdp_ft_s my_rdp_ft;
+
+typedef struct
+{
+ rdpContext context;
+ my_rdp_clipboard *clipboard;
+ my_rdp_ft *ft_to_client, *ft_to_server;
+ rdp_internals *my_internals;
+} my_rdp_context;
+
+struct rdp_internals_s
+{
+ freerdp *instance;
+ my_rdp_context *context;
+
+ rdpSettings *settings;
+
+ void *task_info;
+ wrdp_core_exports *core;
+ wrdp_backend_module *backend;
+
+ my_rdp_settings my_settings;
+ rdp_connection_state conn_state;
+
+ /* libev watchers */
+ /* TODO: dynamic allocation */
+ ev_io rdp_fd[32];
+ int rdp_fd_count;
+
+ HCLRCONV clrconv;
+ uint32_t m_ptrId;
+};
+
+bool rdp_init_internals(void *internals);
+
+bool rdp_connect(void *internals);
+
+bool rdp_init_settings(void *internals);