41 |
* |
* |
42 |
* @file |
* @file |
43 |
*/ |
*/ |
44 |
int check_ssh(Port_T p) { |
int check_ssh(Socket_T s) { |
45 |
|
|
46 |
char buf[STRLEN]; |
char buf[STRLEN]; |
47 |
|
|
48 |
ASSERT(p); |
ASSERT(s); |
49 |
|
|
50 |
if(port_recv(p, buf, sizeof(buf), 0) <= 0) { |
if(socket_read(s, buf, sizeof(buf)) <= 0) { |
51 |
log("SSH: error receiving identification string -- %s\n", STRERROR); |
log("SSH: error receiving identification string -- %s\n", STRERROR); |
52 |
return FALSE; |
return FALSE; |
53 |
} |
} |
60 |
} |
} |
61 |
|
|
62 |
/* send identification string back to server */ |
/* send identification string back to server */ |
63 |
if(port_send(p, buf, strlen(buf), 0) <= 0) { |
if(socket_write(s, buf, strlen(buf)) <= 0) { |
64 |
log("SSH: error sending identification string -- %s\n", STRERROR); |
log("SSH: error sending identification string -- %s\n", STRERROR); |
65 |
return FALSE; |
return FALSE; |
66 |
} |
} |
67 |
|
|
68 |
return TRUE; |
return TRUE; |
69 |
|
|
70 |
} |
} |