Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rdp.h « libfreerdp-core - github.com/FreeRDP/FreeRDP-old.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 15967763ad665382c93729317fac9a80d11825c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
   FreeRDP: A Remote Desktop Protocol client.
   Protocol services - RDP layer

   Copyright (C) Jay Sorg 2009-2011

   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 __RDP_H
#define __RDP_H

#include <time.h>
#include "stream.h"
#include <freerdp/types/ui.h>
#include <freerdp/utils/debug.h>
#include <freerdp/utils/unicode.h>
#include <freerdp/constants/constants.h>

typedef struct _systemTime
{
	uint16 wYear;
	uint16 wMonth;
	uint16 wDayOfWeek;
	uint16 wDay;
	uint16 wHour;
	uint16 wMinute;
	uint16 wSecond;
	uint16 wMilliseconds;

} systemTime;

typedef struct _RDPCOMP
{
	uint32 roff;
	uint8 hist[RDP_MPPC_DICT_SIZE];
	struct stream ns;
} RDPCOMP;

RD_BOOL
rdp_global_init(void);
void
rdp_global_finish(void);

#define MAX_BITMAP_CODECS 2

struct rdp_rdp
{
	uint8 * next_packet;
	uint32 rdp_serverid;
	uint32 rdp_shareid;
	uint32 packetno;
	STREAM rdp_s;
	int current_status;
	UNICONV *uniconv;
	RDPCOMP mppc_dict;
	struct rdp_sec * sec;
	struct rdp_network * net;
	struct rdp_set * settings;
	struct rdp_orders * orders;
	struct rdp_pcache * pcache;
	struct rdp_cache * cache;
	struct rdp_app * app;
	struct rdp_ext * ext;
	/* Session Directory redirection */
	int redirect;
	uint32 redirect_session_id;
	char* redirect_server;
	char* redirect_domain;
	char* redirect_password;
	uint32 redirect_password_len;
	char* redirect_username;
	char* redirect_routingtoken;
	uint32 redirect_routingtoken_len;
	char* redirect_target_fqdn;
	char* redirect_target_netbios_name;
	char* redirect_target_net_addresses;
	uint32 redirect_target_net_addresses_len;
	int input_flags;
	int use_input_fast_path;
	rdpInst * inst;
	void* buffer;
	size_t buffer_size;
	/* large pointers */
	int got_large_pointer_caps;
	int large_pointers;
	/* surface commands */
	int got_surface_commands_caps;
	int surface_commands;
	/* frame ack */
	int got_frame_ack_caps;
	int frame_ack;
	int send_frame_ack;
	/* fragment */
	int got_multifragmentupdate_caps;
	int multifragmentupdate_request_size;
	STREAM fragment_data;
	/* bitmap codecs */
	int got_bitmap_codecs_caps;
	STREAM out_codec_caps[MAX_BITMAP_CODECS];
};
typedef struct rdp_rdp rdpRdp;

int
mppc_expand(rdpRdp * rdp, uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen);
void
rdp5_process(rdpRdp * rdp, STREAM s);
void
rdp_send_input_scancode(rdpRdp * rdp, time_t time, RD_BOOL up, RD_BOOL extended, uint8 keyCode);
void
rdp_send_input_mouse(rdpRdp * rdp, time_t time, uint16 pointerFlags, uint16 xPos, uint16 yPos);
int
rdp_send_frame_ack(rdpRdp * rdp, int frame_id);
void
rdp_sync_input(rdpRdp * rdp, time_t time, uint32 toggle_keys_state);
void
rdp_send_input_unicode(rdpRdp * rdp, time_t time, uint16 unicode_character);
void
rdp_send_client_window_status(rdpRdp * rdp, int status);
void
process_color_pointer_pdu(rdpRdp * rdp, STREAM s);
void
process_cached_pointer_pdu(rdpRdp * rdp, STREAM s);
void
process_new_pointer_pdu(rdpRdp * rdp, STREAM s);
void
process_bitmap_updates(rdpRdp * rdp, STREAM s);
void
process_palette(rdpRdp * rdp, STREAM s);
void
rdp_main_loop(rdpRdp * rdp, RD_BOOL * deactivated, uint32 * ext_disc_reason);
RD_BOOL
rdp_loop(rdpRdp * rdp, RD_BOOL * deactivated);
RD_BOOL
rdp_connect(rdpRdp * rdp);
RD_BOOL
rdp_reconnect(rdpRdp * rdp);
void
rdp_disconnect(rdpRdp * rdp);
rdpRdp *
rdp_new(rdpSet * settings, rdpInst * inst);
void
rdp_free(rdpRdp * rdp);

#ifdef WITH_DEBUG_RDP
#define DEBUG_RDP(fmt, ...) DEBUG_CLASS(RDP, fmt, ## __VA_ARGS__)
#else
#define DEBUG_RDP(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif

#endif