1 |
/* -*- c-basic-offset: 8 -*- |
/* -*- c-basic-offset: 8 -*- |
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-2002 |
Copyright (C) Matthew Chapman 1999-2005 |
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 |
412 |
return False; |
return False; |
413 |
} |
} |
414 |
|
|
415 |
|
/* Establish a connection up to the MCS layer */ |
416 |
|
BOOL |
417 |
|
mcs_reconnect(char *server, STREAM mcs_data) |
418 |
|
{ |
419 |
|
unsigned int i; |
420 |
|
|
421 |
|
if (!iso_reconnect(server)) |
422 |
|
return False; |
423 |
|
|
424 |
|
mcs_send_connect_initial(mcs_data); |
425 |
|
if (!mcs_recv_connect_response(mcs_data)) |
426 |
|
goto error; |
427 |
|
|
428 |
|
mcs_send_edrq(); |
429 |
|
|
430 |
|
mcs_send_aurq(); |
431 |
|
if (!mcs_recv_aucf(&g_mcs_userid)) |
432 |
|
goto error; |
433 |
|
|
434 |
|
mcs_send_cjrq(g_mcs_userid + MCS_USERCHANNEL_BASE); |
435 |
|
|
436 |
|
if (!mcs_recv_cjcf()) |
437 |
|
goto error; |
438 |
|
|
439 |
|
mcs_send_cjrq(MCS_GLOBAL_CHANNEL); |
440 |
|
if (!mcs_recv_cjcf()) |
441 |
|
goto error; |
442 |
|
|
443 |
|
for (i = 0; i < g_num_channels; i++) |
444 |
|
{ |
445 |
|
mcs_send_cjrq(g_channels[i].mcs_id); |
446 |
|
if (!mcs_recv_cjcf()) |
447 |
|
goto error; |
448 |
|
} |
449 |
|
return True; |
450 |
|
|
451 |
|
error: |
452 |
|
iso_disconnect(); |
453 |
|
return False; |
454 |
|
} |
455 |
|
|
456 |
/* Disconnect from the MCS layer */ |
/* Disconnect from the MCS layer */ |
457 |
void |
void |
458 |
mcs_disconnect(void) |
mcs_disconnect(void) |
459 |
{ |
{ |
460 |
iso_disconnect(); |
iso_disconnect(); |
461 |
} |
} |
462 |
|
|
463 |
|
/* reset the state of the mcs layer */ |
464 |
|
void |
465 |
|
mcs_reset_state(void) |
466 |
|
{ |
467 |
|
g_mcs_userid = 0; |
468 |
|
iso_reset_state(); |
469 |
|
} |