gboolean debug = 0;
+gboolean verbose = 0;
+
/* Usually /etc/pki/tls/certs/ca-bundle.crt unless overridden during
* configure or on the command line.
*/
*/
static GSList *vmlist = NULL;
+/* internal.h shared constructs */
+const char* hostname;
+struct vm* vm_in_focus;
+
/* Private functions. */
static void start_ui (void);
static GtkWidget *menu_item_new (int which_menu);
"check the SSL certificate of the server", NULL },
{ "debug", 'd', 0, G_OPTION_ARG_NONE, &debug,
"turn on debugging messages", NULL },
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
+ "turn on verbose messages", NULL },
{ "version", 'V', 0, G_OPTION_ARG_NONE, &print_version,
"display version and exit", NULL },
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
* processed in the main thread - see:
* http://mail.gnome.org/archives/gtk-app-devel-list/2007-March/msg00232.html
*
+ * A tunnel thread is also started to locally listen for vnc packets
+ * and make them proxyable, adding the vm name, before forwarding onto
+ * the server
+ *
* Note that under Win32 you must confine all Gtk/Gdk interactions
* to a single thread - see:
* http://developer.gimp.org/api/2.0/gdk/gdk-Threads.html
gtk_main ();
stop_wui_thread ();
+ stop_tunnel();
exit (0);
}
const char *authors[] = {
"Richard W.M. Jones <rjones@redhat.com>",
"Daniel P. Berrange <berrange@redhat.com>",
+ "Mohammed Morsi <mmorsi@redhat.com>",
NULL
};
static void
connect_to_wui (GtkWidget *widget, gpointer data)
{
- const char *hostname;
char *uri;
int len;
snprintf (uri, len, HTTPS "://%s/ovirt", hostname);
wui_thread_send_connect (uri);
+ start_tunnel();
}
static void
int i, uuidlen, len, fd;
GtkWidget *child;
const char *label;
- const char* hostname;
char *label2;
char new_title[97]; // 47 chars for title + 50 for vm name
return;
}
+ // FIXME on notebook tab switch, change vm_in_focus
+ vm_in_focus = vm;
+
/* This VM isn't in the notebook already, so create a new console. */
- hostname = gtk_entry_get_text (GTK_ENTRY (ca_hostname));
- fd = viewer_open_vnc_socket(hostname, vm->forward_vnc_port);
+ DEBUG ("connecting to local tunnel on port %i", tunnel_port);
+ fd = viewer_open_vnc_socket("127.0.0.1", tunnel_port);
if (fd == -1) return; /* We've already given an error. */
child = vnc_display_new ();