2
2
* Remmina - The GTK+ Remote Desktop Client
3
* Copyright (C) 2009 - Vic Lee
3
* Copyright (C) 2009-2010 Vic Lee
5
5
* This program is free software; you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License as published by
78
80
/* Error handling */
79
81
#define remmina_ssh_has_error(ssh) (((RemminaSSH*)ssh)->error!=NULL)
80
82
void remmina_ssh_set_error (RemminaSSH *ssh, const gchar *fmt);
81
#define remmina_ssh_set_application_error(ssh,msg) ((RemminaSSH*)ssh)->error = g_strdup (msg);
83
void remmina_ssh_set_application_error (RemminaSSH *ssh, const gchar *fmt, ...);
83
85
/* Converts a string to/from UTF-8, or simply duplicate it if no conversion */
84
86
gchar* remmina_ssh_convert (RemminaSSH *ssh, const gchar *from);
139
145
* dest: The host:port of the remote destination
140
146
* local_port: The listening local port for the tunnel
142
gboolean remmina_ssh_tunnel_open (RemminaSSHTunnel *tunnel, const gchar *dest, gint local_port);
148
gboolean remmina_ssh_tunnel_open (RemminaSSHTunnel *tunnel, const gchar *host, gint port, gint local_port);
144
150
/* Accept the X11 tunnel. A new thread will be started and connect to local display.
145
151
* cmd: The remote X11 application to be executed
149
155
/* start X Port Forwarding */
150
156
gboolean remmina_ssh_tunnel_xport (RemminaSSHTunnel *tunnel, gboolean bindlocalhost);
158
/* start reverse tunnel. A new thread will be started and waiting for incoming connection.
159
* port: the port listening on the remote server side.
160
* local_port: the port listening on the local side. When connection on the server side comes
161
* in, it will connect to the local port and create the tunnel. The caller should
162
* start listening on the local port before calling it or in connect_func callback.
164
gboolean remmina_ssh_tunnel_reverse (RemminaSSHTunnel *tunnel, gint port, gint local_port);
152
166
/* Tells if the tunnel is terminated after start */
153
167
gboolean remmina_ssh_tunnel_terminated (RemminaSSHTunnel *tunnel);
176
190
/* Free the SFTP session */
177
191
void remmina_sftp_free (RemminaSFTP *sftp);
179
/*----------------------- SSH Terminal ------------------------*/
193
/*----------------------- SSH Shell ------------------------*/
194
typedef void (*RemminaSSHExitFunc) (gpointer data);
181
typedef struct _RemminaSSHTerminal
196
typedef struct _RemminaSSHShell
187
203
pthread_t thread;
190
} RemminaSSHTerminal;
192
/* Create a new SSH Terminal session object from existing SSH session */
193
RemminaSSHTerminal* remmina_ssh_terminal_new_from_ssh (RemminaSSH *ssh);
195
/* open the SSH Terminal (init -> auth -> term) */
196
gboolean remmina_ssh_terminal_open (RemminaSSHTerminal *term);
206
RemminaSSHExitFunc exit_callback;
210
/* Create a new SSH Shell session object from RemminaFile */
211
RemminaSSHShell* remmina_ssh_shell_new_from_file (RemminaFile *remminafile);
213
/* Create a new SSH Shell session object from existing SSH session */
214
RemminaSSHShell* remmina_ssh_shell_new_from_ssh (RemminaSSH *ssh);
216
/* open the SSH Shell, assuming the session already authenticated */
217
gboolean remmina_ssh_shell_open (RemminaSSHShell *shell, RemminaSSHExitFunc exit_callback, gpointer data);
219
/* Change the SSH Shell terminal size */
220
void remmina_ssh_shell_set_size (RemminaSSHShell *shell, gint columns, gint rows);
222
/* Free the SFTP session */
223
void remmina_ssh_shell_free (RemminaSSHShell *shell);