2021-08-24 13:50:13 +03:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* FreeRDP Proxy Server
|
|
|
|
*
|
|
|
|
* Copyright 2019 Kobi Mizrachi <kmizrachi18@gmail.com>
|
|
|
|
* Copyright 2019 Idan Freiberg <speidy@gmail.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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FREERDP_SERVER_PROXY_MODULES_H
|
|
|
|
#define FREERDP_SERVER_PROXY_MODULES_H
|
|
|
|
|
|
|
|
#include <winpr/wtypes.h>
|
|
|
|
#include <winpr/collections.h>
|
|
|
|
|
|
|
|
#include <freerdp/server/proxy/proxy_modules_api.h>
|
|
|
|
|
2022-02-14 16:59:22 +03:00
|
|
|
typedef enum
|
2021-08-24 13:50:13 +03:00
|
|
|
{
|
|
|
|
FILTER_TYPE_KEYBOARD, /* proxyKeyboardEventInfo */
|
2022-11-06 09:19:53 +03:00
|
|
|
FILTER_TYPE_UNICODE, /* proxyUnicodeEventInfo */
|
2021-08-24 13:50:13 +03:00
|
|
|
FILTER_TYPE_MOUSE, /* proxyMouseEventInfo */
|
2022-11-06 09:19:53 +03:00
|
|
|
FILTER_TYPE_MOUSE_EX, /* proxyMouseExEventInfo */
|
2021-08-24 13:50:13 +03:00
|
|
|
FILTER_TYPE_CLIENT_PASSTHROUGH_CHANNEL_DATA, /* proxyChannelDataEventInfo */
|
|
|
|
FILTER_TYPE_SERVER_PASSTHROUGH_CHANNEL_DATA, /* proxyChannelDataEventInfo */
|
|
|
|
FILTER_TYPE_CLIENT_PASSTHROUGH_DYN_CHANNEL_CREATE, /* proxyChannelDataEventInfo */
|
|
|
|
FILTER_TYPE_SERVER_FETCH_TARGET_ADDR, /* proxyFetchTargetEventInfo */
|
|
|
|
FILTER_TYPE_SERVER_PEER_LOGON, /* proxyServerPeerLogon */
|
2021-09-23 15:52:03 +03:00
|
|
|
FILTER_TYPE_CLIENT_PASSTHROUGH_CHANNEL_CREATE, /* proxyChannelDataEventInfo */
|
2021-08-24 13:50:13 +03:00
|
|
|
|
2023-01-12 12:39:48 +03:00
|
|
|
FILTER_TYPE_STATIC_INTERCEPT_LIST, /* proxyChannelToInterceptData */
|
|
|
|
FILTER_TYPE_DYN_INTERCEPT_LIST, /* proxyChannelToInterceptData */
|
|
|
|
FILTER_TYPE_INTERCEPT_CHANNEL, /* proxyDynChannelInterceptData */
|
2021-08-24 13:50:13 +03:00
|
|
|
FILTER_LAST
|
2022-02-14 16:59:22 +03:00
|
|
|
} PF_FILTER_TYPE;
|
2021-08-24 13:50:13 +03:00
|
|
|
|
2022-02-14 16:59:22 +03:00
|
|
|
typedef enum
|
2021-08-24 13:50:13 +03:00
|
|
|
{
|
|
|
|
HOOK_TYPE_CLIENT_INIT_CONNECT,
|
|
|
|
HOOK_TYPE_CLIENT_UNINIT_CONNECT,
|
|
|
|
HOOK_TYPE_CLIENT_PRE_CONNECT,
|
|
|
|
HOOK_TYPE_CLIENT_POST_CONNECT,
|
|
|
|
HOOK_TYPE_CLIENT_POST_DISCONNECT,
|
2021-12-14 15:02:29 +03:00
|
|
|
HOOK_TYPE_CLIENT_REDIRECT,
|
2021-08-24 13:50:13 +03:00
|
|
|
HOOK_TYPE_CLIENT_VERIFY_X509,
|
|
|
|
HOOK_TYPE_CLIENT_LOGIN_FAILURE,
|
|
|
|
HOOK_TYPE_CLIENT_END_PAINT,
|
2022-06-22 13:17:44 +03:00
|
|
|
HOOK_TYPE_CLIENT_LOAD_CHANNELS,
|
2021-08-24 13:50:13 +03:00
|
|
|
|
|
|
|
HOOK_TYPE_SERVER_POST_CONNECT,
|
|
|
|
HOOK_TYPE_SERVER_ACTIVATE,
|
|
|
|
HOOK_TYPE_SERVER_CHANNELS_INIT,
|
|
|
|
HOOK_TYPE_SERVER_CHANNELS_FREE,
|
|
|
|
HOOK_TYPE_SERVER_SESSION_END,
|
2022-06-20 14:02:25 +03:00
|
|
|
HOOK_TYPE_SERVER_SESSION_INITIALIZE,
|
|
|
|
HOOK_TYPE_SERVER_SESSION_STARTED,
|
2021-08-24 13:50:13 +03:00
|
|
|
|
|
|
|
HOOK_LAST
|
2022-02-14 16:59:22 +03:00
|
|
|
} PF_HOOK_TYPE;
|
2021-08-24 13:50:13 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
proxyModule* pf_modules_new(const char* root_dir, const char** modules, size_t count);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief pf_modules_add Registers a new plugin
|
|
|
|
* @param ep A module entry point function, must NOT be NULL
|
|
|
|
* @return TRUE for success, FALSE otherwise
|
|
|
|
*/
|
|
|
|
BOOL pf_modules_add(proxyModule* module, proxyModuleEntryPoint ep, void* userdata);
|
|
|
|
|
|
|
|
BOOL pf_modules_is_plugin_loaded(proxyModule* module, const char* plugin_name);
|
|
|
|
void pf_modules_list_loaded_plugins(proxyModule* module);
|
|
|
|
|
|
|
|
BOOL pf_modules_run_filter(proxyModule* module, PF_FILTER_TYPE type, proxyData* pdata,
|
|
|
|
void* param);
|
|
|
|
BOOL pf_modules_run_hook(proxyModule* module, PF_HOOK_TYPE type, proxyData* pdata,
|
|
|
|
void* custom);
|
|
|
|
|
|
|
|
void pf_modules_free(proxyModule* module);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* FREERDP_SERVER_PROXY_MODULES_H */
|