2
* Copyright © 2012 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Ted Gould <ted@canonical.com>
19
#include <freerdp/freerdp.h>
20
#include <freerdp/channels/channels.h>
24
auth_context_new (freerdp * instance, rdpContext * context)
26
context->channels = freerdp_channels_new();
31
auth_context_free (freerdp * instance, rdpContext * context)
37
auth_pre_connect (freerdp * instance)
39
freerdp_channels_pre_connect(instance->context->channels, instance);
44
auth_post_connect (freerdp * instance)
46
freerdp_channels_post_connect(instance->context->channels, instance);
51
main (int argc, char * argv[])
55
printf("Not enough params");
59
if (scanf("%511s", password) != 1) {
63
freerdp_channels_global_init();
65
freerdp * instance = freerdp_new();
67
instance->PreConnect = auth_pre_connect;
68
instance->PostConnect = auth_post_connect;
70
instance->context_size = sizeof(rdpContext);
71
instance->ContextNew = auth_context_new;
72
instance->ContextFree = auth_context_free;
74
freerdp_context_new(instance);
76
instance->settings->hostname = argv[1];
77
instance->settings->username = argv[2];
78
instance->settings->domain = argv[3];
79
instance->settings->password = password;
80
instance->settings->ignore_certificate = true;
82
if (freerdp_connect(instance)) {
83
freerdp_disconnect(instance);