191 |
return True; |
return True; |
192 |
} |
} |
193 |
|
|
194 |
|
/* Establish a reconnection up to the ISO layer */ |
195 |
|
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 |
|
} |