1 --- client/gabriel.c~ 2009-07-04 19:55:19.000000000 +0200
2 +++ client/gabriel.c 2009-07-04 21:28:20.000000000 +0200
5 #define DEFAULT_TCP_PORT 1337
6 #define DEFAULT_ADDRESS "localhost"
7 +#define DEFAULT_SSH_PORT 22
9 gboolean shutting_down;
14 gabriel_session_create (gchar * host,
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");
28 GOptionContext *context;
30 gchar *host = DEFAULT_ADDRESS;
31 + guint ssh_port = DEFAULT_SSH_PORT;
32 gchar *username = NULL;
33 gchar *password = NULL;
34 gchar *local_address = DEFAULT_ADDRESS;
36 GOptionEntry entries[] = {
37 {"host", 'h', 0, G_OPTION_ARG_STRING, &host,
38 "Hostname or IP of the remote host", "HOSTNAME"},
39 + {"sshport", 'P', 0, G_OPTION_ARG_INT, &ssh_port,
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,
45 sig_action.sa_handler = signal_handler;
46 sigaction (SIGINT, &sig_action, NULL);
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) {