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

« back to all changes in this revision

Viewing changes to src/VBox/RDP/client/iso.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 - ISO layer
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
/*
183
183
 
184
184
/* Establish a connection up to the ISO layer */
185
185
RD_BOOL
186
 
iso_connect(char *server, char *username)
187
 
{
188
 
        uint8 code = 0;
189
 
 
190
 
        if (!tcp_connect(server))
191
 
                return False;
192
 
 
193
 
        iso_send_connection_request(username);
194
 
 
195
 
        if (iso_recv_msg(&code, NULL) == NULL)
196
 
                return False;
197
 
 
198
 
        if (code != ISO_PDU_CC)
199
 
        {
200
 
                error("expected CC, got 0x%x\n", code);
201
 
                tcp_disconnect();
202
 
                return False;
203
 
        }
204
 
 
205
 
        return True;
206
 
}
207
 
 
208
 
/* Establish a reconnection up to the ISO layer */
209
 
RD_BOOL
210
 
iso_reconnect(char *server)
211
 
{
212
 
        uint8 code = 0;
213
 
 
214
 
        if (!tcp_connect(server))
215
 
                return False;
216
 
 
217
 
        iso_send_msg(ISO_PDU_CR);
 
186
iso_connect(char *server, char *username, RD_BOOL reconnect)
 
187
{
 
188
        uint8 code = 0;
 
189
 
 
190
        if (!tcp_connect(server))
 
191
                return False;
 
192
 
 
193
        if (reconnect)
 
194
        {
 
195
                iso_send_msg(ISO_PDU_CR);
 
196
        }
 
197
        else
 
198
        {
 
199
                iso_send_connection_request(username);
 
200
        }
218
201
 
219
202
        if (iso_recv_msg(&code, NULL) == NULL)
220
203
                return False;