Fix changelog email address
[freerdp-ubuntu-pcb-backport.git] / libfreerdp-core / fastpath.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Fast Path
4  *
5  * Copyright 2011 Vic Lee
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __FASTPATH_H
21 #define __FASTPATH_H
22
23 #include "rdp.h"
24 #include <freerdp/utils/stream.h>
25
26 typedef struct rdp_fastpath rdpFastPath;
27
28 enum FASTPATH_INPUT_ACTION_TYPE
29 {
30         FASTPATH_INPUT_ACTION_FASTPATH = 0x0,
31         FASTPATH_INPUT_ACTION_X224 = 0x3
32 };
33
34 enum FASTPATH_OUTPUT_ACTION_TYPE
35 {
36         FASTPATH_OUTPUT_ACTION_FASTPATH = 0x0,
37         FASTPATH_OUTPUT_ACTION_X224 = 0x3
38 };
39
40 enum FASTPATH_INPUT_ENCRYPTION_FLAGS
41 {
42         FASTPATH_INPUT_SECURE_CHECKSUM = 0x1,
43         FASTPATH_INPUT_ENCRYPTED = 0x2
44 };
45
46 enum FASTPATH_OUTPUT_ENCRYPTION_FLAGS
47 {
48         FASTPATH_OUTPUT_SECURE_CHECKSUM = 0x1,
49         FASTPATH_OUTPUT_ENCRYPTED = 0x2
50 };
51
52 enum FASTPATH_UPDATETYPE
53 {
54         FASTPATH_UPDATETYPE_ORDERS = 0x0,
55         FASTPATH_UPDATETYPE_BITMAP = 0x1,
56         FASTPATH_UPDATETYPE_PALETTE = 0x2,
57         FASTPATH_UPDATETYPE_SYNCHRONIZE = 0x3,
58         FASTPATH_UPDATETYPE_SURFCMDS = 0x4,
59         FASTPATH_UPDATETYPE_PTR_NULL = 0x5,
60         FASTPATH_UPDATETYPE_PTR_DEFAULT = 0x6,
61         FASTPATH_UPDATETYPE_PTR_POSITION = 0x8,
62         FASTPATH_UPDATETYPE_COLOR = 0x9,
63         FASTPATH_UPDATETYPE_CACHED = 0xA,
64         FASTPATH_UPDATETYPE_POINTER = 0xB
65 };
66
67 enum FASTPATH_FRAGMENT
68 {
69         FASTPATH_FRAGMENT_SINGLE = 0x0,
70         FASTPATH_FRAGMENT_LAST = 0x1,
71         FASTPATH_FRAGMENT_FIRST = 0x2,
72         FASTPATH_FRAGMENT_NEXT = 0x3
73 };
74
75 enum FASTPATH_OUTPUT_COMPRESSION
76 {
77         FASTPATH_OUTPUT_COMPRESSION_USED = 0x2
78 };
79
80 /* FastPath Input Events */
81 enum FASTPATH_INPUT_EVENT_CODE
82 {
83         FASTPATH_INPUT_EVENT_SCANCODE = 0x0,
84         FASTPATH_INPUT_EVENT_MOUSE = 0x1,
85         FASTPATH_INPUT_EVENT_MOUSEX = 0x2,
86         FASTPATH_INPUT_EVENT_SYNC = 0x3,
87         FASTPATH_INPUT_EVENT_UNICODE = 0x4
88 };
89
90 /* FastPath Keyboard Event Flags */
91 enum FASTPATH_INPUT_KBDFLAGS
92 {
93         FASTPATH_INPUT_KBDFLAGS_RELEASE = 0x01,
94         FASTPATH_INPUT_KBDFLAGS_EXTENDED = 0x02
95 };
96
97 struct rdp_fastpath
98 {
99         rdpRdp* rdp;
100         uint8 encryptionFlags;
101         uint8 numberEvents;
102         STREAM* updateData;
103 };
104
105 uint16 fastpath_header_length(STREAM* s);
106 uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s);
107 uint16 fastpath_read_header_rdp(rdpFastPath* fastpath, STREAM* s);
108 boolean fastpath_recv_updates(rdpFastPath* fastpath, STREAM* s);
109 boolean fastpath_recv_inputs(rdpFastPath* fastpath, STREAM* s);
110
111 STREAM* fastpath_input_pdu_init(rdpFastPath* fastpath, uint8 eventFlags, uint8 eventCode);
112 boolean fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s);
113
114 STREAM* fastpath_update_pdu_init(rdpFastPath* fastpath);
115 boolean fastpath_send_update_pdu(rdpFastPath* fastpath, uint8 updateCode, STREAM* s);
116
117 boolean fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAction, uint32 frameId);
118
119 rdpFastPath* fastpath_new(rdpRdp* rdp);
120 void fastpath_free(rdpFastPath* fastpath);
121
122 #endif