~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to src/VBox/RDP/client/mcs.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-07-04 13:02:31 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110704130231-l843es6wqhx614n7
Tags: 4.0.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add the Modaliases control field manually for maximum backportability.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- c-basic-offset: 8 -*-
2
2
   rdesktop: A Remote Desktop Protocol client.
3
3
   Protocol services - Multipoint Communications Service
4
 
   Copyright (C) Matthew Chapman 1999-2007
 
4
   Copyright (C) Matthew Chapman <matthewc.unsw.edu.au> 1999-2008
 
5
   Copyright 2005-2011 Peter Astrand <astrand@cendio.se> for Cendio AB
5
6
 
6
 
   This program is free software; you can redistribute it and/or modify
 
7
   This program is free software: you can redistribute it and/or modify
7
8
   it under the terms of the GNU General Public License as published by
8
 
   the Free Software Foundation; either version 2 of the License, or
 
9
   the Free Software Foundation, either version 3 of the License, or
9
10
   (at your option) any later version.
10
11
 
11
12
   This program is distributed in the hope that it will be useful,
14
15
   GNU General Public License for more details.
15
16
 
16
17
   You should have received a copy of the GNU General Public License
17
 
   along with this program; if not, write to the Free Software
18
 
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
19
*/
20
20
 
21
21
/*
381
381
        return s;
382
382
}
383
383
 
384
 
/* Establish a connection up to the MCS layer */
385
 
RD_BOOL
386
 
mcs_connect(char *server, STREAM mcs_data, char *username)
387
 
{
388
 
        unsigned int i;
389
 
 
390
 
        if (!iso_connect(server, username))
391
 
                return False;
392
 
 
393
 
        mcs_send_connect_initial(mcs_data);
394
 
        if (!mcs_recv_connect_response(mcs_data))
395
 
                goto error;
396
 
 
397
 
        mcs_send_edrq();
398
 
 
399
 
        mcs_send_aurq();
400
 
        if (!mcs_recv_aucf(&g_mcs_userid))
401
 
                goto error;
402
 
 
403
 
        mcs_send_cjrq(g_mcs_userid + MCS_USERCHANNEL_BASE);
404
 
 
405
 
        if (!mcs_recv_cjcf())
406
 
                goto error;
407
 
 
408
 
        mcs_send_cjrq(MCS_GLOBAL_CHANNEL);
409
 
        if (!mcs_recv_cjcf())
410
 
                goto error;
411
 
 
412
 
        for (i = 0; i < g_num_channels; i++)
413
 
        {
414
 
                mcs_send_cjrq(g_channels[i].mcs_id);
415
 
                if (!mcs_recv_cjcf())
416
 
                        goto error;
417
 
        }
418
 
        return True;
419
 
 
420
 
      error:
421
 
        iso_disconnect();
422
 
        return False;
423
 
}
424
 
 
425
 
/* Establish a connection up to the MCS layer */
426
 
RD_BOOL
427
 
mcs_reconnect(char *server, STREAM mcs_data)
428
 
{
429
 
        unsigned int i;
430
 
 
431
 
        if (!iso_reconnect(server))
 
384
RD_BOOL
 
385
mcs_connect(char *server, STREAM mcs_data, char *username, RD_BOOL reconnect)
 
386
{
 
387
        unsigned int i;
 
388
 
 
389
        if (!iso_connect(server, username, reconnect))
432
390
                return False;
433
391
 
434
392
        mcs_send_connect_initial(mcs_data);