]>
Commit | Line | Data |
---|---|---|
d0b75ef3 | 1 | --- client/gabriel.c~ 2009-07-04 19:55:19.000000000 +0200 |
2 | +++ client/gabriel.c 2009-07-04 21:28:20.000000000 +0200 | |
3 | @@ -30,6 +30,7 @@ | |
4 | ||
5 | #define DEFAULT_TCP_PORT 1337 | |
6 | #define DEFAULT_ADDRESS "localhost" | |
7 | +#define DEFAULT_SSH_PORT 22 | |
8 | ||
9 | gboolean shutting_down; | |
10 | ||
11 | @@ -247,6 +248,7 @@ | |
12 | ||
13 | SSH_SESSION * | |
14 | gabriel_session_create (gchar * host, | |
e8ff1f48 | 15 | + guint ssh_port, |
d0b75ef3 | 16 | gchar * username, |
17 | gchar * password) | |
18 | { | |
19 | @@ -256,6 +258,7 @@ | |
20 | ||
21 | ssh_options = ssh_options_new (); | |
22 | ssh_options_set_host (ssh_options, host); | |
23 | + ssh_options_set_port (ssh_options, ssh_port); | |
24 | ssh_options_set_username (ssh_options, username); | |
25 | ssh_options_set_ssh_dir (ssh_options, "%s/.ssh"); | |
26 | ssh_options_set_identity (ssh_options, "id_dsa"); | |
27 | @@ -323,6 +326,7 @@ | |
28 | GOptionContext *context; | |
29 | GError *error = NULL; | |
30 | gchar *host = DEFAULT_ADDRESS; | |
e8ff1f48 | 31 | + guint ssh_port = DEFAULT_SSH_PORT; |
d0b75ef3 | 32 | gchar *username = NULL; |
33 | gchar *password = NULL; | |
34 | gchar *local_address = DEFAULT_ADDRESS; | |
35 | @@ -331,6 +335,8 @@ | |
36 | GOptionEntry entries[] = { | |
37 | {"host", 'h', 0, G_OPTION_ARG_STRING, &host, | |
38 | "Hostname or IP of the remote host", "HOSTNAME"}, | |
e8ff1f48 | 39 | + {"sshport", 'P', 0, G_OPTION_ARG_INT, &ssh_port, |
d0b75ef3 | 40 | + "Port to connect to on the remote host", "SSHPORT"}, |
41 | {"username", 'u', 0, G_OPTION_ARG_STRING, &username, | |
42 | "Username on the remote host", "USERNAME"}, | |
43 | {"password", 'p', 0, G_OPTION_ARG_STRING, &password, | |
44 | @@ -355,7 +361,7 @@ | |
45 | sig_action.sa_handler = signal_handler; | |
46 | sigaction (SIGINT, &sig_action, NULL); | |
47 | ||
48 | - ssh_session = gabriel_session_create (host, username, password); | |
49 | + ssh_session = gabriel_session_create (host, ssh_port, username, password); | |
50 | if (ssh_session == NULL) { | |
51 | goto beach; | |
52 | } |