~ubuntu-branches/ubuntu/vivid/freerdp/vivid

« back to all changes in this revision

Viewing changes to channels/rdpdbg/rdpdbg_main.c

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-11-11 12:20:50 UTC
  • mfrom: (1.2.5)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20141111122050-7z628f4ab38qxad5
Tags: upstream-1.1.0~git20140921.1.440916e+dfsg1
ImportĀ upstreamĀ versionĀ 1.1.0~git20140921.1.440916e+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * FreeRDP: A Remote Desktop Protocol client.
3
 
 * Debugging Virtual Channel
4
 
 *
5
 
 * Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6
 
 * Copyright 2011 Vic Lee
7
 
 *
8
 
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 
 * you may not use this file except in compliance with the License.
10
 
 * You may obtain a copy of the License at
11
 
 *
12
 
 *     http://www.apache.org/licenses/LICENSE-2.0
13
 
 *
14
 
 * Unless required by applicable law or agreed to in writing, software
15
 
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 
 * See the License for the specific language governing permissions and
18
 
 * limitations under the License.
19
 
 */
20
 
 
21
 
#include <stdio.h>
22
 
#include <stdlib.h>
23
 
#include <string.h>
24
 
#include <freerdp/constants.h>
25
 
#include <freerdp/types.h>
26
 
#include <freerdp/utils/memory.h>
27
 
#include <freerdp/utils/svc_plugin.h>
28
 
 
29
 
typedef struct rdpdbg_plugin rdpdbgPlugin;
30
 
struct rdpdbg_plugin
31
 
{
32
 
        rdpSvcPlugin plugin;
33
 
};
34
 
 
35
 
static void rdpdbg_process_connect(rdpSvcPlugin* plugin)
36
 
{
37
 
        DEBUG_WARN("connecting");
38
 
}
39
 
 
40
 
static void rdpdbg_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
41
 
{
42
 
        STREAM* data_out;
43
 
 
44
 
        DEBUG_WARN("size %d", stream_get_size(data_in));
45
 
        stream_free(data_in);
46
 
 
47
 
        data_out = stream_new(8);
48
 
        stream_write(data_out, "senddata", 8);
49
 
        svc_plugin_send(plugin, data_out);
50
 
}
51
 
 
52
 
static void rdpdbg_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
53
 
{
54
 
        DEBUG_WARN("event_type %d", event->event_type);
55
 
        freerdp_event_free(event);
56
 
 
57
 
        event = freerdp_event_new(RDP_EVENT_CLASS_DEBUG, 0, NULL, NULL);
58
 
        svc_plugin_send_event(plugin, event);
59
 
}
60
 
 
61
 
static void rdpdbg_process_terminate(rdpSvcPlugin* plugin)
62
 
{
63
 
        DEBUG_WARN("terminating");
64
 
        xfree(plugin);
65
 
}
66
 
 
67
 
DEFINE_SVC_PLUGIN(rdpdbg, "rdpdbg",
68
 
        CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP |
69
 
        CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL)