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 - ISO layer |
Protocol services - ISO layer |
4 |
Copyright (C) Matthew Chapman 1999-2002 |
Copyright (C) Matthew Chapman 1999-2007 |
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 |
8 |
the Free Software Foundation; either version 2 of the License, or |
the Free Software Foundation; either version 2 of the License, or |
9 |
(at your option) any later version. |
(at your option) any later version. |
10 |
|
|
11 |
This program is distributed in the hope that it will be useful, |
This program is distributed in the hope that it will be useful, |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
GNU General Public License for more details. |
GNU General Public License for more details. |
15 |
|
|
16 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
17 |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
18 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
168 |
} |
} |
169 |
|
|
170 |
/* Establish a connection up to the ISO layer */ |
/* Establish a connection up to the ISO layer */ |
171 |
BOOL |
RD_BOOL |
172 |
iso_connect(char *server, char *username) |
iso_connect(char *server, char *username) |
173 |
{ |
{ |
174 |
uint8 code = 0; |
uint8 code = 0; |
191 |
return True; |
return True; |
192 |
} |
} |
193 |
|
|
194 |
|
/* Establish a reconnection up to the ISO layer */ |
195 |
|
RD_BOOL |
196 |
|
iso_reconnect(char *server) |
197 |
|
{ |
198 |
|
uint8 code = 0; |
199 |
|
|
200 |
|
if (!tcp_connect(server)) |
201 |
|
return False; |
202 |
|
|
203 |
|
iso_send_msg(ISO_PDU_CR); |
204 |
|
|
205 |
|
if (iso_recv_msg(&code, NULL) == NULL) |
206 |
|
return False; |
207 |
|
|
208 |
|
if (code != ISO_PDU_CC) |
209 |
|
{ |
210 |
|
error("expected CC, got 0x%x\n", code); |
211 |
|
tcp_disconnect(); |
212 |
|
return False; |
213 |
|
} |
214 |
|
|
215 |
|
return True; |
216 |
|
} |
217 |
|
|
218 |
/* Disconnect from the ISO layer */ |
/* Disconnect from the ISO layer */ |
219 |
void |
void |
220 |
iso_disconnect(void) |
iso_disconnect(void) |
222 |
iso_send_msg(ISO_PDU_DR); |
iso_send_msg(ISO_PDU_DR); |
223 |
tcp_disconnect(); |
tcp_disconnect(); |
224 |
} |
} |
225 |
|
|
226 |
|
/* reset the state to support reconnecting */ |
227 |
|
void |
228 |
|
iso_reset_state(void) |
229 |
|
{ |
230 |
|
tcp_reset_state(); |
231 |
|
} |