FreeRDP
rts_signature.h
1 
20 #ifndef FREERDP_LIB_CORE_GATEWAY_RTS_SIGNATURE_H
21 #define FREERDP_LIB_CORE_GATEWAY_RTS_SIGNATURE_H
22 
23 #include "rts.h"
24 
25 #include <winpr/wtypes.h>
26 #include <freerdp/api.h>
27 
28 typedef struct
29 {
30  UINT16 Flags;
31  UINT16 NumberOfCommands;
32  UINT32 CommandTypes[8];
34 
35 typedef struct
36 {
37  UINT32 SignatureId;
38  BOOL SignatureClient;
39  const RtsPduSignature* Signature;
40  const char* PduName;
42 
43 /* RTS PDU Signature IDs */
44 
45 #define RTS_PDU_CONN_A 0x10000000
46 #define RTS_PDU_CONN_A1 (RTS_PDU_CONN_A | 0x00000001)
47 #define RTS_PDU_CONN_A2 (RTS_PDU_CONN_A | 0x00000002)
48 #define RTS_PDU_CONN_A3 (RTS_PDU_CONN_A | 0x00000003)
49 
50 #define RTS_PDU_CONN_B 0x20000000
51 #define RTS_PDU_CONN_B1 (RTS_PDU_CONN_B | 0x00000001)
52 #define RTS_PDU_CONN_B2 (RTS_PDU_CONN_B | 0x00000002)
53 #define RTS_PDU_CONN_B3 (RTS_PDU_CONN_B | 0x00000003)
54 
55 #define RTS_PDU_CONN_C 0x40000000
56 #define RTS_PDU_CONN_C1 (RTS_PDU_CONN_C | 0x00000001)
57 #define RTS_PDU_CONN_C2 (RTS_PDU_CONN_C | 0x00000002)
58 
59 #define RTS_PDU_IN_R1_A 0x01000000
60 #define RTS_PDU_IN_R1_A1 (RTS_PDU_IN_R1_A | 0x00000001)
61 #define RTS_PDU_IN_R1_A2 (RTS_PDU_IN_R1_A | 0x00000002)
62 #define RTS_PDU_IN_R1_A3 (RTS_PDU_IN_R1_A | 0x00000003)
63 #define RTS_PDU_IN_R1_A4 (RTS_PDU_IN_R1_A | 0x00000004)
64 #define RTS_PDU_IN_R1_A5 (RTS_PDU_IN_R1_A | 0x00000005)
65 #define RTS_PDU_IN_R1_A6 (RTS_PDU_IN_R1_A | 0x00000006)
66 
67 #define RTS_PDU_IN_R1_B 0x02000000
68 #define RTS_PDU_IN_R1_B1 (RTS_PDU_IN_R1_B | 0x00000001)
69 #define RTS_PDU_IN_R1_B2 (RTS_PDU_IN_R1_B | 0x00000002)
70 
71 #define RTS_PDU_IN_R2_A 0x04000000
72 #define RTS_PDU_IN_R2_A1 (RTS_PDU_IN_R2_A | 0x00000001)
73 #define RTS_PDU_IN_R2_A2 (RTS_PDU_IN_R2_A | 0x00000002)
74 #define RTS_PDU_IN_R2_A3 (RTS_PDU_IN_R2_A | 0x00000003)
75 #define RTS_PDU_IN_R2_A4 (RTS_PDU_IN_R2_A | 0x00000004)
76 #define RTS_PDU_IN_R2_A5 (RTS_PDU_IN_R2_A | 0x00000005)
77 
78 #define RTS_PDU_OUT_R1_A 0x00100000
79 #define RTS_PDU_OUT_R1_A1 (RTS_PDU_OUT_R1_A | 0x00000001)
80 #define RTS_PDU_OUT_R1_A2 (RTS_PDU_OUT_R1_A | 0x00000002)
81 #define RTS_PDU_OUT_R1_A3 (RTS_PDU_OUT_R1_A | 0x00000003)
82 #define RTS_PDU_OUT_R1_A4 (RTS_PDU_OUT_R1_A | 0x00000004)
83 #define RTS_PDU_OUT_R1_A5 (RTS_PDU_OUT_R1_A | 0x00000005)
84 #define RTS_PDU_OUT_R1_A6 (RTS_PDU_OUT_R1_A | 0x00000006)
85 #define RTS_PDU_OUT_R1_A7 (RTS_PDU_OUT_R1_A | 0x00000007)
86 #define RTS_PDU_OUT_R1_A8 (RTS_PDU_OUT_R1_A | 0x00000008)
87 #define RTS_PDU_OUT_R1_A9 (RTS_PDU_OUT_R1_A | 0x00000009)
88 #define RTS_PDU_OUT_R1_A10 (RTS_PDU_OUT_R1_A | 0x0000000A)
89 #define RTS_PDU_OUT_R1_A11 (RTS_PDU_OUT_R1_A | 0x0000000B)
90 
91 #define RTS_PDU_OUT_R2_A 0x00200000
92 #define RTS_PDU_OUT_R2_A1 (RTS_PDU_OUT_R2_A | 0x00000001)
93 #define RTS_PDU_OUT_R2_A2 (RTS_PDU_OUT_R2_A | 0x00000002)
94 #define RTS_PDU_OUT_R2_A3 (RTS_PDU_OUT_R2_A | 0x00000003)
95 #define RTS_PDU_OUT_R2_A4 (RTS_PDU_OUT_R2_A | 0x00000004)
96 #define RTS_PDU_OUT_R2_A5 (RTS_PDU_OUT_R2_A | 0x00000005)
97 #define RTS_PDU_OUT_R2_A6 (RTS_PDU_OUT_R2_A | 0x00000006)
98 #define RTS_PDU_OUT_R2_A7 (RTS_PDU_OUT_R2_A | 0x00000007)
99 #define RTS_PDU_OUT_R2_A8 (RTS_PDU_OUT_R2_A | 0x00000008)
100 
101 #define RTS_PDU_OUT_R2_B 0x00400000
102 #define RTS_PDU_OUT_R2_B1 (RTS_PDU_OUT_R2_B | 0x00000001)
103 #define RTS_PDU_OUT_R2_B2 (RTS_PDU_OUT_R2_B | 0x00000002)
104 #define RTS_PDU_OUT_R2_B3 (RTS_PDU_OUT_R2_B | 0x00000003)
105 
106 #define RTS_PDU_OUT_R2_C 0x00800000
107 #define RTS_PDU_OUT_R2_C1 (RTS_PDU_OUT_R2_C | 0x00000001)
108 
109 #define RTS_PDU_OUT_OF_SEQUENCE 0x00010000
110 #define RTS_PDU_KEEP_ALIVE (RTS_PDU_OUT_OF_SEQUENCE | 0x00000001)
111 #define RTS_PDU_PING_TRAFFIC_SENT_NOTIFY (RTS_PDU_OUT_OF_SEQUENCE | 0x00000002)
112 #define RTS_PDU_ECHO (RTS_PDU_OUT_OF_SEQUENCE | 0x00000003)
113 #define RTS_PDU_PING (RTS_PDU_OUT_OF_SEQUENCE | 0x00000004)
114 #define RTS_PDU_FLOW_CONTROL_ACK (RTS_PDU_OUT_OF_SEQUENCE | 0x00000005)
115 #define RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION (RTS_PDU_OUT_OF_SEQUENCE | 0x00000006)
116 
117 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_A1_SIGNATURE;
118 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_A2_SIGNATURE;
119 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_A3_SIGNATURE;
120 
121 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_B1_SIGNATURE;
122 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_B2_SIGNATURE;
123 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_B3_SIGNATURE;
124 
125 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_C1_SIGNATURE;
126 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_C2_SIGNATURE;
127 
128 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_A1_SIGNATURE;
129 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_A2_SIGNATURE;
130 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_A3_SIGNATURE;
131 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_A4_SIGNATURE;
132 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_A5_SIGNATURE;
133 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_A6_SIGNATURE;
134 
135 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_B1_SIGNATURE;
136 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R1_B2_SIGNATURE;
137 
138 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R2_A1_SIGNATURE;
139 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R2_A2_SIGNATURE;
140 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R2_A3_SIGNATURE;
141 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R2_A4_SIGNATURE;
142 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_IN_R2_A5_SIGNATURE;
143 
144 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A1_SIGNATURE;
145 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A2_SIGNATURE;
146 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A3_SIGNATURE;
147 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A4_SIGNATURE;
148 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A5_SIGNATURE;
149 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A6_SIGNATURE;
150 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A7_SIGNATURE;
151 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A8_SIGNATURE;
152 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A9_SIGNATURE;
153 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A10_SIGNATURE;
154 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R1_A11_SIGNATURE;
155 
156 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A1_SIGNATURE;
157 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A2_SIGNATURE;
158 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A3_SIGNATURE;
159 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A4_SIGNATURE;
160 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A5_SIGNATURE;
161 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A6_SIGNATURE;
162 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A7_SIGNATURE;
163 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_A8_SIGNATURE;
164 
165 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_B1_SIGNATURE;
166 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_B2_SIGNATURE;
167 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_B3_SIGNATURE;
168 
169 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_OUT_R2_C1_SIGNATURE;
170 
171 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_KEEP_ALIVE_SIGNATURE;
172 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_PING_TRAFFIC_SENT_NOTIFY_SIGNATURE;
173 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_ECHO_SIGNATURE;
174 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_PING_SIGNATURE;
175 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_SIGNATURE;
176 FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE;
177 
178 FREERDP_LOCAL BOOL rts_match_pdu_signature(const RtsPduSignature* signature, wStream* s,
179  const rpcconn_hdr_t* header);
180 FREERDP_LOCAL BOOL rts_match_pdu_signature_ex(const RtsPduSignature* signature, wStream* s,
181  const rpcconn_hdr_t* header,
182  RtsPduSignature* found_signature, BOOL silent);
183 FREERDP_LOCAL BOOL rts_extract_pdu_signature(RtsPduSignature* signature, wStream* s,
184  const rpcconn_hdr_t* header);
185 FREERDP_LOCAL BOOL rts_extract_pdu_signature_ex(RtsPduSignature* signature, wStream* s,
186  const rpcconn_hdr_t* header, BOOL silent);
187 FREERDP_LOCAL UINT32 rts_identify_pdu_signature(const RtsPduSignature* signature,
188  const RTS_PDU_SIGNATURE_ENTRY** entry);
189 FREERDP_LOCAL BOOL rts_print_pdu_signature(wLog* log, DWORD level,
190  const RtsPduSignature* signature);
191 
192 #endif /* FREERDP_LIB_CORE_GATEWAY_RTS_SIGNATURE_H */
Definition: rts_signature.h:36