2022-07-06 17:51:51 +00:00
|
|
|
|
/*
|
|
|
|
|
* arguments.c
|
|
|
|
|
*
|
|
|
|
|
* Created on: 6 июл. 2022 г.
|
|
|
|
|
* Author: alexander
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include "arguments.h"
|
2022-07-07 16:35:48 +00:00
|
|
|
|
#include "node_settings.h"
|
2022-07-06 17:51:51 +00:00
|
|
|
|
|
|
|
|
|
void settingsLoad()
|
|
|
|
|
{
|
|
|
|
|
settingsAddKey(PARAMETER_XFREERDP, "xfreerdp", false, true);
|
|
|
|
|
settingsAddKey(PARAMETER_SERVER, "/v:", true, true);
|
|
|
|
|
settingsAddKey(PARAMETER_USERNAME, "/u:", true, true);
|
|
|
|
|
settingsAddKey(PARAMETER_PASSWORD, "/p:", true, true);
|
|
|
|
|
settingsAddKey(PARAMETER_MULTIMONITOR, "/multimon", false, true);
|
|
|
|
|
settingsAddKey(PARAMETER_FULLSCREEN, "/f", false, true);
|
2022-07-07 16:35:48 +00:00
|
|
|
|
settingsAddKey(PARAMETER_AUTHENTICATION, "-authentication", false, true);
|
|
|
|
|
settingsAddKey(PARAMETER_SECURITY, "/sec:", false, true);
|
|
|
|
|
|
|
|
|
|
// settingsAddKey(PARAMETER_SECURITY_TLS, "-authentication", false, true);
|
|
|
|
|
// settingsAddKey(PARAMETER_SECURITY_RDP, "-authentication", false, true);
|
|
|
|
|
// settingsAddKey(PARAMETER_SECURITY_NLA, "-authentication", false, true);
|
|
|
|
|
// settingsAddKey(PARAMETER_SECURITY_EXT, "-authentication", false, true);
|
2022-07-06 17:51:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Arguments *buildArguments()
|
|
|
|
|
{
|
|
|
|
|
Arguments *args = (Arguments *)malloc(sizeof(Arguments));
|
|
|
|
|
args->argc = settings.countEnable;
|
|
|
|
|
args->argv = (char **)malloc(sizeof(char *) * settings.countEnable);
|
|
|
|
|
Node *head = settings.next;
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < settings.countEnable; head = head->next)
|
|
|
|
|
{
|
|
|
|
|
if (head->enable)
|
|
|
|
|
{
|
|
|
|
|
if (head->data->isValue)
|
|
|
|
|
{
|
|
|
|
|
args->argv[i++] = head->data->fullArgument;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
args->argv[i++] = head->data->key;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return args;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-07 16:35:48 +00:00
|
|
|
|
void freeArguments(Arguments *args)
|
2022-07-06 17:51:51 +00:00
|
|
|
|
{
|
2022-07-07 16:35:48 +00:00
|
|
|
|
free(args->argv);
|
|
|
|
|
free(args);
|
2022-07-06 17:51:51 +00:00
|
|
|
|
}
|