1 |
/* |
/* |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
Protocol services - Multipoint Communications Service |
Protocol services - Multipoint Communications Service |
4 |
Copyright (C) Matthew Chapman 1999-2000 |
Copyright (C) Matthew Chapman 1999-2001 |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
38 |
|
|
39 |
if (tag != tagval) |
if (tag != tagval) |
40 |
{ |
{ |
41 |
ERROR("expected tag %d, got %d\n", tagval, tag); |
error("expected tag %d, got %d\n", tagval, tag); |
42 |
return False; |
return False; |
43 |
} |
} |
44 |
|
|
89 |
|
|
90 |
/* Output a DOMAIN_PARAMS structure (ASN.1 BER) */ |
/* Output a DOMAIN_PARAMS structure (ASN.1 BER) */ |
91 |
static void |
static void |
92 |
mcs_out_domain_params(STREAM s, int max_channels, int max_users, |
mcs_out_domain_params(STREAM s, int max_channels, int max_users, int max_tokens, int max_pdusize) |
|
int max_tokens, int max_pdusize) |
|
93 |
{ |
{ |
94 |
ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32); |
ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32); |
95 |
ber_out_integer(s, max_channels); |
ber_out_integer(s, max_channels); |
160 |
in_uint8(s, result); |
in_uint8(s, result); |
161 |
if (result != 0) |
if (result != 0) |
162 |
{ |
{ |
163 |
ERROR("MCS connect: %d\n", result); |
error("MCS connect: %d\n", result); |
164 |
return False; |
return False; |
165 |
} |
} |
166 |
|
|
171 |
ber_parse_header(s, BER_TAG_OCTET_STRING, &length); |
ber_parse_header(s, BER_TAG_OCTET_STRING, &length); |
172 |
if (length > mcs_data->size) |
if (length > mcs_data->size) |
173 |
{ |
{ |
174 |
WARN("MCS data length %d\n", length); |
error("MCS data length %d\n", length); |
175 |
length = mcs_data->size; |
length = mcs_data->size; |
176 |
} |
} |
177 |
|
|
184 |
|
|
185 |
/* Send an EDrq message (ASN.1 PER) */ |
/* Send an EDrq message (ASN.1 PER) */ |
186 |
static void |
static void |
187 |
mcs_send_edrq() |
mcs_send_edrq(void) |
188 |
{ |
{ |
189 |
STREAM s; |
STREAM s; |
190 |
|
|
200 |
|
|
201 |
/* Send an AUrq message (ASN.1 PER) */ |
/* Send an AUrq message (ASN.1 PER) */ |
202 |
static void |
static void |
203 |
mcs_send_aurq() |
mcs_send_aurq(void) |
204 |
{ |
{ |
205 |
STREAM s; |
STREAM s; |
206 |
|
|
214 |
|
|
215 |
/* Expect a AUcf message (ASN.1 PER) */ |
/* Expect a AUcf message (ASN.1 PER) */ |
216 |
static BOOL |
static BOOL |
217 |
mcs_recv_aucf(uint16 *mcs_userid) |
mcs_recv_aucf(uint16 * mcs_userid) |
218 |
{ |
{ |
219 |
uint8 opcode, result; |
uint8 opcode, result; |
220 |
STREAM s; |
STREAM s; |
226 |
in_uint8(s, opcode); |
in_uint8(s, opcode); |
227 |
if ((opcode >> 2) != MCS_AUCF) |
if ((opcode >> 2) != MCS_AUCF) |
228 |
{ |
{ |
229 |
ERROR("expected AUcf, got %d\n", opcode); |
error("expected AUcf, got %d\n", opcode); |
230 |
return False; |
return False; |
231 |
} |
} |
232 |
|
|
233 |
in_uint8(s, result); |
in_uint8(s, result); |
234 |
if (result != 0) |
if (result != 0) |
235 |
{ |
{ |
236 |
ERROR("AUrq: %d\n", result); |
error("AUrq: %d\n", result); |
237 |
return False; |
return False; |
238 |
} |
} |
239 |
|
|
261 |
|
|
262 |
/* Expect a CJcf message (ASN.1 PER) */ |
/* Expect a CJcf message (ASN.1 PER) */ |
263 |
static BOOL |
static BOOL |
264 |
mcs_recv_cjcf() |
mcs_recv_cjcf(void) |
265 |
{ |
{ |
266 |
uint8 opcode, result; |
uint8 opcode, result; |
267 |
STREAM s; |
STREAM s; |
273 |
in_uint8(s, opcode); |
in_uint8(s, opcode); |
274 |
if ((opcode >> 2) != MCS_CJCF) |
if ((opcode >> 2) != MCS_CJCF) |
275 |
{ |
{ |
276 |
ERROR("expected CJcf, got %d\n", opcode); |
error("expected CJcf, got %d\n", opcode); |
277 |
return False; |
return False; |
278 |
} |
} |
279 |
|
|
280 |
in_uint8(s, result); |
in_uint8(s, result); |
281 |
if (result != 0) |
if (result != 0) |
282 |
{ |
{ |
283 |
ERROR("CJrq: %d\n", result); |
error("CJrq: %d\n", result); |
284 |
return False; |
return False; |
285 |
} |
} |
286 |
|
|
324 |
|
|
325 |
/* Receive an MCS transport data packet */ |
/* Receive an MCS transport data packet */ |
326 |
STREAM |
STREAM |
327 |
mcs_recv() |
mcs_recv(void) |
328 |
{ |
{ |
329 |
uint8 opcode, appid, length; |
uint8 opcode, appid, length; |
330 |
STREAM s; |
STREAM s; |
339 |
{ |
{ |
340 |
if (appid != MCS_DPUM) |
if (appid != MCS_DPUM) |
341 |
{ |
{ |
342 |
ERROR("expected data, got %d\n", opcode); |
error("expected data, got %d\n", opcode); |
343 |
} |
} |
344 |
return NULL; |
return NULL; |
345 |
} |
} |
386 |
|
|
387 |
/* Disconnect from the MCS layer */ |
/* Disconnect from the MCS layer */ |
388 |
void |
void |
389 |
mcs_disconnect() |
mcs_disconnect(void) |
390 |
{ |
{ |
391 |
iso_disconnect(); |
iso_disconnect(); |
392 |
} |
} |