21 #include <winpr/assert.h>
22 #include <winpr/string.h>
23 #include <winpr/wtsapi.h>
25 #include <freerdp/server/proxy/proxy_log.h>
28 #define TAG PROXY_TAG("utils")
30 pf_utils_channel_mode pf_utils_get_channel_mode(
const proxyConfig* config,
const char* name)
32 pf_utils_channel_mode rc = PF_UTILS_CHANNEL_NOT_HANDLED;
38 for (
size_t i = 0; i < config->InterceptCount; i++)
40 const char* channel_name = config->Intercept[i];
41 if (strcmp(name, channel_name) == 0)
43 rc = PF_UTILS_CHANNEL_INTERCEPT;
48 for (
size_t i = 0; i < config->PassthroughCount; i++)
50 const char* channel_name = config->Passthrough[i];
51 if (strcmp(name, channel_name) == 0)
60 if (config->PassthroughIsBlacklist)
61 rc = PF_UTILS_CHANNEL_BLOCK;
63 rc = PF_UTILS_CHANNEL_PASSTHROUGH;
65 else if (config->PassthroughIsBlacklist)
66 rc = PF_UTILS_CHANNEL_PASSTHROUGH;
69 WLog_DBG(TAG,
"%s -> %s", name, pf_utils_channel_mode_string(rc));
73 BOOL pf_utils_is_passthrough(
const proxyConfig* config)
81 const char* pf_utils_channel_mode_string(pf_utils_channel_mode mode)
85 case PF_UTILS_CHANNEL_BLOCK:
87 case PF_UTILS_CHANNEL_PASSTHROUGH:
89 case PF_UTILS_CHANNEL_INTERCEPT:
91 case PF_UTILS_CHANNEL_NOT_HANDLED: