mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-23 09:54:26 +08:00
libfreerdp-channels: rename from libfreerdp-chanman
This commit is contained in:
parent
23c1f3f75f
commit
0549380c28
@ -157,7 +157,7 @@ add_subdirectory(libfreerdp-gdi)
|
||||
add_subdirectory(libfreerdp-rail)
|
||||
add_subdirectory(libfreerdp-cache)
|
||||
add_subdirectory(libfreerdp-codec)
|
||||
add_subdirectory(libfreerdp-chanman)
|
||||
add_subdirectory(libfreerdp-channels)
|
||||
add_subdirectory(libfreerdp-core)
|
||||
|
||||
if(NOT WIN32)
|
||||
|
@ -28,7 +28,7 @@ add_executable(dfreerdp
|
||||
target_link_libraries(dfreerdp freerdp-core)
|
||||
target_link_libraries(dfreerdp freerdp-gdi)
|
||||
target_link_libraries(dfreerdp freerdp-kbd)
|
||||
target_link_libraries(dfreerdp freerdp-chanman)
|
||||
target_link_libraries(dfreerdp freerdp-channels)
|
||||
target_link_libraries(dfreerdp freerdp-utils)
|
||||
target_link_libraries(dfreerdp ${DIRECTFB_LIBRARIES})
|
||||
|
||||
|
@ -46,7 +46,7 @@ void df_context_size(freerdp* instance, uint32* size)
|
||||
|
||||
void df_context_new(freerdp* instance, dfContext* context)
|
||||
{
|
||||
context->chanman = freerdp_chanman_new();
|
||||
context->channels = freerdp_channels_new();
|
||||
}
|
||||
|
||||
void df_context_free(freerdp* instance, dfContext* context)
|
||||
@ -148,7 +148,7 @@ boolean df_pre_connect(freerdp* instance)
|
||||
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
|
||||
settings->order_support[NEG_ELLIPSE_CB_INDEX] = False;
|
||||
|
||||
freerdp_chanman_pre_connect(context->chanman, instance);
|
||||
freerdp_channels_pre_connect(context->channels, instance);
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -201,7 +201,7 @@ boolean df_post_connect(freerdp* instance)
|
||||
|
||||
df_keyboard_init();
|
||||
|
||||
freerdp_chanman_post_connect(context->chanman, instance);
|
||||
freerdp_channels_post_connect(context->channels, instance);
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -209,10 +209,10 @@ boolean df_post_connect(freerdp* instance)
|
||||
static int df_process_plugin_args(rdpSettings* settings, const char* name,
|
||||
RDP_PLUGIN_DATA* plugin_data, void* user_data)
|
||||
{
|
||||
rdpChanMan* chanman = (rdpChanMan*) user_data;
|
||||
rdpChannels* chanman = (rdpChannels*) user_data;
|
||||
|
||||
printf("loading plugin %s\n", name);
|
||||
freerdp_chanman_load_plugin(chanman, settings, name, plugin_data);
|
||||
freerdp_channels_load_plugin(chanman, settings, name, plugin_data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -220,11 +220,11 @@ static int df_process_plugin_args(rdpSettings* settings, const char* name,
|
||||
static int
|
||||
df_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
|
||||
{
|
||||
return freerdp_chanman_data(instance, channelId, data, size, flags, total_size);
|
||||
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
|
||||
}
|
||||
|
||||
static void
|
||||
df_process_cb_sync_event(rdpChanMan* chanman, freerdp* instance)
|
||||
df_process_cb_sync_event(rdpChannels* chanman, freerdp* instance)
|
||||
{
|
||||
RDP_EVENT* event;
|
||||
RDP_CB_FORMAT_LIST_EVENT* format_list_event;
|
||||
@ -234,15 +234,15 @@ df_process_cb_sync_event(rdpChanMan* chanman, freerdp* instance)
|
||||
format_list_event = (RDP_CB_FORMAT_LIST_EVENT*)event;
|
||||
format_list_event->num_formats = 0;
|
||||
|
||||
freerdp_chanman_send_event(chanman, event);
|
||||
freerdp_channels_send_event(chanman, event);
|
||||
}
|
||||
|
||||
static void
|
||||
df_process_channel_event(rdpChanMan* chanman, freerdp* instance)
|
||||
df_process_channel_event(rdpChannels* chanman, freerdp* instance)
|
||||
{
|
||||
RDP_EVENT* event;
|
||||
|
||||
event = freerdp_chanman_pop_event(chanman);
|
||||
event = freerdp_channels_pop_event(chanman);
|
||||
|
||||
if (event)
|
||||
{
|
||||
@ -279,7 +279,7 @@ int dfreerdp_run(freerdp* instance)
|
||||
fd_set wfds_set;
|
||||
dfInfo* dfi;
|
||||
dfContext* context;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
memset(rfds, 0, sizeof(rfds));
|
||||
memset(wfds, 0, sizeof(wfds));
|
||||
@ -290,7 +290,7 @@ int dfreerdp_run(freerdp* instance)
|
||||
context = (dfContext*) instance->context;
|
||||
|
||||
dfi = context->dfi;
|
||||
chanman = context->chanman;
|
||||
chanman = context->channels;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@ -302,7 +302,7 @@ int dfreerdp_run(freerdp* instance)
|
||||
printf("Failed to get FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
if (freerdp_channels_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
{
|
||||
printf("Failed to get channel manager file descriptor\n");
|
||||
break;
|
||||
@ -353,7 +353,7 @@ int dfreerdp_run(freerdp* instance)
|
||||
printf("Failed to check dfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_check_fds(chanman, instance) != True)
|
||||
if (freerdp_channels_check_fds(chanman, instance) != True)
|
||||
{
|
||||
printf("Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
@ -361,8 +361,8 @@ int dfreerdp_run(freerdp* instance)
|
||||
df_process_channel_event(chanman, instance);
|
||||
}
|
||||
|
||||
freerdp_chanman_close(chanman, instance);
|
||||
freerdp_chanman_free(chanman);
|
||||
freerdp_channels_close(chanman, instance);
|
||||
freerdp_channels_free(chanman);
|
||||
df_free(dfi);
|
||||
gdi_free(instance);
|
||||
instance->Disconnect(instance);
|
||||
@ -396,11 +396,11 @@ int main(int argc, char* argv[])
|
||||
freerdp* instance;
|
||||
dfContext* context;
|
||||
struct thread_data* data;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
|
||||
g_sem = freerdp_sem_new(1);
|
||||
|
||||
@ -415,7 +415,7 @@ int main(int argc, char* argv[])
|
||||
freerdp_context_new(instance);
|
||||
|
||||
context = (dfContext*) instance->context;
|
||||
chanman = context->chanman;
|
||||
chanman = context->channels;
|
||||
|
||||
DirectFBInit(&argc, &argv);
|
||||
freerdp_parse_args(instance->settings, argc, argv, df_process_plugin_args, chanman, NULL, NULL);
|
||||
@ -431,7 +431,7 @@ int main(int argc, char* argv[])
|
||||
freerdp_sem_wait(g_sem);
|
||||
}
|
||||
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <string.h>
|
||||
#include <directfb.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/gdi/gdi.h>
|
||||
|
||||
typedef struct df_info dfInfo;
|
||||
@ -35,7 +35,7 @@ struct df_context
|
||||
rdpContext _p;
|
||||
|
||||
dfInfo* dfi;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* channels;
|
||||
rdpSettings* settings;
|
||||
};
|
||||
typedef struct df_context dfContext;
|
||||
|
@ -252,7 +252,7 @@ boolean wf_pre_connect(freerdp* instance)
|
||||
}
|
||||
|
||||
settings->kbd_layout = (int) GetKeyboardLayout(0) & 0x0000FFFF;
|
||||
freerdp_chanman_pre_connect(GET_CHANMAN(instance), instance);
|
||||
freerdp_channels_pre_connect(GET_CHANMAN(instance), instance);
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -368,24 +368,24 @@ boolean wf_post_connect(freerdp* instance)
|
||||
wfi->cache->offscreen->SetSurface = (cbSetSurface) wf_set_surface;
|
||||
}
|
||||
|
||||
freerdp_chanman_post_connect(GET_CHANMAN(instance), instance);
|
||||
freerdp_channels_post_connect(GET_CHANMAN(instance), instance);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
int wf_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
|
||||
{
|
||||
return freerdp_chanman_data(instance, channelId, data, size, flags, total_size);
|
||||
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
|
||||
}
|
||||
|
||||
void wf_process_channel_event(rdpChanMan* chanman, freerdp* instance)
|
||||
void wf_process_channel_event(rdpChannels* chanman, freerdp* instance)
|
||||
{
|
||||
wfInfo* wfi;
|
||||
RDP_EVENT* event;
|
||||
|
||||
wfi = GET_WFI(instance);
|
||||
|
||||
event = freerdp_chanman_pop_event(chanman);
|
||||
event = freerdp_channels_pop_event(chanman);
|
||||
|
||||
if (event)
|
||||
freerdp_event_free(event);
|
||||
@ -405,10 +405,10 @@ boolean wf_check_fds(freerdp* instance)
|
||||
|
||||
int wf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data)
|
||||
{
|
||||
rdpChanMan* chanman = (rdpChanMan*) user_data;
|
||||
rdpChannels* chanman = (rdpChannels*) user_data;
|
||||
|
||||
printf("loading plugin %s\n", name);
|
||||
freerdp_chanman_load_plugin(chanman, settings, name, plugin_data);
|
||||
freerdp_channels_load_plugin(chanman, settings, name, plugin_data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -430,7 +430,7 @@ int wfreerdp_run(freerdp* instance)
|
||||
void* wfds[32];
|
||||
int fds_count;
|
||||
HANDLE fds[64];
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
memset(rfds, 0, sizeof(rfds));
|
||||
memset(wfds, 0, sizeof(wfds));
|
||||
@ -456,7 +456,7 @@ int wfreerdp_run(freerdp* instance)
|
||||
printf("Failed to get wfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
if (freerdp_channels_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
{
|
||||
printf("Failed to get channel manager file descriptor\n");
|
||||
break;
|
||||
@ -496,7 +496,7 @@ int wfreerdp_run(freerdp* instance)
|
||||
printf("Failed to check wfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_check_fds(chanman, instance) != True)
|
||||
if (freerdp_channels_check_fds(chanman, instance) != True)
|
||||
{
|
||||
printf("Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
@ -522,7 +522,7 @@ int wfreerdp_run(freerdp* instance)
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
freerdp_chanman_free(chanman);
|
||||
freerdp_channels_free(chanman);
|
||||
freerdp_free(instance);
|
||||
|
||||
return 0;
|
||||
@ -588,7 +588,7 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
thread_data* data;
|
||||
WSADATA wsa_data;
|
||||
WNDCLASSEX wnd_cls;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
if (WSAStartup(0x101, &wsa_data) != 0)
|
||||
return 1;
|
||||
@ -616,14 +616,14 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
RegisterClassEx(&wnd_cls);
|
||||
|
||||
g_hInstance = hInstance;
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
|
||||
instance = freerdp_new();
|
||||
instance->PreConnect = wf_pre_connect;
|
||||
instance->PostConnect = wf_post_connect;
|
||||
instance->ReceiveChannelData = wf_receive_channel_data;
|
||||
|
||||
chanman = freerdp_chanman_new();
|
||||
chanman = freerdp_channels_new();
|
||||
SET_CHANMAN(instance, chanman);
|
||||
|
||||
if (!CreateThread(NULL, 0, kbd_thread_func, NULL, 0, NULL))
|
||||
|
@ -87,7 +87,7 @@ target_link_libraries(xfreerdp freerdp-core)
|
||||
target_link_libraries(xfreerdp freerdp-gdi)
|
||||
target_link_libraries(xfreerdp freerdp-kbd)
|
||||
target_link_libraries(xfreerdp freerdp-rail)
|
||||
target_link_libraries(xfreerdp freerdp-chanman)
|
||||
target_link_libraries(xfreerdp freerdp-channels)
|
||||
target_link_libraries(xfreerdp freerdp-utils)
|
||||
target_link_libraries(xfreerdp ${X11_LIBRARIES} dl)
|
||||
|
||||
|
@ -37,7 +37,7 @@ struct clipboard_format_mapping
|
||||
typedef struct clipboard_context clipboardContext;
|
||||
struct clipboard_context
|
||||
{
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
Window root_window;
|
||||
Atom clipboard_atom;
|
||||
Atom property_atom;
|
||||
@ -69,7 +69,7 @@ struct clipboard_context
|
||||
int incr_data_length;
|
||||
};
|
||||
|
||||
void xf_cliprdr_init(xfInfo* xfi, rdpChanMan* chanman)
|
||||
void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman)
|
||||
{
|
||||
int n;
|
||||
uint32 id;
|
||||
@ -317,7 +317,7 @@ static void xf_cliprdr_send_raw_format_list(xfInfo* xfi)
|
||||
event->raw_format_data_size = len;
|
||||
XFree(format_data);
|
||||
|
||||
freerdp_chanman_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
freerdp_channels_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
}
|
||||
|
||||
static void xf_cliprdr_send_null_format_list(xfInfo* xfi)
|
||||
@ -330,7 +330,7 @@ static void xf_cliprdr_send_null_format_list(xfInfo* xfi)
|
||||
|
||||
event->num_formats = 0;
|
||||
|
||||
freerdp_chanman_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
freerdp_channels_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
}
|
||||
|
||||
static void xf_cliprdr_send_supported_format_list(xfInfo* xfi)
|
||||
@ -351,7 +351,7 @@ static void xf_cliprdr_send_supported_format_list(xfInfo* xfi)
|
||||
event->formats[i] = cb->format_mappings[i].format_id;
|
||||
}
|
||||
|
||||
freerdp_chanman_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
freerdp_channels_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
}
|
||||
|
||||
static void xf_cliprdr_send_format_list(xfInfo* xfi)
|
||||
@ -384,7 +384,7 @@ static void xf_cliprdr_send_data_request(xfInfo* xfi, uint32 format)
|
||||
RDP_EVENT_TYPE_CB_DATA_REQUEST, NULL, NULL);
|
||||
event->format = format;
|
||||
|
||||
freerdp_chanman_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
freerdp_channels_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
}
|
||||
|
||||
static void xf_cliprdr_send_data_response(xfInfo* xfi, uint8* data, int size)
|
||||
@ -397,7 +397,7 @@ static void xf_cliprdr_send_data_response(xfInfo* xfi, uint8* data, int size)
|
||||
event->data = data;
|
||||
event->size = size;
|
||||
|
||||
freerdp_chanman_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
freerdp_channels_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
}
|
||||
|
||||
static void xf_cliprdr_send_null_data_response(xfInfo* xfi)
|
||||
@ -494,7 +494,7 @@ static void xf_cliprdr_get_requested_targets(xfInfo* xfi)
|
||||
event->num_formats = num;
|
||||
XFree(data);
|
||||
|
||||
freerdp_chanman_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
freerdp_channels_send_event(cb->chanman, (RDP_EVENT*) event);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include "xfreerdp.h"
|
||||
|
||||
void xf_cliprdr_init(xfInfo* xfi, rdpChanMan* chanman);
|
||||
void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman);
|
||||
void xf_cliprdr_uninit(xfInfo* xfi);
|
||||
void xf_process_cliprdr_event(xfInfo* xfi, RDP_EVENT* event);
|
||||
boolean xf_cliprdr_process_selection_notify(xfInfo* xfi, XEvent* xevent);
|
||||
|
@ -195,7 +195,7 @@ static void xf_on_free_rail_client_event(RDP_EVENT* event)
|
||||
}
|
||||
}
|
||||
|
||||
static void xf_send_rail_client_event(rdpChanMan* chanman, uint16 event_type, void* param)
|
||||
static void xf_send_rail_client_event(rdpChannels* chanman, uint16 event_type, void* param)
|
||||
{
|
||||
RDP_EVENT* out_event = NULL;
|
||||
void * payload = NULL;
|
||||
@ -205,16 +205,16 @@ static void xf_send_rail_client_event(rdpChanMan* chanman, uint16 event_type, vo
|
||||
{
|
||||
out_event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, event_type,
|
||||
xf_on_free_rail_client_event, payload);
|
||||
freerdp_chanman_send_event(chanman, out_event);
|
||||
freerdp_channels_send_event(chanman, out_event);
|
||||
}
|
||||
}
|
||||
|
||||
void xf_rail_send_windowmove(xfInfo* xfi, uint32 windowId, uint32 left, uint32 top, uint32 right, uint32 bottom)
|
||||
{
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
RAIL_WINDOW_MOVE_ORDER window_move;
|
||||
|
||||
chanman = xfi->context->chanman;
|
||||
chanman = xfi->context->channels;
|
||||
|
||||
window_move.windowId = windowId;
|
||||
window_move.left = left;
|
||||
@ -228,11 +228,11 @@ void xf_rail_send_windowmove(xfInfo* xfi, uint32 windowId, uint32 left, uint32 t
|
||||
void xf_rail_send_activate(xfInfo* xfi, Window xwindow, boolean enabled)
|
||||
{
|
||||
rdpRail* rail;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
rdpWindow* rail_window;
|
||||
RAIL_ACTIVATE_ORDER activate;
|
||||
|
||||
chanman = xfi->context->chanman;
|
||||
chanman = xfi->context->channels;
|
||||
rail = ((rdpContext*) xfi->context)->rail;
|
||||
|
||||
rail_window = window_list_get_by_extra_id(rail->list, (void*) xwindow);
|
||||
@ -248,10 +248,10 @@ void xf_rail_send_activate(xfInfo* xfi, Window xwindow, boolean enabled)
|
||||
|
||||
void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 command)
|
||||
{
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
RAIL_SYSCOMMAND_ORDER syscommand;
|
||||
|
||||
chanman = xfi->context->chanman;
|
||||
chanman = xfi->context->channels;
|
||||
|
||||
syscommand.windowId = windowId;
|
||||
syscommand.command = command;
|
||||
@ -259,7 +259,7 @@ void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 com
|
||||
xf_send_rail_client_event(chanman, RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND, &syscommand);
|
||||
}
|
||||
|
||||
void xf_process_rail_get_sysparams_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_get_sysparams_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_SYSPARAM_ORDER* sysparam;
|
||||
|
||||
@ -291,7 +291,7 @@ const char* error_code_names[] =
|
||||
"RAIL_EXEC_E_SESSION_LOCKED"
|
||||
};
|
||||
|
||||
void xf_process_rail_exec_result_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_exec_result_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_EXEC_RESULT_ORDER* exec_result;
|
||||
|
||||
@ -304,7 +304,7 @@ void xf_process_rail_exec_result_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVE
|
||||
}
|
||||
}
|
||||
|
||||
void xf_process_rail_server_sysparam_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_server_sysparam_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_SYSPARAM_ORDER* sysparam = (RAIL_SYSPARAM_ORDER*) event->user_data;
|
||||
|
||||
@ -318,7 +318,7 @@ void xf_process_rail_server_sysparam_event(xfInfo* xfi, rdpChanMan* chanman, RDP
|
||||
}
|
||||
}
|
||||
|
||||
void xf_process_rail_server_minmaxinfo_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_server_minmaxinfo_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
rdpRail* rail;
|
||||
rdpWindow* rail_window = NULL;
|
||||
@ -360,7 +360,7 @@ const char* movetype_names[] =
|
||||
"RAIL_WMSZ_KEYSIZE"
|
||||
};
|
||||
|
||||
void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
rdpRail* rail;
|
||||
rdpWindow* rail_window = NULL;
|
||||
@ -386,7 +386,7 @@ void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChanMan* chanman
|
||||
|
||||
}
|
||||
|
||||
void xf_process_rail_appid_resp_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_appid_resp_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_GET_APPID_RESP_ORDER* appid_resp =
|
||||
(RAIL_GET_APPID_RESP_ORDER*)event->user_data;
|
||||
@ -398,7 +398,7 @@ void xf_process_rail_appid_resp_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVEN
|
||||
freerdp_hexdump(appid_resp->applicationId.string, appid_resp->applicationId.length);
|
||||
}
|
||||
|
||||
void xf_process_rail_langbarinfo_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_langbarinfo_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_LANGBAR_INFO_ORDER* langbar =
|
||||
(RAIL_LANGBAR_INFO_ORDER*) event->user_data;
|
||||
@ -407,7 +407,7 @@ void xf_process_rail_langbarinfo_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVE
|
||||
langbar->languageBarStatus);
|
||||
}
|
||||
|
||||
void xf_process_rail_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
void xf_process_rail_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event)
|
||||
{
|
||||
switch (event->event_type)
|
||||
{
|
||||
|
@ -27,6 +27,6 @@ void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail);
|
||||
void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 command);
|
||||
void xf_rail_send_activate(xfInfo* xfi, Window xwindow, boolean enabled);
|
||||
void xf_rail_send_windowmove(xfInfo* xfi, uint32 windowId, uint32 left, uint32 top, uint32 right, uint32 bottom);
|
||||
void xf_process_rail_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event);
|
||||
void xf_process_rail_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event);
|
||||
|
||||
#endif /* __XF_RAIL_H */
|
||||
|
@ -81,7 +81,7 @@ void xf_context_size(freerdp* instance, uint32* size)
|
||||
|
||||
void xf_context_new(freerdp* instance, xfContext* context)
|
||||
{
|
||||
context->chanman = freerdp_chanman_new();
|
||||
context->channels = freerdp_channels_new();
|
||||
}
|
||||
|
||||
void xf_context_free(freerdp* instance, xfContext* context)
|
||||
@ -559,7 +559,7 @@ boolean xf_pre_connect(freerdp* instance)
|
||||
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
|
||||
settings->order_support[NEG_ELLIPSE_CB_INDEX] = False;
|
||||
|
||||
freerdp_chanman_pre_connect(xfi->context->chanman, instance);
|
||||
freerdp_channels_pre_connect(xfi->context->channels, instance);
|
||||
|
||||
xfi->display = XOpenDisplay(NULL);
|
||||
|
||||
@ -623,11 +623,11 @@ boolean xf_post_connect(freerdp* instance)
|
||||
xfInfo* xfi;
|
||||
XGCValues gcv;
|
||||
rdpCache* cache;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
xfi = ((xfContext*) instance->context)->xfi;
|
||||
cache = instance->context->cache;
|
||||
chanman = xfi->context->chanman;
|
||||
chanman = xfi->context->channels;
|
||||
|
||||
if (xf_get_pixmap_info(xfi) != True)
|
||||
return False;
|
||||
@ -738,7 +738,7 @@ boolean xf_post_connect(freerdp* instance)
|
||||
rail_register_update_callbacks(instance->context->rail, instance->update);
|
||||
xf_rail_register_callbacks(xfi, instance->context->rail);
|
||||
|
||||
freerdp_chanman_post_connect(chanman, instance);
|
||||
freerdp_channels_post_connect(chanman, instance);
|
||||
|
||||
xf_tsmf_init(xfi, xv_port);
|
||||
|
||||
@ -798,27 +798,27 @@ int xf_process_ui_args(rdpSettings* settings, const char* opt, const char* val,
|
||||
|
||||
int xf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data)
|
||||
{
|
||||
rdpChanMan* chanman = (rdpChanMan*) user_data;
|
||||
rdpChannels* chanman = (rdpChannels*) user_data;
|
||||
|
||||
printf("loading plugin %s\n", name);
|
||||
freerdp_chanman_load_plugin(chanman, settings, name, plugin_data);
|
||||
freerdp_channels_load_plugin(chanman, settings, name, plugin_data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int xf_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
|
||||
{
|
||||
return freerdp_chanman_data(instance, channelId, data, size, flags, total_size);
|
||||
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
|
||||
}
|
||||
|
||||
void xf_process_channel_event(rdpChanMan* chanman, freerdp* instance)
|
||||
void xf_process_channel_event(rdpChannels* chanman, freerdp* instance)
|
||||
{
|
||||
xfInfo* xfi;
|
||||
RDP_EVENT* event;
|
||||
|
||||
xfi = ((xfContext*) instance->context)->xfi;
|
||||
|
||||
event = freerdp_chanman_pop_event(chanman);
|
||||
event = freerdp_channels_pop_event(chanman);
|
||||
|
||||
if (event)
|
||||
{
|
||||
@ -902,7 +902,7 @@ int xfreerdp_run(freerdp* instance)
|
||||
void* wfds[32];
|
||||
fd_set rfds_set;
|
||||
fd_set wfds_set;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
memset(rfds, 0, sizeof(rfds));
|
||||
memset(wfds, 0, sizeof(wfds));
|
||||
@ -911,7 +911,7 @@ int xfreerdp_run(freerdp* instance)
|
||||
return 0;
|
||||
|
||||
xfi = ((xfContext*) instance->context)->xfi;
|
||||
chanman = ((xfContext*) instance->context)->chanman;
|
||||
chanman = ((xfContext*) instance->context)->channels;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@ -923,7 +923,7 @@ int xfreerdp_run(freerdp* instance)
|
||||
printf("Failed to get FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
if (freerdp_channels_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
{
|
||||
printf("Failed to get channel manager file descriptor\n");
|
||||
break;
|
||||
@ -974,7 +974,7 @@ int xfreerdp_run(freerdp* instance)
|
||||
printf("Failed to check xfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_check_fds(chanman, instance) != True)
|
||||
if (freerdp_channels_check_fds(chanman, instance) != True)
|
||||
{
|
||||
printf("Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
@ -982,8 +982,8 @@ int xfreerdp_run(freerdp* instance)
|
||||
xf_process_channel_event(chanman, instance);
|
||||
}
|
||||
|
||||
freerdp_chanman_close(chanman, instance);
|
||||
freerdp_chanman_free(chanman);
|
||||
freerdp_channels_close(chanman, instance);
|
||||
freerdp_channels_free(chanman);
|
||||
instance->Disconnect(instance);
|
||||
gdi_free(instance);
|
||||
freerdp_free(instance);
|
||||
@ -1022,7 +1022,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
|
||||
g_sem = freerdp_sem_new(1);
|
||||
|
||||
@ -1041,7 +1041,7 @@ int main(int argc, char* argv[])
|
||||
context = (xfContext*) instance->context;
|
||||
|
||||
if (freerdp_parse_args(instance->settings, argc, argv,
|
||||
xf_process_plugin_args, context->chanman, xf_process_ui_args, NULL) < 0)
|
||||
xf_process_plugin_args, context->channels, xf_process_ui_args, NULL) < 0)
|
||||
return 1;
|
||||
|
||||
data = (struct thread_data*) xzalloc(sizeof(struct thread_data));
|
||||
@ -1055,7 +1055,7 @@ int main(int argc, char* argv[])
|
||||
freerdp_sem_wait(g_sem);
|
||||
}
|
||||
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/gdi/gdi.h>
|
||||
#include <freerdp/gdi/dc.h>
|
||||
#include <freerdp/gdi/region.h>
|
||||
@ -63,7 +63,7 @@ struct xf_context
|
||||
rdpContext _p;
|
||||
|
||||
xfInfo* xfi;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* channels;
|
||||
rdpSettings* settings;
|
||||
};
|
||||
typedef struct xf_context xfContext;
|
||||
|
@ -23,4 +23,4 @@ add_executable(freerdp-test
|
||||
target_link_libraries(freerdp-test freerdp-core)
|
||||
target_link_libraries(freerdp-test freerdp-gdi)
|
||||
target_link_libraries(freerdp-test freerdp-utils)
|
||||
target_link_libraries(freerdp-test freerdp-chanman dl)
|
||||
target_link_libraries(freerdp-test freerdp-channels dl)
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <freerdp/utils/semaphore.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/plugins/cliprdr.h>
|
||||
|
||||
struct tf_info
|
||||
@ -50,7 +50,7 @@ struct tf_context
|
||||
rdpContext _p;
|
||||
|
||||
tfInfo* tfi;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
};
|
||||
typedef struct tf_context tfContext;
|
||||
|
||||
@ -72,7 +72,7 @@ void tf_context_size(freerdp* instance, uint32* size)
|
||||
|
||||
void tf_context_new(freerdp* instance, tfContext* context)
|
||||
{
|
||||
context->chanman = freerdp_chanman_new();
|
||||
context->chanman = freerdp_channels_new();
|
||||
}
|
||||
|
||||
void tf_context_free(freerdp* instance, tfContext* context)
|
||||
@ -96,20 +96,20 @@ void tf_end_paint(rdpUpdate* update)
|
||||
|
||||
int tf_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
|
||||
{
|
||||
return freerdp_chanman_data(instance, channelId, data, size, flags, total_size);
|
||||
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
|
||||
}
|
||||
|
||||
int tf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data)
|
||||
{
|
||||
rdpChanMan* chanman = (rdpChanMan*) user_data;
|
||||
rdpChannels* chanman = (rdpChannels*) user_data;
|
||||
|
||||
printf("Load plugin %s\n", name);
|
||||
freerdp_chanman_load_plugin(chanman, settings, name, plugin_data);
|
||||
freerdp_channels_load_plugin(chanman, settings, name, plugin_data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void tf_process_cb_sync_event(rdpChanMan* chanman, freerdp* instance)
|
||||
void tf_process_cb_sync_event(rdpChannels* chanman, freerdp* instance)
|
||||
{
|
||||
RDP_EVENT* event;
|
||||
RDP_CB_FORMAT_LIST_EVENT* format_list_event;
|
||||
@ -119,14 +119,14 @@ void tf_process_cb_sync_event(rdpChanMan* chanman, freerdp* instance)
|
||||
format_list_event = (RDP_CB_FORMAT_LIST_EVENT*)event;
|
||||
format_list_event->num_formats = 0;
|
||||
|
||||
freerdp_chanman_send_event(chanman, event);
|
||||
freerdp_channels_send_event(chanman, event);
|
||||
}
|
||||
|
||||
void tf_process_channel_event(rdpChanMan* chanman, freerdp* instance)
|
||||
void tf_process_channel_event(rdpChannels* chanman, freerdp* instance)
|
||||
{
|
||||
RDP_EVENT* event;
|
||||
|
||||
event = freerdp_chanman_pop_event(chanman);
|
||||
event = freerdp_channels_pop_event(chanman);
|
||||
|
||||
if (event)
|
||||
{
|
||||
@ -179,7 +179,7 @@ boolean tf_pre_connect(freerdp* instance)
|
||||
settings->order_support[NEG_ELLIPSE_SC_INDEX] = True;
|
||||
settings->order_support[NEG_ELLIPSE_CB_INDEX] = True;
|
||||
|
||||
freerdp_chanman_pre_connect(context->chanman, instance);
|
||||
freerdp_channels_pre_connect(context->chanman, instance);
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -197,7 +197,7 @@ boolean tf_post_connect(freerdp* instance)
|
||||
instance->update->BeginPaint = tf_begin_paint;
|
||||
instance->update->EndPaint = tf_end_paint;
|
||||
|
||||
freerdp_chanman_post_connect(context->chanman, instance);
|
||||
freerdp_channels_post_connect(context->chanman, instance);
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -214,7 +214,7 @@ int tfreerdp_run(freerdp* instance)
|
||||
fd_set rfds_set;
|
||||
fd_set wfds_set;
|
||||
tfContext* context;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
memset(rfds, 0, sizeof(rfds));
|
||||
memset(wfds, 0, sizeof(wfds));
|
||||
@ -234,7 +234,7 @@ int tfreerdp_run(freerdp* instance)
|
||||
printf("Failed to get FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
if (freerdp_channels_get_fds(chanman, instance, rfds, &rcount, wfds, &wcount) != True)
|
||||
{
|
||||
printf("Failed to get channel manager file descriptor\n");
|
||||
break;
|
||||
@ -274,7 +274,7 @@ int tfreerdp_run(freerdp* instance)
|
||||
printf("Failed to check FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_chanman_check_fds(chanman, instance) != True)
|
||||
if (freerdp_channels_check_fds(chanman, instance) != True)
|
||||
{
|
||||
printf("Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
@ -282,8 +282,8 @@ int tfreerdp_run(freerdp* instance)
|
||||
tf_process_channel_event(chanman, instance);
|
||||
}
|
||||
|
||||
freerdp_chanman_close(chanman, instance);
|
||||
freerdp_chanman_free(chanman);
|
||||
freerdp_channels_close(chanman, instance);
|
||||
freerdp_channels_free(chanman);
|
||||
freerdp_free(instance);
|
||||
|
||||
return 0;
|
||||
@ -314,9 +314,9 @@ int main(int argc, char* argv[])
|
||||
freerdp* instance;
|
||||
tfContext* context;
|
||||
struct thread_data* data;
|
||||
rdpChanMan* chanman;
|
||||
rdpChannels* chanman;
|
||||
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
|
||||
g_sem = freerdp_sem_new(1);
|
||||
|
||||
@ -346,7 +346,7 @@ int main(int argc, char* argv[])
|
||||
freerdp_sem_wait(g_sem);
|
||||
}
|
||||
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ add_executable(test_freerdp
|
||||
test_stream.h
|
||||
test_utils.c
|
||||
test_utils.h
|
||||
test_chanman.c
|
||||
test_chanman.h
|
||||
test_channels.c
|
||||
test_channels.h
|
||||
test_cliprdr.c
|
||||
test_cliprdr.h
|
||||
test_drdynvc.c
|
||||
@ -71,7 +71,7 @@ target_link_libraries(test_freerdp ${CUNIT_LIBRARIES})
|
||||
target_link_libraries(test_freerdp freerdp-core)
|
||||
target_link_libraries(test_freerdp freerdp-gdi)
|
||||
target_link_libraries(test_freerdp freerdp-utils)
|
||||
target_link_libraries(test_freerdp freerdp-chanman)
|
||||
target_link_libraries(test_freerdp freerdp-channels)
|
||||
target_link_libraries(test_freerdp freerdp-codec)
|
||||
|
||||
add_test(CUnitTests ${EXECUTABLE_OUTPUT_PATH}/test_freerdp)
|
||||
|
@ -22,20 +22,20 @@
|
||||
#include <stdlib.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
|
||||
#include "test_chanman.h"
|
||||
#include "test_channels.h"
|
||||
|
||||
int init_chanman_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clean_chanman_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ static int test_rdp_channel_data(freerdp* instance, int chan_id, uint8* data, in
|
||||
|
||||
void test_chanman(void)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
rdpSettings settings = { 0 };
|
||||
freerdp instance = { 0 };
|
||||
RDP_EVENT* event;
|
||||
@ -65,27 +65,27 @@ void test_chanman(void)
|
||||
instance.settings = &settings;
|
||||
instance.SendChannelData = test_rdp_channel_data;
|
||||
|
||||
chan_man = freerdp_chanman_new();
|
||||
chan_man = freerdp_channels_new();
|
||||
|
||||
freerdp_chanman_load_plugin(chan_man, &settings, "../channels/rdpdbg/rdpdbg.so", NULL);
|
||||
freerdp_chanman_pre_connect(chan_man, &instance);
|
||||
freerdp_chanman_post_connect(chan_man, &instance);
|
||||
freerdp_channels_load_plugin(chan_man, &settings, "../channels/rdpdbg/rdpdbg.so", NULL);
|
||||
freerdp_channels_pre_connect(chan_man, &instance);
|
||||
freerdp_channels_post_connect(chan_man, &instance);
|
||||
|
||||
freerdp_chanman_data(&instance, 0, "testdata", 8, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 8);
|
||||
freerdp_chanman_data(&instance, 0, "testdata1", 9, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 9);
|
||||
freerdp_chanman_data(&instance, 0, "testdata11", 10, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 10);
|
||||
freerdp_chanman_data(&instance, 0, "testdata111", 11, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 11);
|
||||
freerdp_channels_data(&instance, 0, "testdata", 8, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 8);
|
||||
freerdp_channels_data(&instance, 0, "testdata1", 9, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 9);
|
||||
freerdp_channels_data(&instance, 0, "testdata11", 10, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 10);
|
||||
freerdp_channels_data(&instance, 0, "testdata111", 11, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 11);
|
||||
|
||||
event = freerdp_event_new(RDP_EVENT_CLASS_DEBUG, 0, NULL, NULL);
|
||||
freerdp_chanman_send_event(chan_man, event);
|
||||
freerdp_channels_send_event(chan_man, event);
|
||||
|
||||
while ((event = freerdp_chanman_pop_event(chan_man)) == NULL)
|
||||
while ((event = freerdp_channels_pop_event(chan_man)) == NULL)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
printf("responded event_type %d\n", event->event_type);
|
||||
freerdp_event_free(event);
|
||||
|
||||
freerdp_chanman_close(chan_man, &instance);
|
||||
freerdp_chanman_free(chan_man);
|
||||
freerdp_channels_close(chan_man, &instance);
|
||||
freerdp_channels_free(chan_man);
|
||||
}
|
@ -22,7 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/utils/hexdump.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
@ -32,13 +32,13 @@
|
||||
|
||||
int init_cliprdr_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clean_cliprdr_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ static void event_process_callback(RDP_EVENT* event)
|
||||
void test_cliprdr(void)
|
||||
{
|
||||
int i;
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
rdpSettings settings = { 0 };
|
||||
freerdp instance = { 0 };
|
||||
RDP_EVENT* event;
|
||||
@ -117,23 +117,23 @@ void test_cliprdr(void)
|
||||
instance.settings = &settings;
|
||||
instance.SendChannelData = test_rdp_channel_data;
|
||||
|
||||
chan_man = freerdp_chanman_new();
|
||||
chan_man = freerdp_channels_new();
|
||||
|
||||
freerdp_chanman_load_plugin(chan_man, &settings, "../channels/cliprdr/cliprdr.so", NULL);
|
||||
freerdp_chanman_pre_connect(chan_man, &instance);
|
||||
freerdp_chanman_post_connect(chan_man, &instance);
|
||||
freerdp_channels_load_plugin(chan_man, &settings, "../channels/cliprdr/cliprdr.so", NULL);
|
||||
freerdp_channels_pre_connect(chan_man, &instance);
|
||||
freerdp_channels_post_connect(chan_man, &instance);
|
||||
|
||||
/* server sends cliprdr capabilities and monitor ready PDU */
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_clip_caps_data, sizeof(test_clip_caps_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_clip_caps_data, sizeof(test_clip_caps_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_clip_caps_data) - 1);
|
||||
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_monitor_ready_data, sizeof(test_monitor_ready_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_monitor_ready_data, sizeof(test_monitor_ready_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_monitor_ready_data) - 1);
|
||||
|
||||
/* cliprdr sends clipboard_sync event to UI */
|
||||
while ((event = freerdp_chanman_pop_event(chan_man)) == NULL)
|
||||
while ((event = freerdp_channels_pop_event(chan_man)) == NULL)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
printf("Got event %d\n", event->event_type);
|
||||
CU_ASSERT(event->event_type == RDP_EVENT_TYPE_CB_SYNC);
|
||||
@ -147,26 +147,26 @@ void test_cliprdr(void)
|
||||
format_list_event->formats[0] = CB_FORMAT_TEXT;
|
||||
format_list_event->formats[1] = CB_FORMAT_HTML;
|
||||
event_processed = 0;
|
||||
freerdp_chanman_send_event(chan_man, event);
|
||||
freerdp_channels_send_event(chan_man, event);
|
||||
|
||||
/* cliprdr sends format list PDU to server */
|
||||
while (!event_processed)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
|
||||
/* server sends format list response PDU to cliprdr */
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_format_list_response_data, sizeof(test_format_list_response_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_format_list_response_data, sizeof(test_format_list_response_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_format_list_response_data) - 1);
|
||||
|
||||
/* server sends format list PDU to cliprdr */
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_format_list_data, sizeof(test_format_list_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_format_list_data, sizeof(test_format_list_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_format_list_data) - 1);
|
||||
|
||||
/* cliprdr sends format_list event to UI */
|
||||
while ((event = freerdp_chanman_pop_event(chan_man)) == NULL)
|
||||
while ((event = freerdp_channels_pop_event(chan_man)) == NULL)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
printf("Got event %d\n", event->event_type);
|
||||
CU_ASSERT(event->event_type == RDP_EVENT_TYPE_CB_FORMAT_LIST);
|
||||
@ -179,13 +179,13 @@ void test_cliprdr(void)
|
||||
freerdp_event_free(event);
|
||||
|
||||
/* server sends data request PDU to cliprdr */
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_data_request_data, sizeof(test_data_request_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_data_request_data, sizeof(test_data_request_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_data_request_data) - 1);
|
||||
|
||||
/* cliprdr sends data request event to UI */
|
||||
while ((event = freerdp_chanman_pop_event(chan_man)) == NULL)
|
||||
while ((event = freerdp_channels_pop_event(chan_man)) == NULL)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
printf("Got event %d\n", event->event_type);
|
||||
CU_ASSERT(event->event_type == RDP_EVENT_TYPE_CB_DATA_REQUEST);
|
||||
@ -203,12 +203,12 @@ void test_cliprdr(void)
|
||||
strcpy((char*)data_response_event->data, "hello");
|
||||
data_response_event->size = 6;
|
||||
event_processed = 0;
|
||||
freerdp_chanman_send_event(chan_man, event);
|
||||
freerdp_channels_send_event(chan_man, event);
|
||||
|
||||
/* cliprdr sends data response PDU to server */
|
||||
while (!event_processed)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
|
||||
/* UI sends data request event to cliprdr */
|
||||
@ -216,22 +216,22 @@ void test_cliprdr(void)
|
||||
data_request_event = (RDP_CB_DATA_REQUEST_EVENT*)event;
|
||||
data_request_event->format = CB_FORMAT_UNICODETEXT;
|
||||
event_processed = 0;
|
||||
freerdp_chanman_send_event(chan_man, event);
|
||||
freerdp_channels_send_event(chan_man, event);
|
||||
|
||||
/* cliprdr sends data request PDU to server */
|
||||
while (!event_processed)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
|
||||
/* server sends data response PDU to cliprdr */
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_data_response_data, sizeof(test_data_response_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_data_response_data, sizeof(test_data_response_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_data_response_data) - 1);
|
||||
|
||||
/* cliprdr sends data response event to UI */
|
||||
while ((event = freerdp_chanman_pop_event(chan_man)) == NULL)
|
||||
while ((event = freerdp_channels_pop_event(chan_man)) == NULL)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
printf("Got event %d\n", event->event_type);
|
||||
CU_ASSERT(event->event_type == RDP_EVENT_TYPE_CB_DATA_RESPONSE);
|
||||
@ -243,6 +243,6 @@ void test_cliprdr(void)
|
||||
}
|
||||
freerdp_event_free(event);
|
||||
|
||||
freerdp_chanman_close(chan_man, &instance);
|
||||
freerdp_chanman_free(chan_man);
|
||||
freerdp_channels_close(chan_man, &instance);
|
||||
freerdp_channels_free(chan_man);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/utils/hexdump.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
@ -31,13 +31,13 @@
|
||||
|
||||
int init_drdynvc_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clean_drdynvc_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ static int test_rdp_channel_data(freerdp* instance, int chan_id, uint8* data, in
|
||||
|
||||
void test_drdynvc(void)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
rdpSettings settings = { 0 };
|
||||
freerdp instance = { 0 };
|
||||
|
||||
@ -75,23 +75,23 @@ void test_drdynvc(void)
|
||||
instance.settings = &settings;
|
||||
instance.SendChannelData = test_rdp_channel_data;
|
||||
|
||||
chan_man = freerdp_chanman_new();
|
||||
chan_man = freerdp_channels_new();
|
||||
|
||||
freerdp_chanman_load_plugin(chan_man, &settings, "../channels/drdynvc/drdynvc.so", NULL);
|
||||
freerdp_chanman_pre_connect(chan_man, &instance);
|
||||
freerdp_chanman_post_connect(chan_man, &instance);
|
||||
freerdp_channels_load_plugin(chan_man, &settings, "../channels/drdynvc/drdynvc.so", NULL);
|
||||
freerdp_channels_pre_connect(chan_man, &instance);
|
||||
freerdp_channels_post_connect(chan_man, &instance);
|
||||
|
||||
/* server sends capability request PDU */
|
||||
freerdp_chanman_data(&instance, 0, (char*)test_capability_request_data, sizeof(test_capability_request_data) - 1,
|
||||
freerdp_channels_data(&instance, 0, (char*)test_capability_request_data, sizeof(test_capability_request_data) - 1,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_capability_request_data) - 1);
|
||||
|
||||
/* drdynvc sends capability response PDU to server */
|
||||
data_received = 0;
|
||||
while (!data_received)
|
||||
{
|
||||
freerdp_chanman_check_fds(chan_man, &instance);
|
||||
freerdp_channels_check_fds(chan_man, &instance);
|
||||
}
|
||||
|
||||
freerdp_chanman_close(chan_man, &instance);
|
||||
freerdp_chanman_free(chan_man);
|
||||
freerdp_channels_close(chan_man, &instance);
|
||||
freerdp_channels_free(chan_man);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "test_utils.h"
|
||||
#include "test_orders.h"
|
||||
#include "test_license.h"
|
||||
#include "test_chanman.h"
|
||||
#include "test_channels.h"
|
||||
#include "test_cliprdr.h"
|
||||
#include "test_drdynvc.h"
|
||||
#include "test_librfx.h"
|
||||
|
@ -198,7 +198,7 @@ void test_gcc_write_client_network_data(void)
|
||||
settings = settings_new(NULL);
|
||||
|
||||
settings->num_channels = 3;
|
||||
memset(settings->channels, 0, sizeof(rdpChan) * settings->num_channels);
|
||||
memset(settings->channels, 0, sizeof(rdpChannel) * settings->num_channels);
|
||||
|
||||
strcpy(settings->channels[0].name, "rdpdr");
|
||||
settings->channels[0].options = 0x80800000;
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/utils/hexdump.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
@ -47,13 +47,13 @@
|
||||
|
||||
int init_rail_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_init();
|
||||
freerdp_channels_global_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clean_rail_suite(void)
|
||||
{
|
||||
freerdp_chanman_global_uninit();
|
||||
freerdp_channels_global_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ RAIL_EVENT;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
freerdp* instance;
|
||||
int th_count;
|
||||
int th_to_finish;
|
||||
@ -485,7 +485,7 @@ static void test_on_free_rail_client_event(RDP_EVENT* event)
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
static void send_ui_event2plugin(
|
||||
rdpChanMan* chan_man,
|
||||
rdpChannels* chan_man,
|
||||
uint16 event_type,
|
||||
void * data
|
||||
)
|
||||
@ -498,7 +498,7 @@ static void send_ui_event2plugin(
|
||||
{
|
||||
out_event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, event_type,
|
||||
test_on_free_rail_client_event, payload);
|
||||
freerdp_chanman_send_event(chan_man, out_event);
|
||||
freerdp_channels_send_event(chan_man, out_event);
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -514,7 +514,7 @@ static void emulate_server_send_channel_data(
|
||||
printf("Emulate server packet (%d packet):\n", counter);
|
||||
freerdp_hexdump(data, size);
|
||||
|
||||
freerdp_chanman_data(instance, 0, (char*)data, size,
|
||||
freerdp_channels_data(instance, 0, (char*)data, size,
|
||||
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, size);
|
||||
usleep(10*1000);
|
||||
}
|
||||
@ -616,11 +616,11 @@ static void process_events_and_channel_data_from_plugin(thread_param* param)
|
||||
param->th_count++;
|
||||
while (param->th_to_finish == 0)
|
||||
{
|
||||
freerdp_chanman_check_fds(param->chan_man, param->instance);
|
||||
freerdp_channels_check_fds(param->chan_man, param->instance);
|
||||
|
||||
while (1)
|
||||
{
|
||||
event = freerdp_chanman_pop_event(param->chan_man);
|
||||
event = freerdp_channels_pop_event(param->chan_man);
|
||||
if (event == NULL) break;
|
||||
|
||||
static int counter = 0;
|
||||
@ -658,7 +658,7 @@ void test_rail_plugin(void)
|
||||
thread_param param;
|
||||
pthread_t thread;
|
||||
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
rdpSettings settings = { 0 };
|
||||
freerdp s_inst = { 0 };
|
||||
freerdp* inst = &s_inst;
|
||||
@ -673,11 +673,11 @@ void test_rail_plugin(void)
|
||||
inst->settings = &settings;
|
||||
inst->SendChannelData = emulate_client_send_channel_data;
|
||||
|
||||
chan_man = freerdp_chanman_new();
|
||||
chan_man = freerdp_channels_new();
|
||||
|
||||
freerdp_chanman_load_plugin(chan_man, &settings, "../channels/rail/rail.so", NULL);
|
||||
freerdp_chanman_pre_connect(chan_man, inst);
|
||||
freerdp_chanman_post_connect(chan_man, inst);
|
||||
freerdp_channels_load_plugin(chan_man, &settings, "../channels/rail/rail.so", NULL);
|
||||
freerdp_channels_pre_connect(chan_man, inst);
|
||||
freerdp_channels_post_connect(chan_man, inst);
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
|
||||
@ -882,8 +882,8 @@ void test_rail_plugin(void)
|
||||
)
|
||||
);
|
||||
|
||||
freerdp_chanman_close(chan_man, inst);
|
||||
freerdp_chanman_free(chan_man);
|
||||
freerdp_channels_close(chan_man, inst);
|
||||
freerdp_channels_free(chan_man);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,54 +0,0 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol client.
|
||||
* Virtual Channel Manager
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
*
|
||||
* 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_CHANMAN_H
|
||||
#define __FREERDP_CHANMAN_H
|
||||
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct rdp_chan_man rdpChanMan;
|
||||
|
||||
FREERDP_API int freerdp_chanman_global_init(void);
|
||||
FREERDP_API int freerdp_chanman_global_uninit(void);
|
||||
FREERDP_API rdpChanMan* freerdp_chanman_new(void);
|
||||
FREERDP_API void freerdp_chanman_free(rdpChanMan* chan_man);
|
||||
FREERDP_API int freerdp_chanman_load_plugin(rdpChanMan* chan_man, rdpSettings* settings,
|
||||
const char* name, void* data);
|
||||
FREERDP_API int freerdp_chanman_pre_connect(rdpChanMan* chan_man, freerdp* instance);
|
||||
FREERDP_API int freerdp_chanman_post_connect(rdpChanMan* chan_man, freerdp* instance);
|
||||
FREERDP_API int freerdp_chanman_data(freerdp* instance, int chan_id, void* data, int data_size,
|
||||
int flags, int total_size);
|
||||
FREERDP_API int freerdp_chanman_send_event(rdpChanMan* chan_man, RDP_EVENT* event);
|
||||
FREERDP_API boolean freerdp_chanman_get_fds(rdpChanMan* chan_man, freerdp* instance, void** read_fds,
|
||||
int* read_count, void** write_fds, int* write_count);
|
||||
FREERDP_API boolean freerdp_chanman_check_fds(rdpChanMan* chan_man, freerdp* instance);
|
||||
FREERDP_API RDP_EVENT* freerdp_chanman_pop_event(rdpChanMan* chan_man);
|
||||
FREERDP_API void freerdp_chanman_close(rdpChanMan* chan_man, freerdp* instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
54
include/freerdp/channels/channels.h
Normal file
54
include/freerdp/channels/channels.h
Normal file
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol client.
|
||||
* Virtual Channel Manager
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
*
|
||||
* 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_CHANMAN_H
|
||||
#define __FREERDP_CHANMAN_H
|
||||
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct rdp_channels rdpChannels;
|
||||
|
||||
FREERDP_API int freerdp_channels_global_init(void);
|
||||
FREERDP_API int freerdp_channels_global_uninit(void);
|
||||
FREERDP_API rdpChannels* freerdp_channels_new(void);
|
||||
FREERDP_API void freerdp_channels_free(rdpChannels* channels);
|
||||
FREERDP_API int freerdp_channels_load_plugin(rdpChannels* channels, rdpSettings* settings,
|
||||
const char* name, void* data);
|
||||
FREERDP_API int freerdp_channels_pre_connect(rdpChannels* channels, freerdp* instance);
|
||||
FREERDP_API int freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance);
|
||||
FREERDP_API int freerdp_channels_data(freerdp* instance, int channel_id, void* data, int data_size,
|
||||
int flags, int total_size);
|
||||
FREERDP_API int freerdp_channels_send_event(rdpChannels* channels, RDP_EVENT* event);
|
||||
FREERDP_API boolean freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, void** read_fds,
|
||||
int* read_count, void** write_fds, int* write_count);
|
||||
FREERDP_API boolean freerdp_channels_check_fds(rdpChannels* channels, freerdp* instance);
|
||||
FREERDP_API RDP_EVENT* freerdp_channels_pop_event(rdpChannels* channels);
|
||||
FREERDP_API void freerdp_channels_close(rdpChannels* channels, freerdp* instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -134,15 +134,15 @@ typedef struct
|
||||
uint8 arcRandomBits[16];
|
||||
} ARC_SC_PRIVATE_PACKET;
|
||||
|
||||
struct rdp_chan
|
||||
struct rdp_channel
|
||||
{
|
||||
char name[8]; /* ui sets */
|
||||
int options; /* ui sets */
|
||||
int chan_id; /* core sets */
|
||||
int channel_id; /* core sets */
|
||||
boolean joined; /* client has joined the channel */
|
||||
void * handle; /* just for ui */
|
||||
};
|
||||
typedef struct rdp_chan rdpChan;
|
||||
typedef struct rdp_channel rdpChannel;
|
||||
|
||||
struct rdp_ext_set
|
||||
{
|
||||
@ -216,7 +216,7 @@ struct rdp_settings
|
||||
uint32 redirected_session_id;
|
||||
|
||||
int num_channels;
|
||||
rdpChan channels[16];
|
||||
rdpChannel channels[16];
|
||||
|
||||
int num_monitors;
|
||||
struct rdp_monitor monitors[16];
|
||||
|
@ -17,14 +17,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(FREERDP_CHANMAN_SRCS
|
||||
libchanman.c
|
||||
libchanman.h)
|
||||
set(FREERDP_CHANNELS_SRCS
|
||||
libchannels.c
|
||||
libchannels.h)
|
||||
|
||||
add_library(freerdp-chanman ${FREERDP_CHANMAN_SRCS})
|
||||
add_library(freerdp-channels ${FREERDP_CHANNELS_SRCS})
|
||||
|
||||
set_target_properties(freerdp-chanman PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
target_link_libraries(freerdp-chanman freerdp-utils)
|
||||
set_target_properties(freerdp-channels PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
target_link_libraries(freerdp-channels freerdp-utils)
|
||||
|
||||
install(TARGETS freerdp-chanman DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(TARGETS freerdp-channels DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <string.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/chanman/chanman.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
#include <freerdp/svc.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
#include <freerdp/utils/list.h>
|
||||
@ -47,7 +47,7 @@
|
||||
#include <freerdp/utils/wait_obj.h>
|
||||
#include <freerdp/utils/load_plugin.h>
|
||||
|
||||
#include "libchanman.h"
|
||||
#include "libchannels.h"
|
||||
|
||||
#define CHANNEL_MAX_COUNT 30
|
||||
|
||||
@ -58,7 +58,7 @@ struct lib_data
|
||||
void* init_handle;
|
||||
};
|
||||
|
||||
struct chan_data
|
||||
struct channel_data
|
||||
{
|
||||
char name[CHANNEL_NAME_LEN + 1];
|
||||
int open_handle;
|
||||
@ -78,10 +78,10 @@ struct sync_data
|
||||
typedef struct rdp_init_handle rdpInitHandle;
|
||||
struct rdp_init_handle
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
};
|
||||
|
||||
struct rdp_chan_man
|
||||
struct rdp_channels
|
||||
{
|
||||
/**
|
||||
* Only the main thread alters these arrays, before any
|
||||
@ -93,7 +93,7 @@ struct rdp_chan_man
|
||||
*/
|
||||
struct lib_data libs[CHANNEL_MAX_COUNT];
|
||||
int num_libs;
|
||||
struct chan_data chans[CHANNEL_MAX_COUNT];
|
||||
struct channel_data chans[CHANNEL_MAX_COUNT];
|
||||
int num_chans;
|
||||
rdpInitHandle init_handles[CHANNEL_MAX_COUNT];
|
||||
int num_init_handles;
|
||||
@ -124,17 +124,17 @@ struct rdp_chan_man
|
||||
* The current channel manager reference passes from VirtualChannelEntry to
|
||||
* VirtualChannelInit for the pInitHandle.
|
||||
*/
|
||||
static rdpChanMan* g_init_chan_man;
|
||||
static rdpChannels* g_init_chan_man;
|
||||
|
||||
/* The list of all channel managers. */
|
||||
typedef struct rdp_chan_man_list rdpChanManList;
|
||||
struct rdp_chan_man_list
|
||||
typedef struct rdp_channels_list rdpChannelsList;
|
||||
struct rdp_channels_list
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChanManList* next;
|
||||
rdpChannels* channels;
|
||||
rdpChannelsList* next;
|
||||
};
|
||||
|
||||
static rdpChanManList* g_chan_man_list;
|
||||
static rdpChannelsList* g_channels_list;
|
||||
|
||||
/* To generate unique sequence for all open handles */
|
||||
static int g_open_handle_sequence;
|
||||
@ -144,16 +144,16 @@ static freerdp_mutex g_mutex_init;
|
||||
static freerdp_mutex g_mutex_list;
|
||||
|
||||
/* returns the chan_man for the open handle passed in */
|
||||
static rdpChanMan* freerdp_chanman_find_by_open_handle(int open_handle, int* pindex)
|
||||
static rdpChannels* freerdp_channels_find_by_open_handle(int open_handle, int* pindex)
|
||||
{
|
||||
rdpChanManList* list;
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannelsList* list;
|
||||
rdpChannels* chan_man;
|
||||
int lindex;
|
||||
|
||||
freerdp_mutex_lock(g_mutex_list);
|
||||
for (list = g_chan_man_list; list; list = list->next)
|
||||
for (list = g_channels_list; list; list = list->next)
|
||||
{
|
||||
chan_man = list->chan_man;
|
||||
chan_man = list->channels;
|
||||
for (lindex = 0; lindex < chan_man->num_chans; lindex++)
|
||||
{
|
||||
if (chan_man->chans[lindex].open_handle == open_handle)
|
||||
@ -169,15 +169,15 @@ static rdpChanMan* freerdp_chanman_find_by_open_handle(int open_handle, int* pin
|
||||
}
|
||||
|
||||
/* returns the chan_man for the rdp instance passed in */
|
||||
static rdpChanMan* freerdp_chanman_find_by_rdp_inst(freerdp* instance)
|
||||
static rdpChannels* freerdp_channels_find_by_instance(freerdp* instance)
|
||||
{
|
||||
rdpChanManList* list;
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannelsList* list;
|
||||
rdpChannels* chan_man;
|
||||
|
||||
freerdp_mutex_lock(g_mutex_list);
|
||||
for (list = g_chan_man_list; list; list = list->next)
|
||||
for (list = g_channels_list; list; list = list->next)
|
||||
{
|
||||
chan_man = list->chan_man;
|
||||
chan_man = list->channels;
|
||||
if (chan_man->instance == instance)
|
||||
{
|
||||
freerdp_mutex_unlock(g_mutex_list);
|
||||
@ -189,11 +189,11 @@ static rdpChanMan* freerdp_chanman_find_by_rdp_inst(freerdp* instance)
|
||||
}
|
||||
|
||||
/* returns struct chan_data for the channel name passed in */
|
||||
static struct chan_data* freerdp_chanman_find_chan_data_by_name(rdpChanMan* chan_man,
|
||||
static struct channel_data* freerdp_channels_find_channel_data_by_name(rdpChannels* chan_man,
|
||||
const char* chan_name, int* pindex)
|
||||
{
|
||||
int lindex;
|
||||
struct chan_data* lchan_data;
|
||||
struct channel_data* lchan_data;
|
||||
|
||||
for (lindex = 0; lindex < chan_man->num_chans; lindex++)
|
||||
{
|
||||
@ -211,23 +211,22 @@ static struct chan_data* freerdp_chanman_find_chan_data_by_name(rdpChanMan* chan
|
||||
}
|
||||
|
||||
/* returns rdpChan for the channel id passed in */
|
||||
static rdpChan* freerdp_chanman_find_rdp_chan_by_id(rdpChanMan* chan_man,
|
||||
rdpSettings* settings, int chan_id, int* pindex)
|
||||
static rdpChannel* freerdp_channels_find_channel_by_id(rdpChannels* channels,
|
||||
rdpSettings* settings, int channel_id, int* pindex)
|
||||
{
|
||||
int lindex;
|
||||
int lcount;
|
||||
rdpChan* lrdp_chan;
|
||||
rdpChannel* lrdp_chan;
|
||||
|
||||
lcount = settings->num_channels;
|
||||
for (lindex = 0; lindex < lcount; lindex++)
|
||||
{
|
||||
lrdp_chan = settings->channels + lindex;
|
||||
if (lrdp_chan->chan_id == chan_id)
|
||||
if (lrdp_chan->channel_id == channel_id)
|
||||
{
|
||||
if (pindex != 0)
|
||||
{
|
||||
*pindex = lindex;
|
||||
}
|
||||
|
||||
return lrdp_chan;
|
||||
}
|
||||
}
|
||||
@ -235,12 +234,12 @@ static rdpChan* freerdp_chanman_find_rdp_chan_by_id(rdpChanMan* chan_man,
|
||||
}
|
||||
|
||||
/* returns rdpChan for the channel name passed in */
|
||||
static rdpChan* freerdp_chanman_find_rdp_chan_by_name(rdpChanMan* chan_man,
|
||||
static rdpChannel* freerdp_channels_find_channel_by_name(rdpChannels* chan_man,
|
||||
rdpSettings* settings, const char* chan_name, int* pindex)
|
||||
{
|
||||
int lindex;
|
||||
int lcount;
|
||||
rdpChan* lrdp_chan;
|
||||
rdpChannel* lrdp_chan;
|
||||
|
||||
lcount = settings->num_channels;
|
||||
for (lindex = 0; lindex < lcount; lindex++)
|
||||
@ -249,9 +248,8 @@ static rdpChan* freerdp_chanman_find_rdp_chan_by_name(rdpChanMan* chan_man,
|
||||
if (strcmp(chan_name, lrdp_chan->name) == 0)
|
||||
{
|
||||
if (pindex != 0)
|
||||
{
|
||||
*pindex = lindex;
|
||||
}
|
||||
|
||||
return lrdp_chan;
|
||||
}
|
||||
}
|
||||
@ -267,11 +265,11 @@ static uint32 FREERDP_CC MyVirtualChannelInit(void** ppInitHandle, PCHANNEL_DEF
|
||||
int channelCount, uint32 versionRequested,
|
||||
PCHANNEL_INIT_EVENT_FN pChannelInitEventProc)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
int index;
|
||||
struct lib_data* llib;
|
||||
struct chan_data* lchan;
|
||||
rdpChan* lrdp_chan;
|
||||
struct channel_data* lchan;
|
||||
rdpChannel* lrdp_chan;
|
||||
PCHANNEL_DEF lchan_def;
|
||||
|
||||
chan_man = g_init_chan_man;
|
||||
@ -279,42 +277,42 @@ static uint32 FREERDP_CC MyVirtualChannelInit(void** ppInitHandle, PCHANNEL_DEF
|
||||
*ppInitHandle = &chan_man->init_handles[chan_man->num_init_handles];
|
||||
chan_man->num_init_handles++;
|
||||
|
||||
DEBUG_CHANMAN("enter");
|
||||
DEBUG_CHANNELS("enter");
|
||||
if (!chan_man->can_call_init)
|
||||
{
|
||||
DEBUG_CHANMAN("error not in entry");
|
||||
DEBUG_CHANNELS("error not in entry");
|
||||
return CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY;
|
||||
}
|
||||
if (ppInitHandle == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad pphan");
|
||||
DEBUG_CHANNELS("error bad pphan");
|
||||
return CHANNEL_RC_BAD_INIT_HANDLE;
|
||||
}
|
||||
if (chan_man->num_chans + channelCount >= CHANNEL_MAX_COUNT)
|
||||
{
|
||||
DEBUG_CHANMAN("error too many channels");
|
||||
DEBUG_CHANNELS("error too many channels");
|
||||
return CHANNEL_RC_TOO_MANY_CHANNELS;
|
||||
}
|
||||
if (pChannel == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad pchan");
|
||||
DEBUG_CHANNELS("error bad pchan");
|
||||
return CHANNEL_RC_BAD_CHANNEL;
|
||||
}
|
||||
if (chan_man->is_connected)
|
||||
{
|
||||
DEBUG_CHANMAN("error already connected");
|
||||
DEBUG_CHANNELS("error already connected");
|
||||
return CHANNEL_RC_ALREADY_CONNECTED;
|
||||
}
|
||||
if (versionRequested != VIRTUAL_CHANNEL_VERSION_WIN2000)
|
||||
{
|
||||
DEBUG_CHANMAN("warning version");
|
||||
DEBUG_CHANNELS("warning version");
|
||||
}
|
||||
for (index = 0; index < channelCount; index++)
|
||||
{
|
||||
lchan_def = pChannel + index;
|
||||
if (freerdp_chanman_find_chan_data_by_name(chan_man, lchan_def->name, 0) != 0)
|
||||
if (freerdp_channels_find_channel_data_by_name(chan_man, lchan_def->name, 0) != 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error channel already used");
|
||||
DEBUG_CHANNELS("error channel already used");
|
||||
return CHANNEL_RC_BAD_CHANNEL;
|
||||
}
|
||||
}
|
||||
@ -343,7 +341,7 @@ static uint32 FREERDP_CC MyVirtualChannelInit(void** ppInitHandle, PCHANNEL_DEF
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_CHANMAN("warning more than 16 channels");
|
||||
DEBUG_CHANNELS("warning more than 16 channels");
|
||||
}
|
||||
chan_man->num_chans++;
|
||||
}
|
||||
@ -357,36 +355,36 @@ static uint32 FREERDP_CC MyVirtualChannelInit(void** ppInitHandle, PCHANNEL_DEF
|
||||
static uint32 FREERDP_CC MyVirtualChannelOpen(void* pInitHandle, uint32* pOpenHandle,
|
||||
char* pChannelName, PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChannels* chan_man;
|
||||
int index;
|
||||
struct chan_data* lchan;
|
||||
struct channel_data* lchan;
|
||||
|
||||
DEBUG_CHANMAN("enter");
|
||||
DEBUG_CHANNELS("enter");
|
||||
chan_man = ((rdpInitHandle*)pInitHandle)->chan_man;
|
||||
if (pOpenHandle == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad chanhan");
|
||||
DEBUG_CHANNELS("error bad chanhan");
|
||||
return CHANNEL_RC_BAD_CHANNEL_HANDLE;
|
||||
}
|
||||
if (pChannelOpenEventProc == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad proc");
|
||||
DEBUG_CHANNELS("error bad proc");
|
||||
return CHANNEL_RC_BAD_PROC;
|
||||
}
|
||||
if (!chan_man->is_connected)
|
||||
{
|
||||
DEBUG_CHANMAN("error not connected");
|
||||
DEBUG_CHANNELS("error not connected");
|
||||
return CHANNEL_RC_NOT_CONNECTED;
|
||||
}
|
||||
lchan = freerdp_chanman_find_chan_data_by_name(chan_man, pChannelName, &index);
|
||||
lchan = freerdp_channels_find_channel_data_by_name(chan_man, pChannelName, &index);
|
||||
if (lchan == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error chan name");
|
||||
DEBUG_CHANNELS("error chan name");
|
||||
return CHANNEL_RC_UNKNOWN_CHANNEL_NAME;
|
||||
}
|
||||
if (lchan->flags == 2)
|
||||
{
|
||||
DEBUG_CHANMAN("error chan already open");
|
||||
DEBUG_CHANNELS("error chan already open");
|
||||
return CHANNEL_RC_ALREADY_OPEN;
|
||||
}
|
||||
|
||||
@ -402,21 +400,21 @@ static uint32 FREERDP_CC MyVirtualChannelOpen(void* pInitHandle, uint32* pOpenHa
|
||||
*/
|
||||
static uint32 FREERDP_CC MyVirtualChannelClose(uint32 openHandle)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
struct chan_data* lchan;
|
||||
rdpChannels* chan_man;
|
||||
struct channel_data* lchan;
|
||||
int index;
|
||||
|
||||
DEBUG_CHANMAN("enter");
|
||||
chan_man = freerdp_chanman_find_by_open_handle(openHandle, &index);
|
||||
DEBUG_CHANNELS("enter");
|
||||
chan_man = freerdp_channels_find_by_open_handle(openHandle, &index);
|
||||
if ((chan_man == NULL) || (index < 0) || (index >= CHANNEL_MAX_COUNT))
|
||||
{
|
||||
DEBUG_CHANMAN("error bad chanhan");
|
||||
DEBUG_CHANNELS("error bad chanhan");
|
||||
return CHANNEL_RC_BAD_CHANNEL_HANDLE;
|
||||
}
|
||||
lchan = chan_man->chans + index;
|
||||
if (lchan->flags != 2)
|
||||
{
|
||||
DEBUG_CHANMAN("error not open");
|
||||
DEBUG_CHANNELS("error not open");
|
||||
return CHANNEL_RC_NOT_OPEN;
|
||||
}
|
||||
lchan->flags = 0;
|
||||
@ -427,43 +425,43 @@ static uint32 FREERDP_CC MyVirtualChannelClose(uint32 openHandle)
|
||||
static uint32 FREERDP_CC MyVirtualChannelWrite(uint32 openHandle, void* pData, uint32 dataLength,
|
||||
void* pUserData)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
struct chan_data* lchan;
|
||||
rdpChannels* chan_man;
|
||||
struct channel_data* lchan;
|
||||
struct sync_data* item;
|
||||
int index;
|
||||
|
||||
chan_man = freerdp_chanman_find_by_open_handle(openHandle, &index);
|
||||
chan_man = freerdp_channels_find_by_open_handle(openHandle, &index);
|
||||
if ((chan_man == NULL) || (index < 0) || (index >= CHANNEL_MAX_COUNT))
|
||||
{
|
||||
DEBUG_CHANMAN("error bad chanhan");
|
||||
DEBUG_CHANNELS("error bad chanhan");
|
||||
return CHANNEL_RC_BAD_CHANNEL_HANDLE;
|
||||
}
|
||||
if (!chan_man->is_connected)
|
||||
{
|
||||
DEBUG_CHANMAN("error not connected");
|
||||
DEBUG_CHANNELS("error not connected");
|
||||
return CHANNEL_RC_NOT_CONNECTED;
|
||||
}
|
||||
if (pData == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad pData");
|
||||
DEBUG_CHANNELS("error bad pData");
|
||||
return CHANNEL_RC_NULL_DATA;
|
||||
}
|
||||
if (dataLength == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad dataLength");
|
||||
DEBUG_CHANNELS("error bad dataLength");
|
||||
return CHANNEL_RC_ZERO_LENGTH;
|
||||
}
|
||||
lchan = chan_man->chans + index;
|
||||
if (lchan->flags != 2)
|
||||
{
|
||||
DEBUG_CHANMAN("error not open");
|
||||
DEBUG_CHANNELS("error not open");
|
||||
return CHANNEL_RC_NOT_OPEN;
|
||||
}
|
||||
freerdp_mutex_lock(chan_man->sync_data_mutex); /* lock chan_man->sync* vars */
|
||||
freerdp_mutex_lock(chan_man->sync_data_mutex); /* lock channels->sync* vars */
|
||||
if (!chan_man->is_connected)
|
||||
{
|
||||
freerdp_mutex_unlock(chan_man->sync_data_mutex);
|
||||
DEBUG_CHANMAN("error not connected");
|
||||
DEBUG_CHANNELS("error not connected");
|
||||
return CHANNEL_RC_NOT_CONNECTED;
|
||||
}
|
||||
item = xnew(struct sync_data);
|
||||
@ -482,37 +480,37 @@ static uint32 FREERDP_CC MyVirtualChannelWrite(uint32 openHandle, void* pData, u
|
||||
|
||||
static uint32 FREERDP_CC MyVirtualChannelEventPush(uint32 openHandle, RDP_EVENT* event)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
struct chan_data* lchan;
|
||||
rdpChannels* chan_man;
|
||||
struct channel_data* lchan;
|
||||
int index;
|
||||
|
||||
chan_man = freerdp_chanman_find_by_open_handle(openHandle, &index);
|
||||
chan_man = freerdp_channels_find_by_open_handle(openHandle, &index);
|
||||
if ((chan_man == NULL) || (index < 0) || (index >= CHANNEL_MAX_COUNT))
|
||||
{
|
||||
DEBUG_CHANMAN("error bad chanhan");
|
||||
DEBUG_CHANNELS("error bad chanhan");
|
||||
return CHANNEL_RC_BAD_CHANNEL_HANDLE;
|
||||
}
|
||||
if (!chan_man->is_connected)
|
||||
{
|
||||
DEBUG_CHANMAN("error not connected");
|
||||
DEBUG_CHANNELS("error not connected");
|
||||
return CHANNEL_RC_NOT_CONNECTED;
|
||||
}
|
||||
if (event == NULL)
|
||||
{
|
||||
DEBUG_CHANMAN("error bad event");
|
||||
DEBUG_CHANNELS("error bad event");
|
||||
return CHANNEL_RC_NULL_DATA;
|
||||
}
|
||||
lchan = chan_man->chans + index;
|
||||
if (lchan->flags != 2)
|
||||
{
|
||||
DEBUG_CHANMAN("error not open");
|
||||
DEBUG_CHANNELS("error not open");
|
||||
return CHANNEL_RC_NOT_OPEN;
|
||||
}
|
||||
freerdp_sem_wait(chan_man->event_sem); /* lock chan_man->event */
|
||||
freerdp_sem_wait(chan_man->event_sem); /* lock channels->event */
|
||||
if (!chan_man->is_connected)
|
||||
{
|
||||
freerdp_sem_signal(chan_man->event_sem);
|
||||
DEBUG_CHANMAN("error not connected");
|
||||
DEBUG_CHANNELS("error not connected");
|
||||
return CHANNEL_RC_NOT_CONNECTED;
|
||||
}
|
||||
chan_man->event = event;
|
||||
@ -526,10 +524,10 @@ static uint32 FREERDP_CC MyVirtualChannelEventPush(uint32 openHandle, RDP_EVENT*
|
||||
* before any other function in the file
|
||||
* called only from main thread
|
||||
*/
|
||||
int freerdp_chanman_global_init(void)
|
||||
int freerdp_channels_global_init(void)
|
||||
{
|
||||
g_init_chan_man = NULL;
|
||||
g_chan_man_list = NULL;
|
||||
g_channels_list = NULL;
|
||||
g_open_handle_sequence = 1;
|
||||
g_mutex_init = freerdp_mutex_new();
|
||||
g_mutex_list = freerdp_mutex_new();
|
||||
@ -537,10 +535,10 @@ int freerdp_chanman_global_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int freerdp_chanman_global_uninit(void)
|
||||
int freerdp_channels_global_uninit(void)
|
||||
{
|
||||
while (g_chan_man_list)
|
||||
freerdp_chanman_free(g_chan_man_list->chan_man);
|
||||
while (g_channels_list)
|
||||
freerdp_channels_free(g_channels_list->channels);
|
||||
|
||||
freerdp_mutex_free(g_mutex_init);
|
||||
freerdp_mutex_free(g_mutex_list);
|
||||
@ -548,12 +546,12 @@ int freerdp_chanman_global_uninit(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
rdpChanMan* freerdp_chanman_new(void)
|
||||
rdpChannels* freerdp_channels_new(void)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChanManList* list;
|
||||
rdpChannels* chan_man;
|
||||
rdpChannelsList* list;
|
||||
|
||||
chan_man = xnew(rdpChanMan);
|
||||
chan_man = xnew(rdpChannels);
|
||||
|
||||
chan_man->sync_data_mutex = freerdp_mutex_new();
|
||||
chan_man->sync_data_list = list_new();
|
||||
@ -562,21 +560,21 @@ rdpChanMan* freerdp_chanman_new(void)
|
||||
chan_man->signal = wait_obj_new();
|
||||
|
||||
/* Add it to the global list */
|
||||
list = xnew(rdpChanManList);
|
||||
list->chan_man = chan_man;
|
||||
list = xnew(rdpChannelsList);
|
||||
list->channels = chan_man;
|
||||
|
||||
freerdp_mutex_lock(g_mutex_list);
|
||||
list->next = g_chan_man_list;
|
||||
g_chan_man_list = list;
|
||||
list->next = g_channels_list;
|
||||
g_channels_list = list;
|
||||
freerdp_mutex_unlock(g_mutex_list);
|
||||
|
||||
return chan_man;
|
||||
}
|
||||
|
||||
void freerdp_chanman_free(rdpChanMan * chan_man)
|
||||
void freerdp_channels_free(rdpChannels * chan_man)
|
||||
{
|
||||
rdpChanManList* list;
|
||||
rdpChanManList* prev;
|
||||
rdpChannelsList* list;
|
||||
rdpChannelsList* prev;
|
||||
|
||||
freerdp_mutex_free(chan_man->sync_data_mutex);
|
||||
list_free(chan_man->sync_data_list);
|
||||
@ -586,9 +584,9 @@ void freerdp_chanman_free(rdpChanMan * chan_man)
|
||||
|
||||
/* Remove from global list */
|
||||
freerdp_mutex_lock(g_mutex_list);
|
||||
for (prev = NULL, list = g_chan_man_list; list; prev = list, list = list->next)
|
||||
for (prev = NULL, list = g_channels_list; list; prev = list, list = list->next)
|
||||
{
|
||||
if (list->chan_man == chan_man)
|
||||
if (list->channels == chan_man)
|
||||
break;
|
||||
}
|
||||
if (list)
|
||||
@ -596,7 +594,7 @@ void freerdp_chanman_free(rdpChanMan * chan_man)
|
||||
if (prev)
|
||||
prev->next = list->next;
|
||||
else
|
||||
g_chan_man_list = list->next;
|
||||
g_channels_list = list->next;
|
||||
xfree(list);
|
||||
}
|
||||
freerdp_mutex_unlock(g_mutex_list);
|
||||
@ -608,24 +606,24 @@ void freerdp_chanman_free(rdpChanMan * chan_man)
|
||||
* this is called when processing the command line parameters
|
||||
* called only from main thread
|
||||
*/
|
||||
int freerdp_chanman_load_plugin(rdpChanMan* chan_man, rdpSettings* settings,
|
||||
int freerdp_channels_load_plugin(rdpChannels* chan_man, rdpSettings* settings,
|
||||
const char* name, void* data)
|
||||
{
|
||||
struct lib_data* lib;
|
||||
CHANNEL_ENTRY_POINTS_EX ep;
|
||||
int ok;
|
||||
|
||||
DEBUG_CHANMAN("%s", name);
|
||||
DEBUG_CHANNELS("%s", name);
|
||||
if (chan_man->num_libs + 1 >= CHANNEL_MAX_COUNT)
|
||||
{
|
||||
DEBUG_CHANMAN("too many channels");
|
||||
DEBUG_CHANNELS("too many channels");
|
||||
return 1;
|
||||
}
|
||||
lib = chan_man->libs + chan_man->num_libs;
|
||||
lib->entry = (PVIRTUALCHANNELENTRY)freerdp_load_plugin(name, CHANNEL_EXPORT_FUNC_NAME);
|
||||
if (lib->entry == NULL)
|
||||
{
|
||||
DEBUG_CHANMAN("failed to find export function");
|
||||
DEBUG_CHANNELS("failed to find export function");
|
||||
return 1;
|
||||
}
|
||||
ep.cbSize = sizeof(ep);
|
||||
@ -652,7 +650,7 @@ int freerdp_chanman_load_plugin(rdpChanMan* chan_man, rdpSettings* settings,
|
||||
chan_man->can_call_init = 0;
|
||||
if (!ok)
|
||||
{
|
||||
DEBUG_CHANMAN("export function call failed");
|
||||
DEBUG_CHANNELS("export function call failed");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -662,14 +660,14 @@ int freerdp_chanman_load_plugin(rdpChanMan* chan_man, rdpSettings* settings,
|
||||
* go through and inform all the libraries that we are initialized
|
||||
* called only from main thread
|
||||
*/
|
||||
int freerdp_chanman_pre_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
int freerdp_channels_pre_connect(rdpChannels* chan_man, freerdp* instance)
|
||||
{
|
||||
int index;
|
||||
struct lib_data* llib;
|
||||
CHANNEL_DEF lchannel_def;
|
||||
void* dummy;
|
||||
|
||||
DEBUG_CHANMAN("enter");
|
||||
DEBUG_CHANNELS("enter");
|
||||
chan_man->instance = instance;
|
||||
|
||||
/**
|
||||
@ -677,8 +675,8 @@ int freerdp_chanman_pre_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
* rdpdr channel to make sound work. This is a workaround for Window 7 and
|
||||
* Windows 2008
|
||||
*/
|
||||
if (freerdp_chanman_find_chan_data_by_name(chan_man, "rdpsnd", 0) != 0 &&
|
||||
freerdp_chanman_find_chan_data_by_name(chan_man, "rdpdr", 0) == 0)
|
||||
if (freerdp_channels_find_channel_data_by_name(chan_man, "rdpsnd", 0) != 0 &&
|
||||
freerdp_channels_find_channel_data_by_name(chan_man, "rdpdr", 0) == 0)
|
||||
{
|
||||
lchannel_def.options = CHANNEL_OPTION_INITIALIZED |
|
||||
CHANNEL_OPTION_ENCRYPT_RDP;
|
||||
@ -693,7 +691,7 @@ int freerdp_chanman_pre_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
freerdp_mutex_unlock(g_mutex_init);
|
||||
chan_man->can_call_init = 0;
|
||||
chan_man->settings = 0;
|
||||
DEBUG_CHANMAN("registered fake rdpdr for rdpsnd.");
|
||||
DEBUG_CHANNELS("registered fake rdpdr for rdpsnd.");
|
||||
}
|
||||
|
||||
for (index = 0; index < chan_man->num_libs; index++)
|
||||
@ -713,7 +711,7 @@ int freerdp_chanman_pre_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
* this will tell the libraries that its ok to call MyVirtualChannelOpen
|
||||
* called only from main thread
|
||||
*/
|
||||
int freerdp_chanman_post_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
int freerdp_channels_post_connect(rdpChannels* chan_man, freerdp* instance)
|
||||
{
|
||||
int index;
|
||||
struct lib_data* llib;
|
||||
@ -723,8 +721,8 @@ int freerdp_chanman_post_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
chan_man->is_connected = 1;
|
||||
hostname = instance->settings->hostname;
|
||||
hostname_len = strlen(hostname);
|
||||
DEBUG_CHANMAN("hostname [%s] chan_man->num_libs [%d]",
|
||||
hostname, chan_man->num_libs);
|
||||
DEBUG_CHANNELS("hostname [%s] channels->num_libs [%d]",
|
||||
hostname, channels->num_libs);
|
||||
for (index = 0; index < chan_man->num_libs; index++)
|
||||
{
|
||||
llib = chan_man->libs + index;
|
||||
@ -741,33 +739,33 @@ int freerdp_chanman_post_connect(rdpChanMan* chan_man, freerdp* instance)
|
||||
* data comming from the server to the client
|
||||
* called only from main thread
|
||||
*/
|
||||
int freerdp_chanman_data(freerdp* instance, int chan_id, void* data, int data_size,
|
||||
int freerdp_channels_data(freerdp* instance, int channel_id, void* data, int data_size,
|
||||
int flags, int total_size)
|
||||
{
|
||||
rdpChanMan* chan_man;
|
||||
rdpChan* lrdp_chan;
|
||||
struct chan_data* lchan_data;
|
||||
rdpChannels* chan_man;
|
||||
rdpChannel* lrdp_chan;
|
||||
struct channel_data* lchan_data;
|
||||
int index;
|
||||
|
||||
chan_man = freerdp_chanman_find_by_rdp_inst(instance);
|
||||
chan_man = freerdp_channels_find_by_instance(instance);
|
||||
if (chan_man == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("could not find channel manager");
|
||||
DEBUG_CHANNELS("could not find channel manager");
|
||||
return 1;
|
||||
}
|
||||
|
||||
lrdp_chan = freerdp_chanman_find_rdp_chan_by_id(chan_man, instance->settings,
|
||||
chan_id, &index);
|
||||
lrdp_chan = freerdp_channels_find_channel_by_id(chan_man, instance->settings,
|
||||
channel_id, &index);
|
||||
if (lrdp_chan == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("could not find channel id");
|
||||
DEBUG_CHANNELS("could not find channel id");
|
||||
return 1;
|
||||
}
|
||||
lchan_data = freerdp_chanman_find_chan_data_by_name(chan_man, lrdp_chan->name,
|
||||
lchan_data = freerdp_channels_find_channel_data_by_name(chan_man, lrdp_chan->name,
|
||||
&index);
|
||||
if (lchan_data == 0)
|
||||
{
|
||||
DEBUG_CHANMAN("could not find channel name");
|
||||
DEBUG_CHANNELS("could not find channel name");
|
||||
return 1;
|
||||
}
|
||||
if (lchan_data->open_event_proc != 0)
|
||||
@ -791,26 +789,26 @@ static const char* event_class_to_name_table[] =
|
||||
/**
|
||||
* Send a plugin-defined event to the plugin.
|
||||
* called only from main thread
|
||||
* @param chan_man the channel manager instance
|
||||
* @param channels the channel manager instance
|
||||
* @param event an event object created by freerdp_event_new()
|
||||
*/
|
||||
FREERDP_API int freerdp_chanman_send_event(rdpChanMan* chan_man, RDP_EVENT* event)
|
||||
FREERDP_API int freerdp_channels_send_event(rdpChannels* chan_man, RDP_EVENT* event)
|
||||
{
|
||||
struct chan_data* lchan_data;
|
||||
struct channel_data* lchan_data;
|
||||
int index;
|
||||
const char* name;
|
||||
|
||||
name = event_class_to_name_table[event->event_class];
|
||||
if (name == NULL)
|
||||
{
|
||||
DEBUG_CHANMAN("unknown event_class %d", event->event_class);
|
||||
DEBUG_CHANNELS("unknown event_class %d", event->event_class);
|
||||
return 1;
|
||||
}
|
||||
|
||||
lchan_data = freerdp_chanman_find_chan_data_by_name(chan_man, name, &index);
|
||||
lchan_data = freerdp_channels_find_channel_data_by_name(chan_man, name, &index);
|
||||
if (lchan_data == NULL)
|
||||
{
|
||||
DEBUG_CHANMAN("could not find channel name %s", name);
|
||||
DEBUG_CHANNELS("could not find channel name %s", name);
|
||||
return 1;
|
||||
}
|
||||
if (lchan_data->open_event_proc != NULL)
|
||||
@ -825,10 +823,10 @@ FREERDP_API int freerdp_chanman_send_event(rdpChanMan* chan_man, RDP_EVENT* even
|
||||
/**
|
||||
* called only from main thread
|
||||
*/
|
||||
static void freerdp_chanman_process_sync(rdpChanMan* chan_man, freerdp* instance)
|
||||
static void freerdp_channels_process_sync(rdpChannels* chan_man, freerdp* instance)
|
||||
{
|
||||
struct chan_data* lchan_data;
|
||||
rdpChan* lrdp_chan;
|
||||
struct channel_data* lchan_data;
|
||||
rdpChannel* lrdp_chan;
|
||||
struct sync_data* item;
|
||||
|
||||
while (chan_man->sync_data_list->head != NULL)
|
||||
@ -838,11 +836,11 @@ static void freerdp_chanman_process_sync(rdpChanMan* chan_man, freerdp* instance
|
||||
freerdp_mutex_unlock(chan_man->sync_data_mutex);
|
||||
|
||||
lchan_data = chan_man->chans + item->index;
|
||||
lrdp_chan = freerdp_chanman_find_rdp_chan_by_name(chan_man, instance->settings,
|
||||
lrdp_chan = freerdp_channels_find_channel_by_name(chan_man, instance->settings,
|
||||
lchan_data->name, &item->index);
|
||||
if (lrdp_chan != NULL)
|
||||
{
|
||||
IFCALL(instance->SendChannelData, instance, lrdp_chan->chan_id, item->data, item->data_length);
|
||||
IFCALL(instance->SendChannelData, instance, lrdp_chan->channel_id, item->data, item->data_length);
|
||||
}
|
||||
if (lchan_data->open_event_proc != 0)
|
||||
{
|
||||
@ -857,7 +855,7 @@ static void freerdp_chanman_process_sync(rdpChanMan* chan_man, freerdp* instance
|
||||
/**
|
||||
* called only from main thread
|
||||
*/
|
||||
boolean freerdp_chanman_get_fds(rdpChanMan* chan_man, freerdp* instance, void** read_fds,
|
||||
boolean freerdp_channels_get_fds(rdpChannels* chan_man, freerdp* instance, void** read_fds,
|
||||
int* read_count, void** write_fds, int* write_count)
|
||||
{
|
||||
wait_obj_get_fds(chan_man->signal, read_fds, read_count);
|
||||
@ -867,36 +865,40 @@ boolean freerdp_chanman_get_fds(rdpChanMan* chan_man, freerdp* instance, void**
|
||||
/**
|
||||
* called only from main thread
|
||||
*/
|
||||
boolean freerdp_chanman_check_fds(rdpChanMan * chan_man, freerdp* instance)
|
||||
boolean freerdp_channels_check_fds(rdpChannels * chan_man, freerdp* instance)
|
||||
{
|
||||
if (wait_obj_is_set(chan_man->signal))
|
||||
{
|
||||
wait_obj_clear(chan_man->signal);
|
||||
freerdp_chanman_process_sync(chan_man, instance);
|
||||
freerdp_channels_process_sync(chan_man, instance);
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
RDP_EVENT* freerdp_chanman_pop_event(rdpChanMan* chan_man)
|
||||
RDP_EVENT* freerdp_channels_pop_event(rdpChannels* chan_man)
|
||||
{
|
||||
RDP_EVENT* event;
|
||||
|
||||
if (chan_man->event == NULL)
|
||||
return NULL;
|
||||
|
||||
event = chan_man->event;
|
||||
chan_man->event = NULL;
|
||||
freerdp_sem_signal(chan_man->event_sem); /* release chan_man->event */
|
||||
|
||||
freerdp_sem_signal(chan_man->event_sem); /* release channels->event */
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
void freerdp_chanman_close(rdpChanMan* chan_man, freerdp* instance)
|
||||
void freerdp_channels_close(rdpChannels* chan_man, freerdp* instance)
|
||||
{
|
||||
int index;
|
||||
struct lib_data* llib;
|
||||
|
||||
DEBUG_CHANMAN("closing");
|
||||
DEBUG_CHANNELS("closing");
|
||||
chan_man->is_connected = 0;
|
||||
freerdp_chanman_check_fds(chan_man, instance);
|
||||
freerdp_channels_check_fds(chan_man, instance);
|
||||
/* tell all libraries we are shutting down */
|
||||
for (index = 0; index < chan_man->num_libs; index++)
|
||||
{
|
@ -18,15 +18,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __LIBCHANMAN_H
|
||||
#define __LIBCHANMAN_H
|
||||
#ifndef __LIBCHANNELS_H
|
||||
#define __LIBCHANNELS_H
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
|
||||
#ifdef WITH_DEBUG_CHANMAN
|
||||
#define DEBUG_CHANMAN(fmt, ...) DEBUG_CLASS(CHANMAN, fmt, ## __VA_ARGS__)
|
||||
#ifdef WITH_DEBUG_CHANNELS
|
||||
#define DEBUG_CHANNELS(fmt, ...) DEBUG_CLASS(CHANNELS, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_CHANMAN(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_CHANNELS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* __LIBCHANMAN_H */
|
||||
#endif /* __LIBCHANNELS_H */
|
@ -34,11 +34,11 @@ boolean freerdp_channel_send(freerdp* instance, uint16 channel_id, uint8* data,
|
||||
uint32 flags;
|
||||
int i, left;
|
||||
int chunk_size;
|
||||
rdpChan* channel = NULL;
|
||||
rdpChannel* channel = NULL;
|
||||
|
||||
for (i = 0; i < instance->settings->num_channels; i++)
|
||||
{
|
||||
if (instance->settings->channels[i].chan_id == channel_id)
|
||||
if (instance->settings->channels[i].channel_id == channel_id)
|
||||
{
|
||||
channel = &instance->settings->channels[i];
|
||||
break;
|
||||
|
@ -272,7 +272,7 @@ boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
|
||||
|
||||
if (rdp->settings->num_channels > 0)
|
||||
{
|
||||
if (!mcs_send_channel_join_request(rdp->mcs, rdp->settings->channels[0].chan_id))
|
||||
if (!mcs_send_channel_join_request(rdp->mcs, rdp->settings->channels[0].channel_id))
|
||||
return False;
|
||||
|
||||
all_joined = False;
|
||||
@ -285,7 +285,7 @@ boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
|
||||
if (rdp->settings->channels[i].joined)
|
||||
continue;
|
||||
|
||||
if (rdp->settings->channels[i].chan_id != channel_id)
|
||||
if (rdp->settings->channels[i].channel_id != channel_id)
|
||||
return False;
|
||||
|
||||
rdp->settings->channels[i].joined = True;
|
||||
@ -293,7 +293,7 @@ boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
|
||||
}
|
||||
if (i + 1 < rdp->settings->num_channels)
|
||||
{
|
||||
if (!mcs_send_channel_join_request(rdp->mcs, rdp->settings->channels[i + 1].chan_id))
|
||||
if (!mcs_send_channel_join_request(rdp->mcs, rdp->settings->channels[i + 1].channel_id))
|
||||
return False;
|
||||
|
||||
all_joined = False;
|
||||
@ -513,7 +513,7 @@ boolean rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, STREAM* s)
|
||||
|
||||
for (i = 0; i < rdp->settings->num_channels; i++)
|
||||
{
|
||||
if (rdp->settings->channels[i].chan_id == channel_id)
|
||||
if (rdp->settings->channels[i].channel_id == channel_id)
|
||||
rdp->settings->channels[i].joined = True;
|
||||
|
||||
if (!rdp->settings->channels[i].joined)
|
||||
|
@ -859,7 +859,7 @@ boolean gcc_read_client_network_data(STREAM* s, rdpSettings *settings, uint16 bl
|
||||
/* CHANNEL_DEF */
|
||||
stream_read(s, settings->channels[i].name, 8); /* name (8 bytes) */
|
||||
stream_read_uint32(s, settings->channels[i].options); /* options (4 bytes) */
|
||||
settings->channels[i].chan_id = MCS_GLOBAL_CHANNEL_ID + 1 + i;
|
||||
settings->channels[i].channel_id = MCS_GLOBAL_CHANNEL_ID + 1 + i;
|
||||
}
|
||||
|
||||
return True;
|
||||
@ -913,7 +913,7 @@ boolean gcc_read_server_network_data(STREAM* s, rdpSettings *settings)
|
||||
for (i = 0; i < channelCount; i++)
|
||||
{
|
||||
stream_read_uint16(s, channelId); /* channelId */
|
||||
settings->channels[i].chan_id = channelId;
|
||||
settings->channels[i].channel_id = channelId;
|
||||
}
|
||||
|
||||
if (channelCount % 2 == 1)
|
||||
@ -933,7 +933,7 @@ void gcc_write_server_network_data(STREAM* s, rdpSettings *settings)
|
||||
|
||||
for (i = 0; i < settings->num_channels; i++)
|
||||
{
|
||||
stream_write_uint16(s, settings->channels[i].chan_id);
|
||||
stream_write_uint16(s, settings->channels[i].channel_id);
|
||||
}
|
||||
|
||||
if (settings->num_channels % 2 == 1)
|
||||
|
Loading…
Reference in New Issue
Block a user