mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
client: migrate all clients to new command-line interface
This commit is contained in:
@@ -22,9 +22,10 @@
|
||||
#include <locale.h>
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/utils/args.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/client/file.h>
|
||||
#include <freerdp/client/cmdline.h>
|
||||
#include <freerdp/client/channels.h>
|
||||
#include <freerdp/client/cliprdr.h>
|
||||
|
||||
@@ -227,31 +228,10 @@ BOOL df_post_connect(freerdp* instance)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int df_process_plugin_args(rdpSettings* settings, const char* name,
|
||||
RDP_PLUGIN_DATA* plugin_data, void* user_data)
|
||||
{
|
||||
void* entry = NULL;
|
||||
rdpChannels* channels = (rdpChannels*) user_data;
|
||||
|
||||
entry = freerdp_channels_client_find_static_entry("VirtualChannelEntry", name);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
if (freerdp_channels_client_load(channels, settings, entry, plugin_data) == 0)
|
||||
{
|
||||
printf("loading channel %s (static)\n", name);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("loading channel %s (plugin)\n", name);
|
||||
freerdp_channels_load_plugin(channels, settings, name, plugin_data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL df_verify_certificate(freerdp* instance, char* subject, char* issuer, char* fingerprint)
|
||||
{
|
||||
char answer;
|
||||
|
||||
printf("Certificate details:\n");
|
||||
printf("\tSubject: %s\n", subject);
|
||||
printf("\tIssuer: %s\n", issuer);
|
||||
@@ -260,7 +240,6 @@ BOOL df_verify_certificate(freerdp* instance, char* subject, char* issuer, char*
|
||||
"the CA certificate in your certificate store, or the certificate has expired. "
|
||||
"Please look at the documentation on how to create local certificate store for a private CA.\n");
|
||||
|
||||
char answer;
|
||||
while (1)
|
||||
{
|
||||
printf("Do you trust the above certificate? (Y/N) ");
|
||||
@@ -451,6 +430,7 @@ void* thread_func(void* param)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int status;
|
||||
pthread_t thread;
|
||||
freerdp* instance;
|
||||
dfContext* context;
|
||||
@@ -478,7 +458,23 @@ int main(int argc, char* argv[])
|
||||
channels = instance->context->channels;
|
||||
|
||||
DirectFBInit(&argc, &argv);
|
||||
freerdp_parse_args(instance->settings, argc, argv, df_process_plugin_args, channels, NULL, NULL);
|
||||
|
||||
instance->context->argc = argc;
|
||||
instance->context->argv = argv;
|
||||
|
||||
if (freerdp_detect_old_command_line_syntax(instance->context->argc,instance->context->argv))
|
||||
{
|
||||
printf("warning: deprecated command-line syntax detected!\n");
|
||||
freerdp_client_print_command_line_help(argc, argv);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
status = freerdp_client_parse_command_line_arguments(argc, argv, instance->settings);
|
||||
|
||||
if (status < 0)
|
||||
exit(0);
|
||||
|
||||
freerdp_client_load_addins(instance->context->channels, instance->settings);
|
||||
|
||||
data = (struct thread_data*) malloc(sizeof(struct thread_data));
|
||||
ZeroMemory(data, sizeof(sizeof(struct thread_data)));
|
||||
|
||||
@@ -35,10 +35,12 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/gdi/gdi.h>
|
||||
#include <freerdp/utils/args.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/client/file.h>
|
||||
#include <freerdp/client/cmdline.h>
|
||||
#include <freerdp/client/cliprdr.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
|
||||
@@ -67,9 +69,6 @@ struct thread_data
|
||||
freerdp* instance;
|
||||
};
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/utils/args.h>
|
||||
|
||||
void tf_context_new(freerdp* instance, rdpContext* context)
|
||||
{
|
||||
context->channels = freerdp_channels_new();
|
||||
@@ -99,16 +98,6 @@ int tf_receive_channel_data(freerdp* instance, int channelId, BYTE* data, int si
|
||||
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)
|
||||
{
|
||||
rdpChannels* channels = (rdpChannels*) user_data;
|
||||
|
||||
printf("Load plugin %s\n", name);
|
||||
freerdp_channels_load_plugin(channels, settings, name, plugin_data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void tf_process_cb_monitor_ready_event(rdpChannels* channels, freerdp* instance)
|
||||
{
|
||||
RDP_EVENT* event;
|
||||
@@ -309,10 +298,11 @@ void* thread_func(void* param)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int status;
|
||||
pthread_t thread;
|
||||
freerdp* instance;
|
||||
struct thread_data* data;
|
||||
rdpChannels* channels;
|
||||
struct thread_data* data;
|
||||
|
||||
freerdp_channels_global_init();
|
||||
|
||||
@@ -329,7 +319,20 @@ int main(int argc, char* argv[])
|
||||
freerdp_context_new(instance);
|
||||
|
||||
channels = instance->context->channels;
|
||||
freerdp_parse_args(instance->settings, argc, argv, tf_process_plugin_args, channels, NULL, NULL);
|
||||
|
||||
if (freerdp_detect_old_command_line_syntax(instance->context->argc,instance->context->argv))
|
||||
{
|
||||
printf("warning: deprecated command-line syntax detected!\n");
|
||||
freerdp_client_print_command_line_help(argc, argv);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
status = freerdp_client_parse_command_line_arguments(argc, argv, instance->settings);
|
||||
|
||||
if (status < 0)
|
||||
exit(0);
|
||||
|
||||
freerdp_client_load_addins(instance->context->channels, instance->settings);
|
||||
|
||||
data = (struct thread_data*) malloc(sizeof(struct thread_data));
|
||||
ZeroMemory(data, sizeof(sizeof(struct thread_data)));
|
||||
|
||||
@@ -88,9 +88,6 @@ struct thread_data
|
||||
freerdp* instance;
|
||||
};
|
||||
|
||||
int xf_process_client_args(rdpSettings* settings, const char* opt, const char* val, void* user_data);
|
||||
int xf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data);
|
||||
|
||||
void xf_context_new(freerdp* instance, rdpContext* context)
|
||||
{
|
||||
context->channels = freerdp_channels_new();
|
||||
|
||||
Reference in New Issue
Block a user