aboutsummaryrefslogtreecommitdiff
path: root/src/setup
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup')
-rw-r--r--src/setup/gnunet-setup-datacache-config.c64
-rw-r--r--src/setup/gnunet-setup-datacache-plugins.c36
-rw-r--r--src/setup/gnunet-setup-datastore-config.c56
-rw-r--r--src/setup/gnunet-setup-datastore-plugins.c36
-rw-r--r--src/setup/gnunet-setup-hostlist-editing.c41
-rw-r--r--src/setup/gnunet-setup-options.c2854
-rw-r--r--src/setup/gnunet-setup-transport-http.c7
-rw-r--r--src/setup/gnunet-setup-transport-https.c7
-rw-r--r--src/setup/gnunet-setup-transport-plugins.c48
-rw-r--r--src/setup/gnunet-setup-transport-tcp.c7
-rw-r--r--src/setup/gnunet-setup-transport-test.c109
-rw-r--r--src/setup/gnunet-setup-transport-udp.c7
-rw-r--r--src/setup/gnunet-setup-transport.c231
-rw-r--r--src/setup/gnunet-setup.c311
14 files changed, 1736 insertions, 2078 deletions
diff --git a/src/setup/gnunet-setup-datacache-config.c b/src/setup/gnunet-setup-datacache-config.c
index f779d8c4..c777f5ff 100644
--- a/src/setup/gnunet-setup-datacache-config.c
+++ b/src/setup/gnunet-setup-datacache-config.c
@@ -30,9 +30,7 @@
30 * Stub implementation of the 'DeleteNotifyCallback' callback. 30 * Stub implementation of the 'DeleteNotifyCallback' callback.
31 */ 31 */
32static void 32static void
33dnc_dummy (void *cls, 33dnc_dummy (void *cls, const GNUNET_HashCode * key, size_t size)
34 const GNUNET_HashCode *key,
35 size_t size)
36{ 34{
37 /* do nothing */ 35 /* do nothing */
38} 36}
@@ -47,13 +45,12 @@ dnc_dummy (void *cls,
47static int 45static int
48test_config (const char *name) 46test_config (const char *name)
49{ 47{
50 struct GNUNET_DATACACHE_PluginEnvironment env = 48 struct GNUNET_DATACACHE_PluginEnvironment env = {
51 { 49 cfg,
52 cfg, 50 "dhtcache",
53 "dhtcache", 51 NULL, &dnc_dummy,
54 NULL, &dnc_dummy, 52 1024LL
55 1024LL 53 };
56 };
57 void *ret; 54 void *ret;
58 55
59 ret = GNUNET_PLUGIN_load (name, &env); 56 ret = GNUNET_PLUGIN_load (name, &env);
@@ -95,41 +92,38 @@ GNUNET_setup_datacache_postgres_invalidate_cb ()
95 92
96 93
97void 94void
98GNUNET_setup_datacache_mysql_tab_test_button_clicked_cb (GtkWidget *widget, 95GNUNET_setup_datacache_mysql_tab_test_button_clicked_cb (GtkWidget * widget,
99 gpointer user_data) 96 gpointer user_data)
100{ 97{
101 if (GNUNET_OK == 98 if (GNUNET_OK == test_config ("libgnunet_plugin_datacache_mysql"))
102 test_config ("libgnunet_plugin_datacache_mysql")) 99 {
103 { 100 show ("GNUNET_setup_datacache_mysql_tab_ok_image");
104 show ("GNUNET_setup_datacache_mysql_tab_ok_image"); 101 hide ("GNUNET_setup_datacache_mysql_tab_error_image");
105 hide ("GNUNET_setup_datacache_mysql_tab_error_image"); 102 }
106 }
107 else 103 else
108 { 104 {
109 hide ("GNUNET_setup_datacache_mysql_tab_ok_image"); 105 hide ("GNUNET_setup_datacache_mysql_tab_ok_image");
110 show ("GNUNET_setup_datacache_mysql_tab_error_image"); 106 show ("GNUNET_setup_datacache_mysql_tab_error_image");
111 } 107 }
112} 108}
113 109
114 110
115void 111void
116GNUNET_setup_datacache_postgres_tab_test_button_clicked_cb (GtkWidget *widget, 112GNUNET_setup_datacache_postgres_tab_test_button_clicked_cb (GtkWidget * widget,
117 gpointer user_data) 113 gpointer user_data)
118{ 114{
119 if (GNUNET_OK == 115 if (GNUNET_OK == test_config ("libgnunet_plugin_datacache_postgres"))
120 test_config ("libgnunet_plugin_datacache_postgres")) 116 {
121 { 117 show ("GNUNET_setup_datacache_postgres_tab_ok_image");
122 show ("GNUNET_setup_datacache_postgres_tab_ok_image"); 118 hide ("GNUNET_setup_datacache_postgres_tab_error_image");
123 hide ("GNUNET_setup_datacache_postgres_tab_error_image"); 119 }
124 }
125 else 120 else
126 { 121 {
127 hide ("GNUNET_setup_datacache_postgres_tab_ok_image"); 122 hide ("GNUNET_setup_datacache_postgres_tab_ok_image");
128 show ("GNUNET_setup_datacache_postgres_tab_error_image"); 123 show ("GNUNET_setup_datacache_postgres_tab_error_image");
129 } 124 }
130} 125}
131 126
132 127
133 128
134/* end of gnunet-setup-datacache-config.c */ 129/* end of gnunet-setup-datacache-config.c */
135
diff --git a/src/setup/gnunet-setup-datacache-plugins.c b/src/setup/gnunet-setup-datacache-plugins.c
index 4e53f6df..022345d3 100644
--- a/src/setup/gnunet-setup-datacache-plugins.c
+++ b/src/setup/gnunet-setup-datacache-plugins.c
@@ -34,45 +34,40 @@
34 * @param name name of the plugin to check 34 * @param name name of the plugin to check
35 */ 35 */
36static void 36static void
37test_plugin (GtkWidget *widget, 37test_plugin (GtkWidget * widget, const char *name)
38 const char *name)
39{ 38{
40 if (GNUNET_YES == 39 if (GNUNET_YES == GNUNET_PLUGIN_test (name))
41 GNUNET_PLUGIN_test (name)) 40 {
42 { 41 gtk_widget_set_sensitive (widget, TRUE);
43 gtk_widget_set_sensitive (widget, 42 }
44 TRUE);
45 }
46 else 43 else
47 { 44 {
48 gtk_widget_set_sensitive (widget, 45 gtk_widget_set_sensitive (widget, FALSE);
49 FALSE); 46 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
50 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 47 }
51 FALSE);
52 }
53} 48}
54 49
55 50
56 51
57void 52void
58GNUNET_setup_fs_datacache_sqlite_radiobutton_realize_cb (GtkWidget *widget, 53GNUNET_setup_fs_datacache_sqlite_radiobutton_realize_cb (GtkWidget * widget,
59 gpointer user_data) 54 gpointer user_data)
60{ 55{
61 test_plugin (widget, "libgnunet_plugin_datacache_sqlite"); 56 test_plugin (widget, "libgnunet_plugin_datacache_sqlite");
62} 57}
63 58
64 59
65void 60void
66GNUNET_setup_fs_datacache_mysql_radiobutton_realize_cb (GtkWidget *widget, 61GNUNET_setup_fs_datacache_mysql_radiobutton_realize_cb (GtkWidget * widget,
67 gpointer user_data) 62 gpointer user_data)
68{ 63{
69 test_plugin (widget, "libgnunet_plugin_datacache_mysql"); 64 test_plugin (widget, "libgnunet_plugin_datacache_mysql");
70} 65}
71 66
72 67
73void 68void
74GNUNET_setup_fs_datacache_postgres_radiobutton_realize_cb (GtkWidget *widget, 69GNUNET_setup_fs_datacache_postgres_radiobutton_realize_cb (GtkWidget * widget,
75 gpointer user_data) 70 gpointer user_data)
76{ 71{
77 test_plugin (widget, "libgnunet_plugin_datacache_postgres"); 72 test_plugin (widget, "libgnunet_plugin_datacache_postgres");
78} 73}
@@ -80,4 +75,3 @@ GNUNET_setup_fs_datacache_postgres_radiobutton_realize_cb (GtkWidget *widget,
80 75
81 76
82/* end of gnunet-setup-transport-plugins.c */ 77/* end of gnunet-setup-transport-plugins.c */
83
diff --git a/src/setup/gnunet-setup-datastore-config.c b/src/setup/gnunet-setup-datastore-config.c
index 86925418..2c7ede51 100644
--- a/src/setup/gnunet-setup-datastore-config.c
+++ b/src/setup/gnunet-setup-datastore-config.c
@@ -45,11 +45,10 @@ duc_dummy (void *cls, int delta)
45static int 45static int
46test_config (const char *name) 46test_config (const char *name)
47{ 47{
48 struct GNUNET_DATASTORE_PluginEnvironment env = 48 struct GNUNET_DATASTORE_PluginEnvironment env = {
49 { 49 cfg,
50 cfg, 50 &duc_dummy, NULL
51 &duc_dummy, NULL 51 };
52 };
53 void *ret; 52 void *ret;
54 53
55 ret = GNUNET_PLUGIN_load (name, &env); 54 ret = GNUNET_PLUGIN_load (name, &env);
@@ -91,41 +90,38 @@ GNUNET_setup_datastore_postgres_invalidate_cb ()
91 90
92 91
93void 92void
94GNUNET_setup_datastore_mysql_tab_test_button_clicked_cb (GtkWidget *widget, 93GNUNET_setup_datastore_mysql_tab_test_button_clicked_cb (GtkWidget * widget,
95 gpointer user_data) 94 gpointer user_data)
96{ 95{
97 if (GNUNET_OK == 96 if (GNUNET_OK == test_config ("libgnunet_plugin_datastore_mysql"))
98 test_config ("libgnunet_plugin_datastore_mysql")) 97 {
99 { 98 show ("GNUNET_setup_datastore_mysql_tab_ok_image");
100 show ("GNUNET_setup_datastore_mysql_tab_ok_image"); 99 hide ("GNUNET_setup_datastore_mysql_tab_error_image");
101 hide ("GNUNET_setup_datastore_mysql_tab_error_image"); 100 }
102 }
103 else 101 else
104 { 102 {
105 hide ("GNUNET_setup_datastore_mysql_tab_ok_image"); 103 hide ("GNUNET_setup_datastore_mysql_tab_ok_image");
106 show ("GNUNET_setup_datastore_mysql_tab_error_image"); 104 show ("GNUNET_setup_datastore_mysql_tab_error_image");
107 } 105 }
108} 106}
109 107
110 108
111void 109void
112GNUNET_setup_datastore_postgres_tab_test_button_clicked_cb (GtkWidget *widget, 110GNUNET_setup_datastore_postgres_tab_test_button_clicked_cb (GtkWidget * widget,
113 gpointer user_data) 111 gpointer user_data)
114{ 112{
115 if (GNUNET_OK == 113 if (GNUNET_OK == test_config ("libgnunet_plugin_datastore_postgres"))
116 test_config ("libgnunet_plugin_datastore_postgres")) 114 {
117 { 115 show ("GNUNET_setup_datastore_postgres_tab_ok_image");
118 show ("GNUNET_setup_datastore_postgres_tab_ok_image"); 116 hide ("GNUNET_setup_datastore_postgres_tab_error_image");
119 hide ("GNUNET_setup_datastore_postgres_tab_error_image"); 117 }
120 }
121 else 118 else
122 { 119 {
123 hide ("GNUNET_setup_datastore_postgres_tab_ok_image"); 120 hide ("GNUNET_setup_datastore_postgres_tab_ok_image");
124 show ("GNUNET_setup_datastore_postgres_tab_error_image"); 121 show ("GNUNET_setup_datastore_postgres_tab_error_image");
125 } 122 }
126} 123}
127 124
128 125
129 126
130/* end of gnunet-setup-datastore-config.c */ 127/* end of gnunet-setup-datastore-config.c */
131
diff --git a/src/setup/gnunet-setup-datastore-plugins.c b/src/setup/gnunet-setup-datastore-plugins.c
index e7f448e6..7d55ba1e 100644
--- a/src/setup/gnunet-setup-datastore-plugins.c
+++ b/src/setup/gnunet-setup-datastore-plugins.c
@@ -33,44 +33,39 @@
33 * @param name name of the plugin to check 33 * @param name name of the plugin to check
34 */ 34 */
35static void 35static void
36test_plugin (GtkWidget *widget, 36test_plugin (GtkWidget * widget, const char *name)
37 const char *name)
38{ 37{
39 if (GNUNET_YES == 38 if (GNUNET_YES == GNUNET_PLUGIN_test (name))
40 GNUNET_PLUGIN_test (name)) 39 {
41 { 40 gtk_widget_set_sensitive (widget, TRUE);
42 gtk_widget_set_sensitive (widget, 41 }
43 TRUE);
44 }
45 else 42 else
46 { 43 {
47 gtk_widget_set_sensitive (widget, 44 gtk_widget_set_sensitive (widget, FALSE);
48 FALSE); 45 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
49 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 46 }
50 FALSE);
51 }
52} 47}
53 48
54 49
55void 50void
56GNUNET_setup_fs_datastore_sqlite_radiobutton_realize_cb (GtkWidget *widget, 51GNUNET_setup_fs_datastore_sqlite_radiobutton_realize_cb (GtkWidget * widget,
57 gpointer user_data) 52 gpointer user_data)
58{ 53{
59 test_plugin (widget, "libgnunet_plugin_datastore_sqlite"); 54 test_plugin (widget, "libgnunet_plugin_datastore_sqlite");
60} 55}
61 56
62 57
63void 58void
64GNUNET_setup_fs_datastore_mysql_radiobutton_realize_cb (GtkWidget *widget, 59GNUNET_setup_fs_datastore_mysql_radiobutton_realize_cb (GtkWidget * widget,
65 gpointer user_data) 60 gpointer user_data)
66{ 61{
67 test_plugin (widget, "libgnunet_plugin_datastore_mysql"); 62 test_plugin (widget, "libgnunet_plugin_datastore_mysql");
68} 63}
69 64
70 65
71void 66void
72GNUNET_setup_fs_datastore_postgres_radiobutton_realize_cb (GtkWidget *widget, 67GNUNET_setup_fs_datastore_postgres_radiobutton_realize_cb (GtkWidget * widget,
73 gpointer user_data) 68 gpointer user_data)
74{ 69{
75 test_plugin (widget, "libgnunet_plugin_datastore_postgres"); 70 test_plugin (widget, "libgnunet_plugin_datastore_postgres");
76} 71}
@@ -78,4 +73,3 @@ GNUNET_setup_fs_datastore_postgres_radiobutton_realize_cb (GtkWidget *widget,
78 73
79 74
80/* end of gnunet-setup-datastore-plugins.c */ 75/* end of gnunet-setup-datastore-plugins.c */
81
diff --git a/src/setup/gnunet-setup-hostlist-editing.c b/src/setup/gnunet-setup-hostlist-editing.c
index 98e6e136..02056b0d 100644
--- a/src/setup/gnunet-setup-hostlist-editing.c
+++ b/src/setup/gnunet-setup-hostlist-editing.c
@@ -36,36 +36,31 @@
36 * @param user_data not used 36 * @param user_data not used
37 */ 37 */
38void 38void
39GNUNET_setup_hostlist_url_cellrenderertext_edited_cb (GtkCellRendererText *renderer, 39GNUNET_setup_hostlist_url_cellrenderertext_edited_cb (GtkCellRendererText *
40 gchar *path, 40 renderer, gchar * path,
41 gchar *new_text, 41 gchar * new_text,
42 gpointer user_data) 42 gpointer user_data)
43{ 43{
44 GtkListStore *ls; 44 GtkListStore *ls;
45 GtkTreeIter old; 45 GtkTreeIter old;
46 GtkTreeIter iter; 46 GtkTreeIter iter;
47 47
48 ls = GTK_LIST_STORE (GNUNET_SETUP_get_object ("GNUNET_setup_hostlist_url_liststore")); 48 ls = GTK_LIST_STORE (GNUNET_SETUP_get_object
49 ("GNUNET_setup_hostlist_url_liststore"));
49 if (ls == NULL) 50 if (ls == NULL)
50 { 51 {
51 GNUNET_break (0); 52 GNUNET_break (0);
52 return; 53 return;
53 } 54 }
54 if (TRUE != 55 if (TRUE !=
55 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ls), 56 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ls), &old, path))
56 &old, 57 {
57 path)) 58 GNUNET_break (0);
58 { 59 return;
59 GNUNET_break (0); 60 }
60 return; 61
61 }
62
63 gtk_list_store_insert_before (ls, &iter, &old); 62 gtk_list_store_insert_before (ls, &iter, &old);
64 gtk_list_store_set (ls, 63 gtk_list_store_set (ls, &iter, 0, new_text, 1, FALSE, -1);
65 &iter,
66 0, new_text,
67 1, FALSE,
68 -1);
69} 64}
70 65
71/* end of gnunet-setup-hostlist-editing.c */ 66/* end of gnunet-setup-hostlist-editing.c */
diff --git a/src/setup/gnunet-setup-options.c b/src/setup/gnunet-setup-options.c
index fe896892..d031f46c 100644
--- a/src/setup/gnunet-setup-options.c
+++ b/src/setup/gnunet-setup-options.c
@@ -50,12 +50,9 @@
50 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 50 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
51 */ 51 */
52static int 52static int
53load_yes_no (const void *cls, 53load_yes_no (const void *cls, const char *section, const char *option,
54 const char *section, 54 const char *value, GObject * widget,
55 const char *option, 55 const struct GNUNET_CONFIGURATION_Handle *cfg)
56 const char *value,
57 GObject *widget,
58 const struct GNUNET_CONFIGURATION_Handle *cfg)
59{ 56{
60 GtkToggleButton *button; 57 GtkToggleButton *button;
61 58
@@ -63,7 +60,8 @@ load_yes_no (const void *cls,
63 if (button == NULL) 60 if (button == NULL)
64 return GNUNET_SYSERR; 61 return GNUNET_SYSERR;
65 gtk_toggle_button_set_active (button, 62 gtk_toggle_button_set_active (button,
66 (0 == strcasecmp (value, "YES")) ? TRUE : FALSE); 63 (0 ==
64 strcasecmp (value, "YES")) ? TRUE : FALSE);
67 return GNUNET_OK; 65 return GNUNET_OK;
68} 66}
69 67
@@ -79,22 +77,18 @@ load_yes_no (const void *cls,
79 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 77 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
80 */ 78 */
81static int 79static int
82save_yes_no (const void *cls, 80save_yes_no (const void *cls, const char *section, const char *option,
83 const char *section, 81 GObject * widget, struct GNUNET_CONFIGURATION_Handle *cfg)
84 const char *option,
85 GObject *widget,
86 struct GNUNET_CONFIGURATION_Handle *cfg)
87{ 82{
88 GtkToggleButton *button; 83 GtkToggleButton *button;
89 gboolean mode; 84 gboolean mode;
90 85
91 button = GTK_TOGGLE_BUTTON (widget); 86 button = GTK_TOGGLE_BUTTON (widget);
92 if (button == NULL) 87 if (button == NULL)
93 return GNUNET_SYSERR; 88 return GNUNET_SYSERR;
94 mode = gtk_toggle_button_get_active (button); 89 mode = gtk_toggle_button_get_active (button);
95 GNUNET_CONFIGURATION_set_value_string (cfg, 90 GNUNET_CONFIGURATION_set_value_string (cfg, section, option,
96 section, option, 91 mode == TRUE ? "YES" : "NO");
97 mode == TRUE ? "YES" : "NO");
98 return GNUNET_OK; 92 return GNUNET_OK;
99} 93}
100 94
@@ -111,20 +105,16 @@ save_yes_no (const void *cls,
111 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 105 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
112 */ 106 */
113static int 107static int
114load_filename (const void *cls, 108load_filename (const void *cls, const char *section, const char *option,
115 const char *section, 109 const char *value, GObject * widget,
116 const char *option, 110 const struct GNUNET_CONFIGURATION_Handle *cfg)
117 const char *value,
118 GObject *widget,
119 const struct GNUNET_CONFIGURATION_Handle *cfg)
120{ 111{
121 GtkFileChooser *chooser; 112 GtkFileChooser *chooser;
122 113
123 chooser = GTK_FILE_CHOOSER (widget); 114 chooser = GTK_FILE_CHOOSER (widget);
124 if (chooser == NULL) 115 if (chooser == NULL)
125 return GNUNET_SYSERR; 116 return GNUNET_SYSERR;
126 gtk_file_chooser_set_filename (chooser, 117 gtk_file_chooser_set_filename (chooser, value);
127 value);
128 return GNUNET_OK; 118 return GNUNET_OK;
129} 119}
130 120
@@ -140,11 +130,8 @@ load_filename (const void *cls,
140 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 130 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
141 */ 131 */
142static int 132static int
143save_filename (const void *cls, 133save_filename (const void *cls, const char *section, const char *option,
144 const char *section, 134 GObject * widget, struct GNUNET_CONFIGURATION_Handle *cfg)
145 const char *option,
146 GObject *widget,
147 struct GNUNET_CONFIGURATION_Handle *cfg)
148{ 135{
149 GtkFileChooser *chooser; 136 GtkFileChooser *chooser;
150 gchar *fn; 137 gchar *fn;
@@ -155,9 +142,7 @@ save_filename (const void *cls,
155 fn = gtk_file_chooser_get_filename (chooser); 142 fn = gtk_file_chooser_get_filename (chooser);
156 if (fn == NULL) 143 if (fn == NULL)
157 fn = g_strdup (""); 144 fn = g_strdup ("");
158 GNUNET_CONFIGURATION_set_value_string (cfg, 145 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, fn);
159 section, option,
160 fn);
161 g_free (fn); 146 g_free (fn);
162 return GNUNET_OK; 147 return GNUNET_OK;
163} 148}
@@ -175,20 +160,16 @@ save_filename (const void *cls,
175 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 160 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
176 */ 161 */
177static int 162static int
178load_text (const void *cls, 163load_text (const void *cls, const char *section, const char *option,
179 const char *section, 164 const char *value, GObject * widget,
180 const char *option, 165 const struct GNUNET_CONFIGURATION_Handle *cfg)
181 const char *value,
182 GObject *widget,
183 const struct GNUNET_CONFIGURATION_Handle *cfg)
184{ 166{
185 GtkEntry *entry; 167 GtkEntry *entry;
186 168
187 entry = GTK_ENTRY (widget); 169 entry = GTK_ENTRY (widget);
188 if (entry == NULL) 170 if (entry == NULL)
189 return GNUNET_SYSERR; 171 return GNUNET_SYSERR;
190 gtk_entry_set_text (entry, 172 gtk_entry_set_text (entry, value);
191 value);
192 return GNUNET_OK; 173 return GNUNET_OK;
193} 174}
194 175
@@ -204,11 +185,8 @@ load_text (const void *cls,
204 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 185 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
205 */ 186 */
206static int 187static int
207save_text (const void *cls, 188save_text (const void *cls, const char *section, const char *option,
208 const char *section, 189 GObject * widget, struct GNUNET_CONFIGURATION_Handle *cfg)
209 const char *option,
210 GObject *widget,
211 struct GNUNET_CONFIGURATION_Handle *cfg)
212{ 190{
213 GtkEntry *entry; 191 GtkEntry *entry;
214 const gchar *txt; 192 const gchar *txt;
@@ -217,9 +195,7 @@ save_text (const void *cls,
217 if (entry == NULL) 195 if (entry == NULL)
218 return GNUNET_SYSERR; 196 return GNUNET_SYSERR;
219 txt = gtk_entry_get_text (entry); 197 txt = gtk_entry_get_text (entry);
220 GNUNET_CONFIGURATION_set_value_string (cfg, 198 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, txt);
221 section, option,
222 txt);
223 return GNUNET_OK; 199 return GNUNET_OK;
224} 200}
225 201
@@ -237,12 +213,9 @@ save_text (const void *cls,
237 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 213 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
238 */ 214 */
239static int 215static int
240load_combo_text (const void *cls, 216load_combo_text (const void *cls, const char *section, const char *option,
241 const char *section, 217 const char *value, GObject * widget,
242 const char *option, 218 const struct GNUNET_CONFIGURATION_Handle *cfg)
243 const char *value,
244 GObject *widget,
245 const struct GNUNET_CONFIGURATION_Handle *cfg)
246{ 219{
247 GtkComboBoxText *cb; 220 GtkComboBoxText *cb;
248 221
@@ -265,11 +238,8 @@ load_combo_text (const void *cls,
265 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 238 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
266 */ 239 */
267static int 240static int
268save_combo_text (const void *cls, 241save_combo_text (const void *cls, const char *section, const char *option,
269 const char *section, 242 GObject * widget, struct GNUNET_CONFIGURATION_Handle *cfg)
270 const char *option,
271 GObject *widget,
272 struct GNUNET_CONFIGURATION_Handle *cfg)
273{ 243{
274 GtkComboBox *cb; 244 GtkComboBox *cb;
275 gchar *c; 245 gchar *c;
@@ -297,12 +267,9 @@ save_combo_text (const void *cls,
297 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 267 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
298 */ 268 */
299static int 269static int
300load_number (const void *cls, 270load_number (const void *cls, const char *section, const char *option,
301 const char *section, 271 const char *value, GObject * widget,
302 const char *option, 272 const struct GNUNET_CONFIGURATION_Handle *cfg)
303 const char *value,
304 GObject *widget,
305 const struct GNUNET_CONFIGURATION_Handle *cfg)
306{ 273{
307 GtkSpinButton *spin; 274 GtkSpinButton *spin;
308 unsigned int number; 275 unsigned int number;
@@ -312,8 +279,7 @@ load_number (const void *cls,
312 return GNUNET_SYSERR; 279 return GNUNET_SYSERR;
313 if (1 != sscanf (value, "%u", &number)) 280 if (1 != sscanf (value, "%u", &number))
314 return GNUNET_SYSERR; 281 return GNUNET_SYSERR;
315 gtk_spin_button_set_value (spin, 282 gtk_spin_button_set_value (spin, number);
316 number);
317 return GNUNET_OK; 283 return GNUNET_OK;
318} 284}
319 285
@@ -329,20 +295,17 @@ load_number (const void *cls,
329 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 295 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
330 */ 296 */
331static int 297static int
332save_number (const void *cls, 298save_number (const void *cls, const char *section, const char *option,
333 const char *section, 299 GObject * widget, struct GNUNET_CONFIGURATION_Handle *cfg)
334 const char *option,
335 GObject *widget,
336 struct GNUNET_CONFIGURATION_Handle *cfg)
337{ 300{
338 GtkSpinButton *spin; 301 GtkSpinButton *spin;
339 302
340 spin = GTK_SPIN_BUTTON (widget); 303 spin = GTK_SPIN_BUTTON (widget);
341 if (spin == NULL) 304 if (spin == NULL)
342 return GNUNET_SYSERR; 305 return GNUNET_SYSERR;
343 GNUNET_CONFIGURATION_set_value_number (cfg, 306 GNUNET_CONFIGURATION_set_value_number (cfg, section, option,
344 section, option, 307 gtk_spin_button_get_value_as_int
345 gtk_spin_button_get_value_as_int (spin)); 308 (spin));
346 return GNUNET_OK; 309 return GNUNET_OK;
347} 310}
348 311
@@ -360,12 +323,9 @@ save_number (const void *cls,
360 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 323 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
361 */ 324 */
362static int 325static int
363load_option_list (const void *cls, 326load_option_list (const void *cls, const char *section, const char *option,
364 const char *section, 327 const char *value, GObject * widget,
365 const char *option, 328 const struct GNUNET_CONFIGURATION_Handle *cfg)
366 const char *value,
367 GObject *widget,
368 const struct GNUNET_CONFIGURATION_Handle *cfg)
369{ 329{
370 const char *word = cls; 330 const char *word = cls;
371 char *t; 331 char *t;
@@ -380,17 +340,16 @@ load_option_list (const void *cls,
380 t = GNUNET_strdup (value); 340 t = GNUNET_strdup (value);
381 w = strtok (t, " "); 341 w = strtok (t, " ");
382 while (w != NULL) 342 while (w != NULL)
343 {
344 if (0 == strcmp (w, word))
383 { 345 {
384 if (0 == strcmp (w, word)) 346 found = GNUNET_YES;
385 { 347 break;
386 found = GNUNET_YES;
387 break;
388 }
389 w = strtok (NULL, " ");
390 } 348 }
349 w = strtok (NULL, " ");
350 }
391 GNUNET_free (t); 351 GNUNET_free (t);
392 gtk_toggle_button_set_active (button, 352 gtk_toggle_button_set_active (button, found);
393 found);
394 return GNUNET_OK; 353 return GNUNET_OK;
395} 354}
396 355
@@ -406,11 +365,8 @@ load_option_list (const void *cls,
406 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 365 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
407 */ 366 */
408static int 367static int
409save_option_list (const void *cls, 368save_option_list (const void *cls, const char *section, const char *option,
410 const char *section, 369 GObject * widget, struct GNUNET_CONFIGURATION_Handle *cfg)
411 const char *option,
412 GObject *widget,
413 struct GNUNET_CONFIGURATION_Handle *cfg)
414{ 370{
415 const char *word = cls; 371 const char *word = cls;
416 GtkToggleButton *button; 372 GtkToggleButton *button;
@@ -421,15 +377,9 @@ save_option_list (const void *cls,
421 return GNUNET_SYSERR; 377 return GNUNET_SYSERR;
422 mode = gtk_toggle_button_get_active (button); 378 mode = gtk_toggle_button_get_active (button);
423 if (mode == TRUE) 379 if (mode == TRUE)
424 GNUNET_CONFIGURATION_append_value_filename (cfg, 380 GNUNET_CONFIGURATION_append_value_filename (cfg, section, option, word);
425 section,
426 option,
427 word);
428 else 381 else
429 GNUNET_CONFIGURATION_remove_value_filename (cfg, 382 GNUNET_CONFIGURATION_remove_value_filename (cfg, section, option, word);
430 section,
431 option,
432 word);
433 return GNUNET_OK; 383 return GNUNET_OK;
434} 384}
435 385
@@ -445,9 +395,8 @@ save_option_list (const void *cls,
445 * @return TRUE to stop other handlers from being invoked 395 * @return TRUE to stop other handlers from being invoked
446 */ 396 */
447gboolean 397gboolean
448GNUNET_setup_treeview_key_press_event_cb (GtkTreeView *tv, 398GNUNET_setup_treeview_key_press_event_cb (GtkTreeView * tv, GdkEventKey * event,
449 GdkEventKey *event, 399 gpointer user_data)
450 gpointer user_data)
451{ 400{
452 GtkListStore *ls; 401 GtkListStore *ls;
453 GtkTreeModel *tm; 402 GtkTreeModel *tm;
@@ -455,25 +404,21 @@ GNUNET_setup_treeview_key_press_event_cb (GtkTreeView *tv,
455 GtkTreeIter iter; 404 GtkTreeIter iter;
456 gboolean editable; 405 gboolean editable;
457 406
458 if ( (event->type != GDK_KEY_PRESS) || 407 if ((event->type != GDK_KEY_PRESS) || (event->state != 0) ||
459 (event->state != 0) || 408 (event->keyval != GDK_Delete))
460 (event->keyval != GDK_Delete) )
461 return FALSE; 409 return FALSE;
462 ls = GTK_LIST_STORE (gtk_tree_view_get_model (tv)); 410 ls = GTK_LIST_STORE (gtk_tree_view_get_model (tv));
463 if (ls == NULL) 411 if (ls == NULL)
464 { 412 {
465 GNUNET_break (0); 413 GNUNET_break (0);
466 return FALSE; 414 return FALSE;
467 } 415 }
468 sel = gtk_tree_view_get_selection (tv); 416 sel = gtk_tree_view_get_selection (tv);
469 if (TRUE != 417 if (TRUE != gtk_tree_selection_get_selected (sel, &tm, &iter))
470 gtk_tree_selection_get_selected (sel,
471 &tm,
472 &iter))
473 return FALSE; 418 return FALSE;
474 gtk_tree_model_get (tm, &iter, 1, &editable, -1); 419 gtk_tree_model_get (tm, &iter, 1, &editable, -1);
475 if (TRUE == editable) 420 if (TRUE == editable)
476 return FALSE; /* likely currently editing... */ 421 return FALSE; /* likely currently editing... */
477 gtk_list_store_remove (ls, &iter); 422 gtk_list_store_remove (ls, &iter);
478 gtk_tree_model_get_iter_first (tm, &iter); 423 gtk_tree_model_get_iter_first (tm, &iter);
479 gtk_tree_selection_select_iter (sel, &iter); 424 gtk_tree_selection_select_iter (sel, &iter);
@@ -493,12 +438,9 @@ GNUNET_setup_treeview_key_press_event_cb (GtkTreeView *tv,
493 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 438 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
494 */ 439 */
495static int 440static int
496load_string_list_store (const void *cls, 441load_string_list_store (const void *cls, const char *section,
497 const char *section, 442 const char *option, const char *value, GObject * widget,
498 const char *option, 443 const struct GNUNET_CONFIGURATION_Handle *cfg)
499 const char *value,
500 GObject *widget,
501 const struct GNUNET_CONFIGURATION_Handle *cfg)
502{ 444{
503 char *t; 445 char *t;
504 char *w; 446 char *w;
@@ -511,22 +453,12 @@ load_string_list_store (const void *cls,
511 t = GNUNET_strdup (value); 453 t = GNUNET_strdup (value);
512 w = strtok (t, " "); 454 w = strtok (t, " ");
513 while (w != NULL) 455 while (w != NULL)
514 { 456 {
515 gtk_list_store_insert_with_values (ls, 457 gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, w, 1, FALSE, -1);
516 &iter, 458 w = strtok (NULL, " ");
517 G_MAXINT, 459 }
518 0, w,
519 1, FALSE,
520 -1);
521 w = strtok (NULL, " ");
522 }
523 GNUNET_free (t); 460 GNUNET_free (t);
524 gtk_list_store_insert_with_values (ls, 461 gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, "", 1, TRUE, -1);
525 &iter,
526 G_MAXINT,
527 0, "",
528 1, TRUE,
529 -1);
530 return GNUNET_OK; 462 return GNUNET_OK;
531} 463}
532 464
@@ -543,11 +475,9 @@ load_string_list_store (const void *cls,
543 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 475 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
544 */ 476 */
545static int 477static int
546save_string_list_store (const void *cls, 478save_string_list_store (const void *cls, const char *section,
547 const char *section, 479 const char *option, GObject * widget,
548 const char *option, 480 struct GNUNET_CONFIGURATION_Handle *cfg)
549 GObject *widget,
550 struct GNUNET_CONFIGURATION_Handle *cfg)
551{ 481{
552 GtkTreeModel *tm; 482 GtkTreeModel *tm;
553 GtkTreeIter iter; 483 GtkTreeIter iter;
@@ -560,37 +490,28 @@ save_string_list_store (const void *cls,
560 return GNUNET_SYSERR; 490 return GNUNET_SYSERR;
561 value = NULL; 491 value = NULL;
562 if (TRUE == gtk_tree_model_get_iter_first (tm, &iter)) 492 if (TRUE == gtk_tree_model_get_iter_first (tm, &iter))
493 {
494 do
563 { 495 {
564 do 496 gtk_tree_model_get (tm, &iter, 0, &val, -1);
565 { 497 if (value == NULL)
566 gtk_tree_model_get (tm, 498 {
567 &iter, 499 value = GNUNET_strdup (val);
568 0, &val, 500 }
569 -1); 501 else
570 if (value == NULL) 502 {
571 { 503 GNUNET_asprintf (&n, "%s %s", value, val);
572 value = GNUNET_strdup (val); 504 GNUNET_free (value);
573 } 505 value = n;
574 else 506 }
575 { 507 g_free (val);
576 GNUNET_asprintf (&n,
577 "%s %s",
578 value,
579 val);
580 GNUNET_free (value);
581 value = n;
582 }
583 g_free (val);
584 }
585 while (TRUE == gtk_tree_model_iter_next (tm, &iter));
586 } 508 }
509 while (TRUE == gtk_tree_model_iter_next (tm, &iter));
510 }
587 if (value == NULL) 511 if (value == NULL)
588 value = GNUNET_strdup (""); 512 value = GNUNET_strdup ("");
589 GNUNET_CONFIGURATION_set_value_string (cfg, 513 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, value);
590 section, 514 GNUNET_free (value);
591 option,
592 value);
593 GNUNET_free (value);
594 return GNUNET_OK; 515 return GNUNET_OK;
595} 516}
596 517
@@ -613,88 +534,74 @@ add_dns_entry_to_list_store (void *cls, const char *section)
613 char *redirect; 534 char *redirect;
614 char *cpy; 535 char *cpy;
615 gboolean udp; 536 gboolean udp;
616 537
617 if (NULL == section) 538 if (NULL == section)
618 { 539 {
619 gtk_list_store_insert_with_values (ls, 540 gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, "", 1,
620 &iter, 541 (guint) 80, 2, (guint) 8080, 3,
621 G_MAXINT, 542 "localhost", 4, "tcp", -1);
622 0, "", 543 return;
623 1, (guint) 80, 544 }
624 2, (guint) 8080,
625 3, "localhost",
626 4, "tcp",
627 -1);
628 return;
629 }
630 545
631 if ( (8 > strlen (section)) || 546 if ((8 > strlen (section)) ||
632 (0 != strcmp (".gnunet.", section + ((strlen (section) - 8)))) ) 547 (0 != strcmp (".gnunet.", section + ((strlen (section) - 8)))))
633 return; 548 return;
634 sld = GNUNET_strdup (section); 549 sld = GNUNET_strdup (section);
635 sld[strlen (section) - 8] = '\0'; 550 sld[strlen (section) - 8] = '\0';
636 udp = FALSE; 551 udp = FALSE;
637 do 552 do
638 { 553 {
639 if (GNUNET_OK == 554 if (GNUNET_OK ==
640 GNUNET_CONFIGURATION_get_value_string (cfg, section, 555 GNUNET_CONFIGURATION_get_value_string (cfg, section,
641 (TRUE == udp) 556 (TRUE ==
642 ? "UDP_REDIRECTS" 557 udp) ? "UDP_REDIRECTS" :
643 : "TCP_REDIRECTS", 558 "TCP_REDIRECTS", &cpy))
644 &cpy)) 559 {
645 { 560 for (redirect = strtok (cpy, " "); redirect != NULL;
646 for (redirect = strtok (cpy, " "); redirect != NULL; 561 redirect = strtok (NULL, " "))
647 redirect = strtok (NULL, " ")) 562 {
648 { 563 if (NULL == (hostname = strstr (redirect, ":")))
649 if (NULL == (hostname = strstr (redirect, ":"))) 564 {
650 { 565 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
651 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 566 _("Option `%s' is not formatted correctly!\n"), redirect);
652 _("Option `%s' is not formatted correctly!\n"), 567 continue;
653 redirect); 568 }
654 continue; 569 hostname[0] = '\0';
655 } 570 hostname++;
656 hostname[0] = '\0'; 571 if (NULL == (hostport = strstr (hostname, ":")))
657 hostname++; 572 {
658 if (NULL == (hostport = strstr (hostname, ":"))) 573 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
659 { 574 _("Option `%s' is not formatted correctly!\n"), redirect);
660 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 575 continue;
661 _("Option `%s' is not formatted correctly!\n"), 576 }
662 redirect); 577 hostport[0] = '\0';
663 continue; 578 hostport++;
664 } 579
665 hostport[0] = '\0'; 580 int local_port = atoi (redirect);
666 hostport++; 581
667 582 if (!((local_port > 0) && (local_port < 65536)))
668 int local_port = atoi (redirect); 583 {
669 if (!((local_port > 0) && (local_port < 65536))) 584 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
670 { 585 _("`%s' is not a valid port number!\n"), redirect);
671 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 586 continue;
672 _("`%s' is not a valid port number!\n"), 587 }
673 redirect); 588 int host_port = atoi (hostport);
674 continue; 589
675 } 590 if (!((host_port > 0) && (host_port < 65536)))
676 int host_port = atoi (hostport); 591 {
677 if (!((host_port > 0) && (host_port < 65536))) 592 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
678 { 593 _("`%s' is not a valid port number!\n"), hostport);
679 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 594 continue;
680 _("`%s' is not a valid port number!\n"), 595 }
681 hostport); 596 gtk_list_store_insert_with_values (ls, &iter, 0, 0, sld, 1,
682 continue; 597 (guint) local_port, 2,
683 } 598 (guint) host_port, 3, hostname, 4,
684 gtk_list_store_insert_with_values (ls, 599 (TRUE == udp) ? "udp" : "tcp", -1);
685 &iter, 600 }
686 0, 601 GNUNET_free (cpy);
687 0, sld,
688 1, (guint) local_port,
689 2, (guint) host_port,
690 3, hostname,
691 4, (TRUE == udp) ? "udp" : "tcp",
692 -1);
693 }
694 GNUNET_free (cpy);
695 }
696 udp = !udp;
697 } 602 }
603 udp = !udp;
604 }
698 while (udp != FALSE); 605 while (udp != FALSE);
699 GNUNET_free (sld); 606 GNUNET_free (sld);
700} 607}
@@ -712,26 +619,22 @@ add_dns_entry_to_list_store (void *cls, const char *section)
712 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem 619 * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
713 */ 620 */
714static int 621static int
715load_vpn_dns_configuration (const void *cls, 622load_vpn_dns_configuration (const void *cls, const char *section,
716 const char *section, 623 const char *option, const char *value,
717 const char *option, 624 GObject * widget,
718 const char *value, 625 const struct GNUNET_CONFIGURATION_Handle *cfg)
719 GObject *widget,
720 const struct GNUNET_CONFIGURATION_Handle *cfg)
721{ 626{
722 GtkTreeView *tv; 627 GtkTreeView *tv;
723 GtkListStore *ls; 628 GtkListStore *ls;
724 629
725 tv = GTK_TREE_VIEW (widget); 630 tv = GTK_TREE_VIEW (widget);
726 if (tv == NULL) 631 if (tv == NULL)
727 { 632 {
728 GNUNET_break (0); 633 GNUNET_break (0);
729 return GNUNET_SYSERR; 634 return GNUNET_SYSERR;
730 } 635 }
731 ls = GTK_LIST_STORE (gtk_tree_view_get_model (tv)); 636 ls = GTK_LIST_STORE (gtk_tree_view_get_model (tv));
732 GNUNET_CONFIGURATION_iterate_sections (cfg, 637 GNUNET_CONFIGURATION_iterate_sections (cfg, &add_dns_entry_to_list_store, ls);
733 &add_dns_entry_to_list_store,
734 ls);
735 /* finally, add empty entry */ 638 /* finally, add empty entry */
736 add_dns_entry_to_list_store (ls, NULL); 639 add_dns_entry_to_list_store (ls, NULL);
737 return GNUNET_OK; 640 return GNUNET_OK;
@@ -741,14 +644,14 @@ load_vpn_dns_configuration (const void *cls,
741/** 644/**
742 * Records we use to build DNS information lists. 645 * Records we use to build DNS information lists.
743 */ 646 */
744struct DnsInfo 647struct DnsInfo
745{ 648{
746 struct DnsInfo *next; 649 struct DnsInfo *next;
747 char *section; 650 char *section;
748 char *altnames; 651 char *altnames;
749 char *tcpred; 652 char *tcpred;
750 char *udpred; 653 char *udpred;
751 unsigned long long ttl; 654 unsigned long long ttl;
752}; 655};
753 656
754 657
@@ -760,14 +663,13 @@ struct DnsInfo
760 * @param section name of a section in the configuration 663 * @param section name of a section in the configuration
761 */ 664 */
762static void 665static void
763collect_dns_sections (void *cls, 666collect_dns_sections (void *cls, const char *section)
764 const char *section)
765{ 667{
766 struct DnsInfo **base = cls; 668 struct DnsInfo **base = cls;
767 struct DnsInfo *pos; 669 struct DnsInfo *pos;
768 670
769 if ( (8 > strlen (section)) || 671 if ((8 > strlen (section)) ||
770 (0 != strcmp (".gnunet.", section + ((strlen (section) - 8)))) ) 672 (0 != strcmp (".gnunet.", section + ((strlen (section) - 8)))))
771 return; 673 return;
772 pos = GNUNET_malloc (sizeof (struct DnsInfo)); 674 pos = GNUNET_malloc (sizeof (struct DnsInfo));
773 pos->section = GNUNET_strdup (section); 675 pos->section = GNUNET_strdup (section);
@@ -775,7 +677,8 @@ collect_dns_sections (void *cls,
775 GNUNET_CONFIGURATION_get_value_number (cfg, section, "TTL", &pos->ttl)) 677 GNUNET_CONFIGURATION_get_value_number (cfg, section, "TTL", &pos->ttl))
776 pos->ttl = 3600000; 678 pos->ttl = 3600000;
777 if (GNUNET_OK != 679 if (GNUNET_OK !=
778 GNUNET_CONFIGURATION_get_value_string (cfg, section, "ALTERNATIVE_NAMES", &pos->altnames)) 680 GNUNET_CONFIGURATION_get_value_string (cfg, section, "ALTERNATIVE_NAMES",
681 &pos->altnames))
779 pos->altnames = NULL; 682 pos->altnames = NULL;
780 pos->tcpred = GNUNET_strdup (""); 683 pos->tcpred = GNUNET_strdup ("");
781 pos->udpred = GNUNET_strdup (""); 684 pos->udpred = GNUNET_strdup ("");
@@ -792,11 +695,10 @@ collect_dns_sections (void *cls,
792 * @param section name of a section in the configuration 695 * @param section name of a section in the configuration
793 */ 696 */
794static void 697static void
795remove_dns_sections (void *cls, 698remove_dns_sections (void *cls, const char *section)
796 const char *section)
797{ 699{
798 if ( (8 > strlen (section)) || 700 if ((8 > strlen (section)) ||
799 (0 != strcmp (".gnunet.", section + ((strlen (section) - 8)))) ) 701 (0 != strcmp (".gnunet.", section + ((strlen (section) - 8)))))
800 return; 702 return;
801 GNUNET_CONFIGURATION_remove_section (cfg, section); 703 GNUNET_CONFIGURATION_remove_section (cfg, section);
802} 704}
@@ -809,7 +711,7 @@ remove_dns_sections (void *cls,
809 * @param tm model to use 711 * @param tm model to use
810 */ 712 */
811static void 713static void
812update_vpn_dns_configuration (GtkTreeModel *tm) 714update_vpn_dns_configuration (GtkTreeModel * tm)
813{ 715{
814 GtkTreeIter iter; 716 GtkTreeIter iter;
815 gchar *hostname; 717 gchar *hostname;
@@ -822,99 +724,76 @@ update_vpn_dns_configuration (GtkTreeModel *tm)
822 struct DnsInfo *pos; 724 struct DnsInfo *pos;
823 725
824 head = NULL; 726 head = NULL;
825 GNUNET_CONFIGURATION_iterate_sections (cfg, 727 GNUNET_CONFIGURATION_iterate_sections (cfg, &collect_dns_sections, &head);
826 &collect_dns_sections, 728 if (TRUE == gtk_tree_model_get_iter_first (tm, &iter))
827 &head);
828 if (TRUE ==
829 gtk_tree_model_get_iter_first (tm, &iter))
830 do 729 do
831 { 730 {
832 gtk_tree_model_get (tm, &iter, 731 gtk_tree_model_get (tm, &iter, 0, &hostname, 1, &srcport, 2, &targetport,
833 0, &hostname, 732 3, &targethost, 4, &tcpudp, -1);
834 1, &srcport, 733 if (0 != strlen (hostname))
835 2, &targetport, 734 {
836 3, &targethost, 735 pos = head;
837 4, &tcpudp, 736 GNUNET_asprintf (&tmp, "%s.gnunet.", hostname);
838 -1); 737 while ((NULL != pos) && (0 != strcasecmp (tmp, pos->section)))
839 if (0 != strlen (hostname)) 738 pos = pos->next;
840 { 739 if (pos == NULL)
841 pos = head; 740 {
842 GNUNET_asprintf (&tmp, 741 pos = GNUNET_malloc (sizeof (struct DnsInfo));
843 "%s.gnunet.", 742 pos->section = tmp;
844 hostname); 743 pos->ttl = 3600000;
845 while ( (NULL != pos) && 744 pos->altnames = NULL;
846 (0 != strcasecmp (tmp, pos->section)) ) 745 pos->tcpred = GNUNET_strdup ("");
847 pos = pos->next; 746 pos->udpred = GNUNET_strdup ("");
848 if (pos == NULL) 747 pos->next = head;
849 { 748 head = pos;
850 pos = GNUNET_malloc (sizeof (struct DnsInfo)); 749 }
851 pos->section = tmp; 750 else
852 pos->ttl = 3600000; 751 {
853 pos->altnames = NULL; 752 GNUNET_free (tmp);
854 pos->tcpred = GNUNET_strdup (""); 753 }
855 pos->udpred = GNUNET_strdup (""); 754
856 pos->next = head; 755 GNUNET_asprintf (&tmp, "%u:%s:%u %s", srcport, targethost, targetport,
857 head = pos; 756 (0 ==
858 } 757 strcasecmp ("tcp",
859 else 758 tcpudp)) ? pos->tcpred : pos->udpred);
860 { 759 if (0 == strcasecmp ("tcp", tcpudp))
861 GNUNET_free (tmp); 760 {
862 } 761 GNUNET_free (pos->tcpred);
863 762 pos->tcpred = tmp;
864 GNUNET_asprintf (&tmp, 763 }
865 "%u:%s:%u %s", 764 else
866 srcport, 765 {
867 targethost, 766 GNUNET_free (pos->udpred);
868 targetport, 767 pos->udpred = tmp;
869 (0 == strcasecmp ("tcp", tcpudp)) ? pos->tcpred : pos->udpred); 768 }
870 if (0 == strcasecmp ("tcp", tcpudp))
871 {
872 GNUNET_free (pos->tcpred);
873 pos->tcpred = tmp;
874 }
875 else
876 {
877 GNUNET_free (pos->udpred);
878 pos->udpred = tmp;
879 }
880 }
881 g_free (tcpudp);
882 g_free (hostname);
883 g_free (targethost);
884 } 769 }
770 g_free (tcpudp);
771 g_free (hostname);
772 g_free (targethost);
773 }
885 while (TRUE == gtk_tree_model_iter_next (tm, &iter)); 774 while (TRUE == gtk_tree_model_iter_next (tm, &iter));
886 GNUNET_CONFIGURATION_iterate_sections (cfg, 775 GNUNET_CONFIGURATION_iterate_sections (cfg, &remove_dns_sections, NULL);
887 &remove_dns_sections,
888 NULL);
889 while (NULL != head) 776 while (NULL != head)
890 { 777 {
891 pos = head; 778 pos = head;
892 head = pos->next; 779 head = pos->next;
893 if (pos->altnames != NULL) 780 if (pos->altnames != NULL)
894 GNUNET_CONFIGURATION_set_value_string (cfg, 781 GNUNET_CONFIGURATION_set_value_string (cfg, pos->section,
895 pos->section, 782 "ALTERNATIVE_NAMES",
896 "ALTERNATIVE_NAMES", 783 pos->altnames);
897 pos->altnames); 784 if (strlen (pos->udpred) > 0)
898 if (strlen (pos->udpred) > 0) 785 GNUNET_CONFIGURATION_set_value_string (cfg, pos->section, "UDP_REDIRECTS",
899 GNUNET_CONFIGURATION_set_value_string (cfg, 786 pos->udpred);
900 pos->section, 787 if (strlen (pos->tcpred) > 0)
901 "UDP_REDIRECTS", 788 GNUNET_CONFIGURATION_set_value_string (cfg, pos->section, "TCP_REDIRECTS",
902 pos->udpred); 789 pos->tcpred);
903 if (strlen (pos->tcpred) > 0) 790 GNUNET_CONFIGURATION_set_value_number (cfg, pos->section, "TTL", pos->ttl);
904 GNUNET_CONFIGURATION_set_value_string (cfg, 791 GNUNET_free_non_null (pos->altnames);
905 pos->section, 792 GNUNET_free (pos->tcpred);
906 "TCP_REDIRECTS", 793 GNUNET_free (pos->udpred);
907 pos->tcpred); 794 GNUNET_free (pos->section);
908 GNUNET_CONFIGURATION_set_value_number (cfg, 795 GNUNET_free (pos);
909 pos->section, 796 }
910 "TTL",
911 pos->ttl);
912 GNUNET_free_non_null (pos->altnames);
913 GNUNET_free (pos->tcpred);
914 GNUNET_free (pos->udpred);
915 GNUNET_free (pos->section);
916 GNUNET_free (pos);
917 }
918} 797}
919 798
920 799
@@ -932,10 +811,8 @@ update_vpn_dns_configuration (GtkTreeModel *tm)
932 * @param user_data NULL 811 * @param user_data NULL
933 */ 812 */
934static void 813static void
935save_vpn_dns_service_dnsname (GtkCellRendererText *renderer, 814save_vpn_dns_service_dnsname (GtkCellRendererText * renderer, gchar * path,
936 gchar *path, 815 gchar * new_text, gpointer user_data)
937 gchar *new_text,
938 gpointer user_data)
939{ 816{
940 GtkTreeModel *tm; 817 GtkTreeModel *tm;
941 GtkListStore *ls; 818 GtkListStore *ls;
@@ -944,44 +821,38 @@ save_vpn_dns_service_dnsname (GtkCellRendererText *renderer,
944 821
945 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore")); 822 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
946 if (NULL == tm) 823 if (NULL == tm)
947 { 824 {
948 GNUNET_break (0); 825 GNUNET_break (0);
949 return; 826 return;
950 } 827 }
951 ls = GTK_LIST_STORE (tm); 828 ls = GTK_LIST_STORE (tm);
952 if (NULL == ls) 829 if (NULL == ls)
953 { 830 {
954 GNUNET_break (0); 831 GNUNET_break (0);
955 return; 832 return;
956 } 833 }
957 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path)) 834 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path))
958 { 835 {
959 GNUNET_break (0); 836 GNUNET_break (0);
960 return; 837 return;
961 } 838 }
962 gtk_tree_model_get (tm, &iter, 839 gtk_tree_model_get (tm, &iter, 0, &old, -1);
963 0, &old, 840 if ((0 != strlen (old)) && (0 == strlen (new_text)))
964 -1); 841 {
965 if ( (0 != strlen (old)) && 842 /* deletion */
966 (0 == strlen (new_text)) ) 843 gtk_list_store_remove (ls, &iter);
967 { 844 g_free (old);
968 /* deletion */ 845 return;
969 gtk_list_store_remove (ls, &iter); 846 }
970 g_free (old);
971 return;
972 }
973 /* update model */ 847 /* update model */
974 gtk_list_store_set (ls, &iter, 848 gtk_list_store_set (ls, &iter, 0, new_text, -1);
975 0, new_text,
976 -1);
977 /* update configuration */ 849 /* update configuration */
978 update_vpn_dns_configuration (tm); 850 update_vpn_dns_configuration (tm);
979 if ( (0 == strlen (old)) && 851 if ((0 == strlen (old)) && (0 != strlen (new_text)))
980 (0 != strlen (new_text)) ) 852 {
981 { 853 /* need another empty entry at the end for future expansion */
982 /* need another empty entry at the end for future expansion */ 854 add_dns_entry_to_list_store (GTK_LIST_STORE (tm), NULL);
983 add_dns_entry_to_list_store (GTK_LIST_STORE (tm), NULL); 855 }
984 }
985 g_free (old); 856 g_free (old);
986} 857}
987 858
@@ -998,23 +869,23 @@ save_vpn_dns_service_dnsname (GtkCellRendererText *renderer,
998 */ 869 */
999static int 870static int
1000vpn_dns_service_dnsname_install_edited_handler (const void *cls, 871vpn_dns_service_dnsname_install_edited_handler (const void *cls,
1001 const char *section, 872 const char *section,
1002 const char *option, 873 const char *option,
1003 GObject *widget, 874 GObject * widget,
1004 struct GNUNET_CONFIGURATION_Handle *cfg) 875 struct
876 GNUNET_CONFIGURATION_Handle
877 *cfg)
1005{ 878{
1006 static int once; 879 static int once;
1007 GtkCellRendererText *rt; 880 GtkCellRendererText *rt;
1008 881
1009 rt = GTK_CELL_RENDERER_TEXT(widget); 882 rt = GTK_CELL_RENDERER_TEXT (widget);
1010 if (NULL == rt) 883 if (NULL == rt)
1011 return GNUNET_SYSERR; 884 return GNUNET_SYSERR;
1012 if (0 != once++) 885 if (0 != once++)
1013 return GNUNET_OK; 886 return GNUNET_OK;
1014 g_signal_connect (rt, 887 g_signal_connect (rt, "edited", G_CALLBACK (&save_vpn_dns_service_dnsname),
1015 "edited", 888 NULL);
1016 G_CALLBACK (&save_vpn_dns_service_dnsname),
1017 NULL);
1018 return GNUNET_OK; 889 return GNUNET_OK;
1019} 890}
1020 891
@@ -1033,42 +904,38 @@ vpn_dns_service_dnsname_install_edited_handler (const void *cls,
1033 * @param user_data NULL 904 * @param user_data NULL
1034 */ 905 */
1035static void 906static void
1036save_vpn_dns_service_tcpudp (GtkCellRendererText *renderer, 907save_vpn_dns_service_tcpudp (GtkCellRendererText * renderer, gchar * path,
1037 gchar *path, 908 gchar * new_text, gpointer user_data)
1038 gchar *new_text,
1039 gpointer user_data)
1040{ 909{
1041 GtkTreeModel *tm; 910 GtkTreeModel *tm;
1042 GtkListStore *ls; 911 GtkListStore *ls;
1043 GtkTreeIter iter; 912 GtkTreeIter iter;
1044 913
1045 if ( (0 != strcasecmp ("tcp", new_text)) && 914 if ((0 != strcasecmp ("tcp", new_text)) &&
1046 (0 != strcasecmp ("udp", new_text)) ) 915 (0 != strcasecmp ("udp", new_text)))
1047 { 916 {
1048 /* FIXME: warn... */ 917 /* FIXME: warn... */
1049 return; 918 return;
1050 } 919 }
1051 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore")); 920 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
1052 if (NULL == tm) 921 if (NULL == tm)
1053 { 922 {
1054 GNUNET_break (0); 923 GNUNET_break (0);
1055 return; 924 return;
1056 } 925 }
1057 ls = GTK_LIST_STORE (tm); 926 ls = GTK_LIST_STORE (tm);
1058 if (NULL == ls) 927 if (NULL == ls)
1059 { 928 {
1060 GNUNET_break (0); 929 GNUNET_break (0);
1061 return; 930 return;
1062 } 931 }
1063 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path)) 932 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path))
1064 { 933 {
1065 GNUNET_break (0); 934 GNUNET_break (0);
1066 return; 935 return;
1067 } 936 }
1068 /* update model */ 937 /* update model */
1069 gtk_list_store_set (ls, &iter, 938 gtk_list_store_set (ls, &iter, 4, new_text, -1);
1070 4, new_text,
1071 -1);
1072 /* update configuration */ 939 /* update configuration */
1073 update_vpn_dns_configuration (tm); 940 update_vpn_dns_configuration (tm);
1074} 941}
@@ -1086,23 +953,22 @@ save_vpn_dns_service_tcpudp (GtkCellRendererText *renderer,
1086 */ 953 */
1087static int 954static int
1088vpn_dns_service_tcpudp_install_edited_handler (const void *cls, 955vpn_dns_service_tcpudp_install_edited_handler (const void *cls,
1089 const char *section, 956 const char *section,
1090 const char *option, 957 const char *option,
1091 GObject *widget, 958 GObject * widget,
1092 struct GNUNET_CONFIGURATION_Handle *cfg) 959 struct
960 GNUNET_CONFIGURATION_Handle *cfg)
1093{ 961{
1094 static int once; 962 static int once;
1095 GtkCellRendererText *rt; 963 GtkCellRendererText *rt;
1096 964
1097 rt = GTK_CELL_RENDERER_TEXT(widget); 965 rt = GTK_CELL_RENDERER_TEXT (widget);
1098 if (NULL == rt) 966 if (NULL == rt)
1099 return GNUNET_SYSERR; 967 return GNUNET_SYSERR;
1100 if (0 != once++) 968 if (0 != once++)
1101 return GNUNET_OK; 969 return GNUNET_OK;
1102 g_signal_connect (rt, 970 g_signal_connect (rt, "edited", G_CALLBACK (&save_vpn_dns_service_tcpudp),
1103 "edited", 971 NULL);
1104 G_CALLBACK (&save_vpn_dns_service_tcpudp),
1105 NULL);
1106 return GNUNET_OK; 972 return GNUNET_OK;
1107} 973}
1108 974
@@ -1121,10 +987,8 @@ vpn_dns_service_tcpudp_install_edited_handler (const void *cls,
1121 * @param user_data NULL 987 * @param user_data NULL
1122 */ 988 */
1123static void 989static void
1124save_vpn_dns_service_sourceport (GtkCellRendererText *renderer, 990save_vpn_dns_service_sourceport (GtkCellRendererText * renderer, gchar * path,
1125 gchar *path, 991 gchar * new_text, gpointer user_data)
1126 gchar *new_text,
1127 gpointer user_data)
1128{ 992{
1129 GtkTreeModel *tm; 993 GtkTreeModel *tm;
1130 GtkListStore *ls; 994 GtkListStore *ls;
@@ -1132,32 +996,30 @@ save_vpn_dns_service_sourceport (GtkCellRendererText *renderer,
1132 int port; 996 int port;
1133 997
1134 port = atoi (new_text); 998 port = atoi (new_text);
1135 if ( (port < 1) || (port > UINT16_MAX) ) 999 if ((port < 1) || (port > UINT16_MAX))
1136 { 1000 {
1137 /* invalid port, FIXME: warn */ 1001 /* invalid port, FIXME: warn */
1138 return; 1002 return;
1139 } 1003 }
1140 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore")); 1004 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
1141 if (NULL == tm) 1005 if (NULL == tm)
1142 { 1006 {
1143 GNUNET_break (0); 1007 GNUNET_break (0);
1144 return; 1008 return;
1145 } 1009 }
1146 ls = GTK_LIST_STORE (tm); 1010 ls = GTK_LIST_STORE (tm);
1147 if (NULL == ls) 1011 if (NULL == ls)
1148 { 1012 {
1149 GNUNET_break (0); 1013 GNUNET_break (0);
1150 return; 1014 return;
1151 } 1015 }
1152 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path)) 1016 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path))
1153 { 1017 {
1154 GNUNET_break (0); 1018 GNUNET_break (0);
1155 return; 1019 return;
1156 } 1020 }
1157 /* update model */ 1021 /* update model */
1158 gtk_list_store_set (ls, &iter, 1022 gtk_list_store_set (ls, &iter, 1, (guint) port, -1);
1159 1, (guint) port,
1160 -1);
1161 /* update configuration */ 1023 /* update configuration */
1162 update_vpn_dns_configuration (tm); 1024 update_vpn_dns_configuration (tm);
1163} 1025}
@@ -1175,23 +1037,23 @@ save_vpn_dns_service_sourceport (GtkCellRendererText *renderer,
1175 */ 1037 */
1176static int 1038static int
1177vpn_dns_service_sourceport_install_edited_handler (const void *cls, 1039vpn_dns_service_sourceport_install_edited_handler (const void *cls,
1178 const char *section, 1040 const char *section,
1179 const char *option, 1041 const char *option,
1180 GObject *widget, 1042 GObject * widget,
1181 struct GNUNET_CONFIGURATION_Handle *cfg) 1043 struct
1044 GNUNET_CONFIGURATION_Handle
1045 *cfg)
1182{ 1046{
1183 static int once; 1047 static int once;
1184 GtkCellRendererText *rt; 1048 GtkCellRendererText *rt;
1185 1049
1186 rt = GTK_CELL_RENDERER_TEXT(widget); 1050 rt = GTK_CELL_RENDERER_TEXT (widget);
1187 if (NULL == rt) 1051 if (NULL == rt)
1188 return GNUNET_SYSERR; 1052 return GNUNET_SYSERR;
1189 if (0 != once++) 1053 if (0 != once++)
1190 return GNUNET_OK; 1054 return GNUNET_OK;
1191 g_signal_connect (rt, 1055 g_signal_connect (rt, "edited", G_CALLBACK (&save_vpn_dns_service_sourceport),
1192 "edited", 1056 NULL);
1193 G_CALLBACK (&save_vpn_dns_service_sourceport),
1194 NULL);
1195 return GNUNET_OK; 1057 return GNUNET_OK;
1196} 1058}
1197 1059
@@ -1210,10 +1072,9 @@ vpn_dns_service_sourceport_install_edited_handler (const void *cls,
1210 * @param user_data NULL 1072 * @param user_data NULL
1211 */ 1073 */
1212static void 1074static void
1213save_vpn_dns_service_targethostname (GtkCellRendererText *renderer, 1075save_vpn_dns_service_targethostname (GtkCellRendererText * renderer,
1214 gchar *path, 1076 gchar * path, gchar * new_text,
1215 gchar *new_text, 1077 gpointer user_data)
1216 gpointer user_data)
1217{ 1078{
1218 GtkTreeModel *tm; 1079 GtkTreeModel *tm;
1219 GtkListStore *ls; 1080 GtkListStore *ls;
@@ -1221,25 +1082,23 @@ save_vpn_dns_service_targethostname (GtkCellRendererText *renderer,
1221 1082
1222 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore")); 1083 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
1223 if (NULL == tm) 1084 if (NULL == tm)
1224 { 1085 {
1225 GNUNET_break (0); 1086 GNUNET_break (0);
1226 return; 1087 return;
1227 } 1088 }
1228 ls = GTK_LIST_STORE (tm); 1089 ls = GTK_LIST_STORE (tm);
1229 if (NULL == ls) 1090 if (NULL == ls)
1230 { 1091 {
1231 GNUNET_break (0); 1092 GNUNET_break (0);
1232 return; 1093 return;
1233 } 1094 }
1234 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path)) 1095 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path))
1235 { 1096 {
1236 GNUNET_break (0); 1097 GNUNET_break (0);
1237 return; 1098 return;
1238 } 1099 }
1239 /* update model */ 1100 /* update model */
1240 gtk_list_store_set (ls, &iter, 1101 gtk_list_store_set (ls, &iter, 3, new_text, -1);
1241 3, new_text,
1242 -1);
1243 /* update configuration */ 1102 /* update configuration */
1244 update_vpn_dns_configuration (tm); 1103 update_vpn_dns_configuration (tm);
1245} 1104}
@@ -1257,23 +1116,23 @@ save_vpn_dns_service_targethostname (GtkCellRendererText *renderer,
1257 */ 1116 */
1258static int 1117static int
1259vpn_dns_service_targethostname_install_edited_handler (const void *cls, 1118vpn_dns_service_targethostname_install_edited_handler (const void *cls,
1260 const char *section, 1119 const char *section,
1261 const char *option, 1120 const char *option,
1262 GObject *widget, 1121 GObject * widget,
1263 struct GNUNET_CONFIGURATION_Handle *cfg) 1122 struct
1123 GNUNET_CONFIGURATION_Handle
1124 *cfg)
1264{ 1125{
1265 static int once; 1126 static int once;
1266 GtkCellRendererText *rt; 1127 GtkCellRendererText *rt;
1267 1128
1268 rt = GTK_CELL_RENDERER_TEXT(widget); 1129 rt = GTK_CELL_RENDERER_TEXT (widget);
1269 if (NULL == rt) 1130 if (NULL == rt)
1270 return GNUNET_SYSERR; 1131 return GNUNET_SYSERR;
1271 if (0 != once++) 1132 if (0 != once++)
1272 return GNUNET_OK; 1133 return GNUNET_OK;
1273 g_signal_connect (rt, 1134 g_signal_connect (rt, "edited",
1274 "edited", 1135 G_CALLBACK (&save_vpn_dns_service_targethostname), NULL);
1275 G_CALLBACK (&save_vpn_dns_service_targethostname),
1276 NULL);
1277 return GNUNET_OK; 1136 return GNUNET_OK;
1278} 1137}
1279 1138
@@ -1292,10 +1151,8 @@ vpn_dns_service_targethostname_install_edited_handler (const void *cls,
1292 * @param user_data NULL 1151 * @param user_data NULL
1293 */ 1152 */
1294static void 1153static void
1295save_vpn_dns_service_targetport (GtkCellRendererText *renderer, 1154save_vpn_dns_service_targetport (GtkCellRendererText * renderer, gchar * path,
1296 gchar *path, 1155 gchar * new_text, gpointer user_data)
1297 gchar *new_text,
1298 gpointer user_data)
1299{ 1156{
1300 GtkTreeModel *tm; 1157 GtkTreeModel *tm;
1301 GtkListStore *ls; 1158 GtkListStore *ls;
@@ -1303,32 +1160,30 @@ save_vpn_dns_service_targetport (GtkCellRendererText *renderer,
1303 int port; 1160 int port;
1304 1161
1305 port = atoi (new_text); 1162 port = atoi (new_text);
1306 if ( (port < 1) || (port > UINT16_MAX) ) 1163 if ((port < 1) || (port > UINT16_MAX))
1307 { 1164 {
1308 /* invalid port, FIXME: warn */ 1165 /* invalid port, FIXME: warn */
1309 return; 1166 return;
1310 } 1167 }
1311 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore")); 1168 tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
1312 if (NULL == tm) 1169 if (NULL == tm)
1313 { 1170 {
1314 GNUNET_break (0); 1171 GNUNET_break (0);
1315 return; 1172 return;
1316 } 1173 }
1317 ls = GTK_LIST_STORE (tm); 1174 ls = GTK_LIST_STORE (tm);
1318 if (NULL == ls) 1175 if (NULL == ls)
1319 { 1176 {
1320 GNUNET_break (0); 1177 GNUNET_break (0);
1321 return; 1178 return;
1322 } 1179 }
1323 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path)) 1180 if (TRUE != gtk_tree_model_get_iter_from_string (tm, &iter, path))
1324 { 1181 {
1325 GNUNET_break (0); 1182 GNUNET_break (0);
1326 return; 1183 return;
1327 } 1184 }
1328 /* update model */ 1185 /* update model */
1329 gtk_list_store_set (ls, &iter, 1186 gtk_list_store_set (ls, &iter, 2, (guint) port, -1);
1330 2, (guint) port,
1331 -1);
1332 /* update configuration */ 1187 /* update configuration */
1333 update_vpn_dns_configuration (tm); 1188 update_vpn_dns_configuration (tm);
1334} 1189}
@@ -1346,23 +1201,23 @@ save_vpn_dns_service_targetport (GtkCellRendererText *renderer,
1346 */ 1201 */
1347static int 1202static int
1348vpn_dns_service_targetport_install_edited_handler (const void *cls, 1203vpn_dns_service_targetport_install_edited_handler (const void *cls,
1349 const char *section, 1204 const char *section,
1350 const char *option, 1205 const char *option,
1351 GObject *widget, 1206 GObject * widget,
1352 struct GNUNET_CONFIGURATION_Handle *cfg) 1207 struct
1208 GNUNET_CONFIGURATION_Handle
1209 *cfg)
1353{ 1210{
1354 static int once; 1211 static int once;
1355 GtkCellRendererText *rt; 1212 GtkCellRendererText *rt;
1356 1213
1357 rt = GTK_CELL_RENDERER_TEXT(widget); 1214 rt = GTK_CELL_RENDERER_TEXT (widget);
1358 if (NULL == rt) 1215 if (NULL == rt)
1359 return GNUNET_SYSERR; 1216 return GNUNET_SYSERR;
1360 if (0 != once++) 1217 if (0 != once++)
1361 return GNUNET_OK; 1218 return GNUNET_OK;
1362 g_signal_connect (rt, 1219 g_signal_connect (rt, "edited", G_CALLBACK (&save_vpn_dns_service_targetport),
1363 "edited", 1220 NULL);
1364 G_CALLBACK (&save_vpn_dns_service_targetport),
1365 NULL);
1366 return GNUNET_OK; 1221 return GNUNET_OK;
1367} 1222}
1368 1223
@@ -1370,47 +1225,47 @@ vpn_dns_service_targetport_install_edited_handler (const void *cls,
1370/** 1225/**
1371 * Hide "min connected friends" option if in F2F-only mode. 1226 * Hide "min connected friends" option if in F2F-only mode.
1372 */ 1227 */
1373static struct GNUNET_SETUP_VisibilitySpecification hide_min_connected_friends[] = 1228static struct GNUNET_SETUP_VisibilitySpecification hide_min_connected_friends[]
1374{ 1229 = {
1375 { "GNUNET_setup_minimum_friends_label", NULL, REX_YES }, 1230 {"GNUNET_setup_minimum_friends_label", NULL, REX_YES},
1376 { "GNUNET_setup_minimum_friends_spinbutton", NULL, REX_YES }, 1231 {"GNUNET_setup_minimum_friends_spinbutton", NULL, REX_YES},
1377 { NULL, NULL, NULL } 1232 {NULL, NULL, NULL}
1378}; 1233};
1379 1234
1380 1235
1381/** 1236/**
1382 * Hide "hostlist" options if hostlist is not in use. 1237 * Hide "hostlist" options if hostlist is not in use.
1383 */ 1238 */
1384static struct GNUNET_SETUP_VisibilitySpecification hide_hostlist_options[] = 1239static struct GNUNET_SETUP_VisibilitySpecification hide_hostlist_options[] = {
1385{ 1240 {"GNUNET_setup_hostlist_client_enable_checkbutton", "(^| )hostlist($| )",
1386 { "GNUNET_setup_hostlist_client_enable_checkbutton", "(^| )hostlist($| )", NULL }, 1241 NULL},
1387 { "GNUNET_setup_hostlist_client_learn_checkbutton", "(^| )hostlist($| )", NULL }, 1242 {"GNUNET_setup_hostlist_client_learn_checkbutton", "(^| )hostlist($| )",
1388 { "GNUNET_setup_hostlist_options_hbox", "(^| )hostlist($| )", NULL }, 1243 NULL},
1389 { "GNUNET_setup_hostlist_frame", "(^| )hostlist($| )", NULL }, 1244 {"GNUNET_setup_hostlist_options_hbox", "(^| )hostlist($| )", NULL},
1390 { NULL, NULL, NULL } 1245 {"GNUNET_setup_hostlist_frame", "(^| )hostlist($| )", NULL},
1246 {NULL, NULL, NULL}
1391}; 1247};
1392 1248
1393 1249
1394/** 1250/**
1395 * Hide "exit" options if VPN exit is not in use. 1251 * Hide "exit" options if VPN exit is not in use.
1396 */ 1252 */
1397static struct GNUNET_SETUP_VisibilitySpecification hide_exit_options[] = 1253static struct GNUNET_SETUP_VisibilitySpecification hide_exit_options[] = {
1398{ 1254 {"GNUNET_setup_vpn_exit_frame", "(^| )exit($| )", NULL},
1399 { "GNUNET_setup_vpn_exit_frame", "(^| )exit($| )", NULL }, 1255 {"GNUNET_setup_vpn_service_configuration_frame", "(^| )exit($| )", NULL},
1400 { "GNUNET_setup_vpn_service_configuration_frame", "(^| )exit($| )", NULL }, 1256 {NULL, NULL, NULL}
1401 { NULL, NULL, NULL }
1402}; 1257};
1403 1258
1404 1259
1405/** 1260/**
1406 * Hide "hostlist" server options if hostlist server is not in use. 1261 * Hide "hostlist" server options if hostlist server is not in use.
1407 */ 1262 */
1408static struct GNUNET_SETUP_VisibilitySpecification hide_hostlist_server_options[] = 1263static struct GNUNET_SETUP_VisibilitySpecification
1409{ 1264 hide_hostlist_server_options[] = {
1410 { "GNUNET_setup_hostlist_advertise_checkbutton", "(^| )-p($| )", NULL }, 1265 {"GNUNET_setup_hostlist_advertise_checkbutton", "(^| )-p($| )", NULL},
1411 { "GNUNET_setup_hostlist_port_label", "(^| )-p($| )", NULL }, 1266 {"GNUNET_setup_hostlist_port_label", "(^| )-p($| )", NULL},
1412 { "GNUNET_setup_hostlist_server_port_spin_button", "(^| )-p($| )", NULL }, 1267 {"GNUNET_setup_hostlist_server_port_spin_button", "(^| )-p($| )", NULL},
1413 { NULL, NULL, NULL } 1268 {NULL, NULL, NULL}
1414}; 1269};
1415 1270
1416 1271
@@ -1418,10 +1273,9 @@ static struct GNUNET_SETUP_VisibilitySpecification hide_hostlist_server_options[
1418/** 1273/**
1419 * Hide "fs tab" if FS not active. 1274 * Hide "fs tab" if FS not active.
1420 */ 1275 */
1421static struct GNUNET_SETUP_VisibilitySpecification hide_fs_tab[] = 1276static struct GNUNET_SETUP_VisibilitySpecification hide_fs_tab[] = {
1422{ 1277 {"GNUNET_setup_fs_main_vbox", "(^| )fs($| )", NULL},
1423 { "GNUNET_setup_fs_main_vbox", "(^| )fs($| )", NULL }, 1278 {NULL, NULL, NULL}
1424 { NULL, NULL, NULL }
1425}; 1279};
1426 1280
1427 1281
@@ -1429,10 +1283,9 @@ static struct GNUNET_SETUP_VisibilitySpecification hide_fs_tab[] =
1429/** 1283/**
1430 * Hide "vpn tab" if VPN not active. 1284 * Hide "vpn tab" if VPN not active.
1431 */ 1285 */
1432static struct GNUNET_SETUP_VisibilitySpecification hide_vpn_tab[] = 1286static struct GNUNET_SETUP_VisibilitySpecification hide_vpn_tab[] = {
1433{ 1287 {"GNUNET_setup_vpn_vbox", "(^| )vpn($| )", NULL},
1434 { "GNUNET_setup_vpn_vbox", "(^| )vpn($| )", NULL }, 1288 {NULL, NULL, NULL}
1435 { NULL, NULL, NULL }
1436}; 1289};
1437 1290
1438 1291
@@ -1440,1136 +1293,1055 @@ static struct GNUNET_SETUP_VisibilitySpecification hide_vpn_tab[] =
1440/** 1293/**
1441 * Hide "tcp tab" if TCP not active. 1294 * Hide "tcp tab" if TCP not active.
1442 */ 1295 */
1443static struct GNUNET_SETUP_VisibilitySpecification hide_tcp_tab[] = 1296static struct GNUNET_SETUP_VisibilitySpecification hide_tcp_tab[] = {
1444{ 1297 {"GNUNET_setup_transport_tcp_vbox", "(^| )tcp($| )", NULL},
1445 { "GNUNET_setup_transport_tcp_vbox", "(^| )tcp($| )", NULL }, 1298 {NULL, NULL, NULL}
1446 { NULL, NULL, NULL }
1447}; 1299};
1448 1300
1449 1301
1450/** 1302/**
1451 * Hide "udp tab" if UDP not active. 1303 * Hide "udp tab" if UDP not active.
1452 */ 1304 */
1453static struct GNUNET_SETUP_VisibilitySpecification hide_udp_tab[] = 1305static struct GNUNET_SETUP_VisibilitySpecification hide_udp_tab[] = {
1454{ 1306 {"GNUNET_setup_transport_udp_vbox", "(^| )udp($| )", NULL},
1455 { "GNUNET_setup_transport_udp_vbox", "(^| )udp($| )", NULL }, 1307 {NULL, NULL, NULL}
1456 { NULL, NULL, NULL }
1457}; 1308};
1458 1309
1459 1310
1460/** 1311/**
1461 * Hide "http tab" if HTTP not active. 1312 * Hide "http tab" if HTTP not active.
1462 */ 1313 */
1463static struct GNUNET_SETUP_VisibilitySpecification hide_http_tab[] = 1314static struct GNUNET_SETUP_VisibilitySpecification hide_http_tab[] = {
1464{ 1315 {"GNUNET_setup_transport_http_vbox", "(^| )http($| )", NULL},
1465 { "GNUNET_setup_transport_http_vbox", "(^| )http($| )", NULL }, 1316 {NULL, NULL, NULL}
1466 { NULL, NULL, NULL }
1467}; 1317};
1468 1318
1469 1319
1470/** 1320/**
1471 * Hide "https tab" if HTTPS not active. 1321 * Hide "https tab" if HTTPS not active.
1472 */ 1322 */
1473static struct GNUNET_SETUP_VisibilitySpecification hide_https_tab[] = 1323static struct GNUNET_SETUP_VisibilitySpecification hide_https_tab[] = {
1474{ 1324 {"GNUNET_setup_transport_https_vbox", "(^| )https($| )", NULL},
1475 { "GNUNET_setup_transport_https_vbox", "(^| )https($| )", NULL }, 1325 {NULL, NULL, NULL}
1476 { NULL, NULL, NULL }
1477}; 1326};
1478 1327
1479 1328
1480/** 1329/**
1481 * Hide "dv tab" if DV not active. 1330 * Hide "dv tab" if DV not active.
1482 */ 1331 */
1483static struct GNUNET_SETUP_VisibilitySpecification hide_dv_tab[] = 1332static struct GNUNET_SETUP_VisibilitySpecification hide_dv_tab[] = {
1484{ 1333 {"GNUNET_setup_transport_dv_vbox", "(^| )dv($| )", NULL},
1485 { "GNUNET_setup_transport_dv_vbox", "(^| )dv($| )", NULL }, 1334 {NULL, NULL, NULL}
1486 { NULL, NULL, NULL }
1487}; 1335};
1488 1336
1489 1337
1490/** 1338/**
1491 * Hide "wlan tab" if WLAN not active. 1339 * Hide "wlan tab" if WLAN not active.
1492 */ 1340 */
1493static struct GNUNET_SETUP_VisibilitySpecification hide_wlan_tab[] = 1341static struct GNUNET_SETUP_VisibilitySpecification hide_wlan_tab[] = {
1494{ 1342 {"GNUNET_setup_transport_wlan_vbox", "(^| )wlan($| )", NULL},
1495 { "GNUNET_setup_transport_wlan_vbox", "(^| )wlan($| )", NULL }, 1343 {NULL, NULL, NULL}
1496 { NULL, NULL, NULL }
1497}; 1344};
1498 1345
1499 1346
1500/** 1347/**
1501 * Hide "sqlite datastore" tab if sqlite not active. 1348 * Hide "sqlite datastore" tab if sqlite not active.
1502 */ 1349 */
1503static struct GNUNET_SETUP_VisibilitySpecification hide_sqlite_datastore_tab[] = 1350static struct GNUNET_SETUP_VisibilitySpecification hide_sqlite_datastore_tab[] = {
1504{ 1351 {"GNUNET_setup_fs_datastore_sqlite_label", "^sqlite$", NULL},
1505 { "GNUNET_setup_fs_datastore_sqlite_label", "^sqlite$", NULL }, 1352 {NULL, NULL, NULL}
1506 { NULL, NULL, NULL }
1507}; 1353};
1508 1354
1509 1355
1510/** 1356/**
1511 * Hide "mysql datastore" tab if mysql not active. 1357 * Hide "mysql datastore" tab if mysql not active.
1512 */ 1358 */
1513static struct GNUNET_SETUP_VisibilitySpecification hide_mysql_datastore_tab[] = 1359static struct GNUNET_SETUP_VisibilitySpecification hide_mysql_datastore_tab[] = {
1514{ 1360 {"GNUNET_setup_datastore_mysql_vbox", "^mysql$", NULL},
1515 { "GNUNET_setup_datastore_mysql_vbox", "^mysql$", NULL }, 1361 {NULL, NULL, NULL}
1516 { NULL, NULL, NULL }
1517}; 1362};
1518 1363
1519 1364
1520/** 1365/**
1521 * Hide "postgres datastore" tab if postgres not active. 1366 * Hide "postgres datastore" tab if postgres not active.
1522 */ 1367 */
1523static struct GNUNET_SETUP_VisibilitySpecification hide_postgres_datastore_tab[] = 1368static struct GNUNET_SETUP_VisibilitySpecification hide_postgres_datastore_tab[]
1524{ 1369 = {
1525 { "GNUNET_setup_datastore_postgres_hbox", "^postgres$", NULL }, 1370 {"GNUNET_setup_datastore_postgres_hbox", "^postgres$", NULL},
1526 { NULL, NULL, NULL } 1371 {NULL, NULL, NULL}
1527}; 1372};
1528 1373
1529 1374
1530/** 1375/**
1531 * Hide "sqlite datacache" tab if sqlite not active. 1376 * Hide "sqlite datacache" tab if sqlite not active.
1532 */ 1377 */
1533static struct GNUNET_SETUP_VisibilitySpecification hide_sqlite_datacache_tab[] = 1378static struct GNUNET_SETUP_VisibilitySpecification hide_sqlite_datacache_tab[] = {
1534{ 1379 {"GNUNET_setup_fs_datacache_sqlite_label", "^sqlite$", NULL},
1535 { "GNUNET_setup_fs_datacache_sqlite_label", "^sqlite$", NULL }, 1380 {NULL, NULL, NULL}
1536 { NULL, NULL, NULL }
1537}; 1381};
1538 1382
1539 1383
1540/** 1384/**
1541 * Hide "mysql datacache" tab if mysql not active. 1385 * Hide "mysql datacache" tab if mysql not active.
1542 */ 1386 */
1543static struct GNUNET_SETUP_VisibilitySpecification hide_mysql_datacache_tab[] = 1387static struct GNUNET_SETUP_VisibilitySpecification hide_mysql_datacache_tab[] = {
1544{ 1388 {"GNUNET_setup_datacache_mysql_vbox", "^mysql$", NULL},
1545 { "GNUNET_setup_datacache_mysql_vbox", "^mysql$", NULL }, 1389 {NULL, NULL, NULL}
1546 { NULL, NULL, NULL }
1547}; 1390};
1548 1391
1549 1392
1550/** 1393/**
1551 * Hide "postgres datacache" tab if postgres not active. 1394 * Hide "postgres datacache" tab if postgres not active.
1552 */ 1395 */
1553static struct GNUNET_SETUP_VisibilitySpecification hide_postgres_datacache_tab[] = 1396static struct GNUNET_SETUP_VisibilitySpecification hide_postgres_datacache_tab[]
1554{ 1397 = {
1555 { "GNUNET_setup_datacache_postgres_hbox", "^postgres$", NULL }, 1398 {"GNUNET_setup_datacache_postgres_hbox", "^postgres$", NULL},
1556 { NULL, NULL, NULL } 1399 {NULL, NULL, NULL}
1557}; 1400};
1558 1401
1559 1402
1560/** 1403/**
1561 * Hide advertised TCP port if port is zero. 1404 * Hide advertised TCP port if port is zero.
1562 */ 1405 */
1563static struct GNUNET_SETUP_VisibilitySpecification hide_all_tcp_options[] = 1406static struct GNUNET_SETUP_VisibilitySpecification hide_all_tcp_options[] = {
1564{ 1407 {"GNUNET_setup_transport_tcp_adv_port_hbox", NULL, "^0$"},
1565 { "GNUNET_setup_transport_tcp_adv_port_hbox", NULL, "^0$" }, 1408 {NULL, NULL, NULL}
1566 { NULL, NULL, NULL }
1567}; 1409};
1568 1410
1569 1411
1570/** 1412/**
1571 * Hide NATed peer options. 1413 * Hide NATed peer options.
1572 */ 1414 */
1573static struct GNUNET_SETUP_VisibilitySpecification toggle_nat_options[] = 1415static struct GNUNET_SETUP_VisibilitySpecification toggle_nat_options[] = {
1574{ 1416 {"GNUNET_setup_transport_hole_punched_checkbutton", "^YES$", NULL},
1575 { "GNUNET_setup_transport_hole_punched_checkbutton", "^YES$", NULL }, 1417 {"GNUNET_setup_transport_upnp_enable_checkbutton", "^YES$", NULL},
1576 { "GNUNET_setup_transport_upnp_enable_checkbutton", "^YES$", NULL }, 1418 {"GNUNET_setup_transport_icmp_server_enable_checkbutton", "^YES$", NULL},
1577 { "GNUNET_setup_transport_icmp_server_enable_checkbutton", "^YES$", NULL }, 1419 {"GNUNET_setup_transport_external_ip_hbox", "^YES$", NULL},
1578 { "GNUNET_setup_transport_external_ip_hbox", "^YES$", NULL }, 1420 {NULL, NULL, NULL}
1579 { NULL, NULL, NULL }
1580}; 1421};
1581 1422
1582/** 1423/**
1583 * Hide hole-punched NATed peer options. 1424 * Hide hole-punched NATed peer options.
1584 */ 1425 */
1585static struct GNUNET_SETUP_VisibilitySpecification toggle_nat_punched_options[] = 1426static struct GNUNET_SETUP_VisibilitySpecification toggle_nat_punched_options[]
1586{ 1427 = {
1587 { "GNUNET_setup_transport_upnp_enable_checkbutton", "^NO$", NULL }, 1428 {"GNUNET_setup_transport_upnp_enable_checkbutton", "^NO$", NULL},
1588 { "GNUNET_setup_transport_icmp_server_enable_checkbutton", "^NO$", NULL }, 1429 {"GNUNET_setup_transport_icmp_server_enable_checkbutton", "^NO$", NULL},
1589 { NULL, NULL, NULL } 1430 {NULL, NULL, NULL}
1590}; 1431};
1591 1432
1592 1433
1593/** 1434/**
1594 * Hide internal IP options. 1435 * Hide internal IP options.
1595 */ 1436 */
1596static struct GNUNET_SETUP_VisibilitySpecification toggle_internal_ip[] = 1437static struct GNUNET_SETUP_VisibilitySpecification toggle_internal_ip[] = {
1597{ 1438 {"GNUNET_setup_transport_internal_ip_hbox", "^YES$", NULL},
1598 { "GNUNET_setup_transport_internal_ip_hbox", "^YES$", NULL }, 1439 {NULL, NULL, NULL}
1599 { NULL, NULL, NULL }
1600}; 1440};
1601 1441
1602 1442
1603/** 1443/**
1604 * Option specification data. 1444 * Option specification data.
1605 */ 1445 */
1606const struct GNUNET_SETUP_OptionSpecification option_specifications[] = 1446const struct GNUNET_SETUP_OptionSpecification option_specifications[] = {
1607 {
1608
1609 /* GENERAL TAB */
1610
1611 {
1612 "GNUNET_setup_friends_only_checkbutton",
1613 "toggled",
1614 "topology",
1615 "FRIENDS-ONLY",
1616 gettext_noop ("Should GNUnet exclusively connect to friends?"),
1617 "https://gnunet.org/configuration-f2f",
1618 &load_yes_no,
1619 &save_yes_no, NULL,
1620 hide_min_connected_friends
1621 },
1622
1623 {
1624 "GNUNET_setup_friends_filechooserbutton",
1625 "selection-changed",
1626 "topology",
1627 "FRIENDS",
1628 gettext_noop ("Friends file containing the list of friendly peers"),
1629 "https://gnunet.org/configuration-f2f",
1630 &load_filename,
1631 &save_filename, NULL,
1632 NULL
1633 },
1634
1635 {
1636 "GNUNET_setup_minimum_friends_spinbutton",
1637 "value-changed",
1638 "topology",
1639 "MINIMUM-FRIENDS",
1640 gettext_noop ("Minimum number of friendly connections"),
1641 "https://gnunet.org/configuration-f2f",
1642 &load_number,
1643 &save_number, NULL,
1644 NULL
1645 },
1646 1447
1647 { 1448 /* GENERAL TAB */
1648 "GNUNET_setup_general_services_topology_checkbutton",
1649 "toggled",
1650 "arm",
1651 "DEFAULTSERVICES",
1652 gettext_noop ("Topology should always be loaded"),
1653 "https://gnunet.org/configuration-topology",
1654 &load_option_list,
1655 &save_option_list, "topology",
1656 NULL
1657 },
1658 1449
1659 { 1450 {
1660 "GNUNET_setup_general_services_hostlist_checkbutton", 1451 "GNUNET_setup_friends_only_checkbutton",
1661 "toggled", 1452 "toggled",
1662 "arm", 1453 "topology",
1663 "DEFAULTSERVICES", 1454 "FRIENDS-ONLY",
1664 gettext_noop ("Should hostlist support be started automatically on startup?"), 1455 gettext_noop ("Should GNUnet exclusively connect to friends?"),
1665 "https://gnunet.org/configuration-hostlist", 1456 "https://gnunet.org/configuration-f2f",
1666 &load_option_list, 1457 &load_yes_no,
1667 &save_option_list, "hostlist", 1458 &save_yes_no, NULL,
1668 hide_hostlist_options 1459 hide_min_connected_friends},
1669 },
1670 1460
1461 {
1462 "GNUNET_setup_friends_filechooserbutton",
1463 "selection-changed",
1464 "topology",
1465 "FRIENDS",
1466 gettext_noop ("Friends file containing the list of friendly peers"),
1467 "https://gnunet.org/configuration-f2f",
1468 &load_filename,
1469 &save_filename, NULL,
1470 NULL},
1671 1471
1672 { 1472 {
1673 "GNUNET_setup_general_services_fs_checkbutton", 1473 "GNUNET_setup_minimum_friends_spinbutton",
1674 "toggled", 1474 "value-changed",
1675 "arm", 1475 "topology",
1676 "DEFAULTSERVICES", 1476 "MINIMUM-FRIENDS",
1677 gettext_noop ("Should file-sharing be started automatically on startup?"), 1477 gettext_noop ("Minimum number of friendly connections"),
1678 "https://gnunet.org/configuration-fs", 1478 "https://gnunet.org/configuration-f2f",
1679 &load_option_list, 1479 &load_number,
1680 &save_option_list, "fs", 1480 &save_number, NULL,
1681 hide_fs_tab 1481 NULL},
1682 },
1683 1482
1684 { 1483 {
1685 "GNUNET_setup_general_services_vpn_checkbutton", 1484 "GNUNET_setup_general_services_topology_checkbutton",
1686 "toggled", 1485 "toggled",
1687 "arm", 1486 "arm",
1688 "DEFAULTSERVICES", 1487 "DEFAULTSERVICES",
1689 gettext_noop ("Should the VPN be started automatically on startup?"), 1488 gettext_noop ("Topology should always be loaded"),
1690 "https://gnunet.org/configuration-vpn", 1489 "https://gnunet.org/configuration-topology",
1691 &load_option_list, 1490 &load_option_list,
1692 &save_option_list, "vpn", 1491 &save_option_list, "topology",
1693 hide_vpn_tab 1492 NULL},
1694 },
1695 1493
1696 { 1494 {
1697 "GNUNET_setup_hostlist_client_enable_checkbutton", 1495 "GNUNET_setup_general_services_hostlist_checkbutton",
1698 "toggled", 1496 "toggled",
1699 "hostlist", 1497 "arm",
1700 "OPTIONS", 1498 "DEFAULTSERVICES",
1701 gettext_noop ("Should GNUnet learn about other peers using hostlists"), 1499 gettext_noop
1702 "https://gnunet.org/configuration-hostlist", 1500 ("Should hostlist support be started automatically on startup?"),
1703 &load_option_list, 1501 "https://gnunet.org/configuration-hostlist",
1704 &save_option_list, "-b", 1502 &load_option_list,
1705 NULL 1503 &save_option_list, "hostlist",
1706 }, 1504 hide_hostlist_options},
1707 1505
1708 {
1709 "GNUNET_setup_hostlist_client_learn_checkbutton",
1710 "toggled",
1711 "hostlist",
1712 "OPTIONS",
1713 gettext_noop ("Should GNUnet learn hostlists from other peers"),
1714 "https://gnunet.org/configuration-hostlist",
1715 &load_option_list,
1716 &save_option_list, "-e",
1717 NULL
1718 },
1719 1506
1720 { 1507 {
1721 "GNUNET_setup_hostlist_offer_hostlist_checkbutton", 1508 "GNUNET_setup_general_services_fs_checkbutton",
1722 "toggled", 1509 "toggled",
1723 "hostlist", 1510 "arm",
1724 "OPTIONS", 1511 "DEFAULTSERVICES",
1725 gettext_noop ("Should this peer offer a hostlist to other peers"), 1512 gettext_noop ("Should file-sharing be started automatically on startup?"),
1726 "https://gnunet.org/configuration-hostlist-server", 1513 "https://gnunet.org/configuration-fs",
1727 &load_option_list, 1514 &load_option_list,
1728 &save_option_list, "-p", 1515 &save_option_list, "fs",
1729 hide_hostlist_server_options 1516 hide_fs_tab},
1730 },
1731 1517
1732 { 1518 {
1733 "GNUNET_setup_hostlist_advertise_checkbutton", 1519 "GNUNET_setup_general_services_vpn_checkbutton",
1734 "toggled", 1520 "toggled",
1735 "hostlist", 1521 "arm",
1736 "OPTIONS", 1522 "DEFAULTSERVICES",
1737 gettext_noop ("Should this peer advertise its hostlist to other peers"), 1523 gettext_noop ("Should the VPN be started automatically on startup?"),
1738 "https://gnunet.org/configuration-hostlist-server", 1524 "https://gnunet.org/configuration-vpn",
1739 &load_option_list, 1525 &load_option_list,
1740 &save_option_list, "-a", 1526 &save_option_list, "vpn",
1741 NULL 1527 hide_vpn_tab},
1742 },
1743 1528
1744 { 1529 {
1745 "GNUNET_setup_hostlist_server_port_spin_button", 1530 "GNUNET_setup_hostlist_client_enable_checkbutton",
1746 "value-changed", 1531 "toggled",
1747 "hostlist", 1532 "hostlist",
1748 "HTTPPORT", 1533 "OPTIONS",
1749 gettext_noop ("Port this peers hostlist should be offered on"), 1534 gettext_noop ("Should GNUnet learn about other peers using hostlists"),
1750 "https://gnunet.org/configuration-hostlist-server", 1535 "https://gnunet.org/configuration-hostlist",
1751 &load_number, 1536 &load_option_list,
1752 &save_number, NULL, 1537 &save_option_list, "-b",
1753 NULL 1538 NULL},
1754 },
1755 1539
1756 { 1540 {
1757 "GNUNET_setup_hostlist_url_liststore", 1541 "GNUNET_setup_hostlist_client_learn_checkbutton",
1758 "row-changed", 1542 "toggled",
1759 "hostlist", 1543 "hostlist",
1760 "SERVERS", 1544 "OPTIONS",
1761 NULL, NULL, 1545 gettext_noop ("Should GNUnet learn hostlists from other peers"),
1762 &load_string_list_store, 1546 "https://gnunet.org/configuration-hostlist",
1763 &save_string_list_store, NULL, 1547 &load_option_list,
1764 NULL 1548 &save_option_list, "-e",
1765 }, 1549 NULL},
1766 1550
1767 { 1551 {
1768 "GNUNET_setup_hostlist_url_treeview", 1552 "GNUNET_setup_hostlist_offer_hostlist_checkbutton",
1769 NULL, NULL, NULL, /* FIXME */ 1553 "toggled",
1770 gettext_noop ("Known hostlist URLs"), 1554 "hostlist",
1771 "https://gnunet.org/configuration-hostlist", 1555 "OPTIONS",
1772 NULL, NULL, NULL, /* FIXME */ 1556 gettext_noop ("Should this peer offer a hostlist to other peers"),
1773 NULL 1557 "https://gnunet.org/configuration-hostlist-server",
1774 }, 1558 &load_option_list,
1559 &save_option_list, "-p",
1560 hide_hostlist_server_options},
1775 1561
1776 { 1562 {
1777 "GNUNET_setup_bandwidth_out_spinbutton", 1563 "GNUNET_setup_hostlist_advertise_checkbutton",
1778 "value-changed", 1564 "toggled",
1779 "core", 1565 "hostlist",
1780 "TOTAL_QUOTA_OUT", 1566 "OPTIONS",
1781 gettext_noop ("How many bytes per second are we allowed to transmit?"), 1567 gettext_noop ("Should this peer advertise its hostlist to other peers"),
1782 "https://gnunet.org/configuration-bandwidth", 1568 "https://gnunet.org/configuration-hostlist-server",
1783 &load_number, 1569 &load_option_list,
1784 &save_number, NULL, 1570 &save_option_list, "-a",
1785 NULL 1571 NULL},
1786 },
1787 1572
1788 { 1573 {
1789 "GNUNET_setup_bandwidth_in_spinbutton", 1574 "GNUNET_setup_hostlist_server_port_spin_button",
1790 "value-changed", 1575 "value-changed",
1791 "core", 1576 "hostlist",
1792 "TOTAL_QUOTA_IN", 1577 "HTTPPORT",
1793 gettext_noop ("How many bytes per second are we allowed to receive?"), 1578 gettext_noop ("Port this peers hostlist should be offered on"),
1794 "https://gnunet.org/configuration-bandwidth", 1579 "https://gnunet.org/configuration-hostlist-server",
1795 &load_number, 1580 &load_number,
1796 &save_number, NULL, 1581 &save_number, NULL,
1797 NULL 1582 NULL},
1798 },
1799
1800 /* Transport TAB */
1801 1583
1802 { 1584 {
1803 "GNUNET_setup_transport_tcp_checkbutton", 1585 "GNUNET_setup_hostlist_url_liststore",
1804 "toggled", 1586 "row-changed",
1805 "transport", 1587 "hostlist",
1806 "PLUGINS", 1588 "SERVERS",
1807 gettext_noop ("Enable communication via TCP"), 1589 NULL, NULL,
1808 "https://gnunet.org/configuration-tcp", 1590 &load_string_list_store,
1809 &load_option_list, 1591 &save_string_list_store, NULL,
1810 &save_option_list, "tcp", 1592 NULL},
1811 hide_tcp_tab
1812 },
1813 1593
1814 { 1594 {
1815 "GNUNET_setup_transport_udp_checkbutton", 1595 "GNUNET_setup_hostlist_url_treeview",
1816 "toggled", 1596 NULL, NULL, NULL, /* FIXME */
1817 "transport", 1597 gettext_noop ("Known hostlist URLs"),
1818 "PLUGINS", 1598 "https://gnunet.org/configuration-hostlist",
1819 gettext_noop ("Enable communication via UDP"), 1599 NULL, NULL, NULL, /* FIXME */
1820 "https://gnunet.org/configuration-udp", 1600 NULL},
1821 &load_option_list,
1822 &save_option_list, "udp",
1823 hide_udp_tab
1824 },
1825 1601
1826 { 1602 {
1827 "GNUNET_setup_transport_http_checkbutton", 1603 "GNUNET_setup_bandwidth_out_spinbutton",
1828 "toggled", 1604 "value-changed",
1829 "transport", 1605 "core",
1830 "PLUGINS", 1606 "TOTAL_QUOTA_OUT",
1831 gettext_noop ("Enable communication via HTTP"), 1607 gettext_noop ("How many bytes per second are we allowed to transmit?"),
1832 "https://gnunet.org/configuration-http", 1608 "https://gnunet.org/configuration-bandwidth",
1833 &load_option_list, 1609 &load_number,
1834 &save_option_list, "http", 1610 &save_number, NULL,
1835 hide_http_tab 1611 NULL},
1836 },
1837 1612
1838 { 1613 {
1839 "GNUNET_setup_transport_https_checkbutton", 1614 "GNUNET_setup_bandwidth_in_spinbutton",
1840 "toggled", 1615 "value-changed",
1841 "transport", 1616 "core",
1842 "PLUGINS", 1617 "TOTAL_QUOTA_IN",
1843 gettext_noop ("Enable communication via HTTPS"), 1618 gettext_noop ("How many bytes per second are we allowed to receive?"),
1844 "https://gnunet.org/configuration-https", 1619 "https://gnunet.org/configuration-bandwidth",
1845 &load_option_list, 1620 &load_number,
1846 &save_option_list, "https", 1621 &save_number, NULL,
1847 hide_https_tab 1622 NULL},
1848 }, 1623
1624 /* Transport TAB */
1849 1625
1850 { 1626 {
1851 "GNUNET_setup_transport_dv_checkbutton", 1627 "GNUNET_setup_transport_tcp_checkbutton",
1852 "toggled", 1628 "toggled",
1853 "transport", 1629 "transport",
1854 "PLUGINS", 1630 "PLUGINS",
1855 gettext_noop ("Enable communication via DV"), 1631 gettext_noop ("Enable communication via TCP"),
1856 "https://gnunet.org/configuration-dv", 1632 "https://gnunet.org/configuration-tcp",
1857 &load_option_list, 1633 &load_option_list,
1858 &save_option_list, "dv", 1634 &save_option_list, "tcp",
1859 hide_dv_tab 1635 hide_tcp_tab},
1860 },
1861 1636
1862 { 1637 {
1863 "GNUNET_setup_transport_wlan_checkbutton", 1638 "GNUNET_setup_transport_udp_checkbutton",
1864 "toggled", 1639 "toggled",
1865 "transport", 1640 "transport",
1866 "PLUGINS", 1641 "PLUGINS",
1867 gettext_noop ("Enable communication via WLAN"), 1642 gettext_noop ("Enable communication via UDP"),
1868 "https://gnunet.org/configuration-wlan", 1643 "https://gnunet.org/configuration-udp",
1869 &load_option_list, 1644 &load_option_list,
1870 &save_option_list, "wlan", 1645 &save_option_list, "udp",
1871 hide_wlan_tab 1646 hide_udp_tab},
1872 },
1873 1647
1874 { 1648 {
1875 "GNUNET_setup_transport_tcp_port_spinbutton", 1649 "GNUNET_setup_transport_http_checkbutton",
1876 "value-changed", 1650 "toggled",
1877 "transport-tcp", 1651 "transport",
1878 "PORT", 1652 "PLUGINS",
1879 gettext_noop ("Port we bind to for TCP"), 1653 gettext_noop ("Enable communication via HTTP"),
1880 "https://gnunet.org/configuration-tcp", 1654 "https://gnunet.org/configuration-http",
1881 &load_number, 1655 &load_option_list,
1882 &save_number, NULL, 1656 &save_option_list, "http",
1883 hide_all_tcp_options 1657 hide_http_tab},
1884 },
1885 1658
1886 { 1659 {
1887 "GNUNET_setup_transport_tcp_adv_port_spinbutton", 1660 "GNUNET_setup_transport_https_checkbutton",
1888 "value-changed", 1661 "toggled",
1889 "transport-tcp", 1662 "transport",
1890 "ADVERTISED_PORT", 1663 "PLUGINS",
1891 gettext_noop ("Port visible to other peers"), 1664 gettext_noop ("Enable communication via HTTPS"),
1892 "https://gnunet.org/configuration-tcp", 1665 "https://gnunet.org/configuration-https",
1893 &load_number, 1666 &load_option_list,
1894 &save_number, NULL, 1667 &save_option_list, "https",
1895 NULL 1668 hide_https_tab},
1896 },
1897 1669
1898 { 1670 {
1899 "GNUNET_setup_transport_nat_checkbutton", 1671 "GNUNET_setup_transport_dv_checkbutton",
1900 "toggled", 1672 "toggled",
1901 "nat", 1673 "transport",
1902 "BEHIND_NAT", 1674 "PLUGINS",
1903 gettext_noop ("Check if this peer is behind a NAT"), 1675 gettext_noop ("Enable communication via DV"),
1904 "https://gnunet.org/configuration-nat", 1676 "https://gnunet.org/configuration-dv",
1905 &load_yes_no, 1677 &load_option_list,
1906 &save_yes_no, NULL, 1678 &save_option_list, "dv",
1907 toggle_nat_options 1679 hide_dv_tab},
1908 },
1909 1680
1910 { 1681 {
1911 "GNUNET_setup_transport_hole_punched_checkbutton", 1682 "GNUNET_setup_transport_wlan_checkbutton",
1912 "toggled", 1683 "toggled",
1913 "nat", 1684 "transport",
1914 "PUNCHED_NAT", 1685 "PLUGINS",
1915 gettext_noop ("Check if the NAT has been hole-punched manually"), 1686 gettext_noop ("Enable communication via WLAN"),
1916 "https://gnunet.org/configuration-nat", 1687 "https://gnunet.org/configuration-wlan",
1917 &load_yes_no, 1688 &load_option_list,
1918 &save_yes_no, NULL, 1689 &save_option_list, "wlan",
1919 toggle_nat_punched_options 1690 hide_wlan_tab},
1920 },
1921 1691
1922 { 1692 {
1923 "GNUNET_setup_transport_upnp_enable_checkbutton", 1693 "GNUNET_setup_transport_tcp_port_spinbutton",
1924 "toggled", 1694 "value-changed",
1925 "nat", 1695 "transport-tcp",
1926 "ENABLE_UPNP", 1696 "PORT",
1927 gettext_noop ("Enable NAT traversal with UPnP/PMP"), 1697 gettext_noop ("Port we bind to for TCP"),
1928 "https://gnunet.org/configuration-nat", 1698 "https://gnunet.org/configuration-tcp",
1929 &load_yes_no, 1699 &load_number,
1930 &save_yes_no, NULL, 1700 &save_number, NULL,
1931 NULL, 1701 hide_all_tcp_options},
1932 },
1933 1702
1934 { 1703 {
1935 "GNUNET_setup_transport_icmp_server_enable_checkbutton", 1704 "GNUNET_setup_transport_tcp_adv_port_spinbutton",
1936 "toggled", 1705 "value-changed",
1937 "nat", 1706 "transport-tcp",
1938 "ENABLE_ICMP_SERVER", 1707 "ADVERTISED_PORT",
1939 gettext_noop ("Enable NAT traversal with ICMP as server"), 1708 gettext_noop ("Port visible to other peers"),
1940 "https://gnunet.org/configuration-nat", 1709 "https://gnunet.org/configuration-tcp",
1941 &load_yes_no, 1710 &load_number,
1942 &save_yes_no, NULL, 1711 &save_number, NULL,
1943 NULL, 1712 NULL},
1944 },
1945 1713
1946 { 1714 {
1947 "GNUNET_setup_transport_external_ip_address_entry", 1715 "GNUNET_setup_transport_nat_checkbutton",
1948 "changed", 1716 "toggled",
1949 "nat", 1717 "nat",
1950 "EXTERNAL_ADDRESS", 1718 "BEHIND_NAT",
1951 gettext_noop ("External (public) IP address of the NAT"), 1719 gettext_noop ("Check if this peer is behind a NAT"),
1952 "https://gnunet.org/configuration-nat", 1720 "https://gnunet.org/configuration-nat",
1953 &load_text, 1721 &load_yes_no,
1954 &save_text, NULL, 1722 &save_yes_no, NULL,
1955 NULL 1723 toggle_nat_options},
1956 },
1957 1724
1958 { 1725 {
1959 "GNUNET_setup_transport_icmp_client_enable_checkbutton", 1726 "GNUNET_setup_transport_hole_punched_checkbutton",
1960 "toggled", 1727 "toggled",
1961 "nat", 1728 "nat",
1962 "ENABLE_ICMP_CLIENT", 1729 "PUNCHED_NAT",
1963 gettext_noop ("Enable NAT traversal with ICMP as client"), 1730 gettext_noop ("Check if the NAT has been hole-punched manually"),
1964 "https://gnunet.org/configuration-nat", 1731 "https://gnunet.org/configuration-nat",
1965 &load_yes_no, 1732 &load_yes_no,
1966 &save_yes_no, NULL, 1733 &save_yes_no, NULL,
1967 toggle_internal_ip 1734 toggle_nat_punched_options},
1968 },
1969 1735
1970 { 1736 {
1971 "GNUNET_setup_transport_internal_ip_entry", 1737 "GNUNET_setup_transport_upnp_enable_checkbutton",
1972 "changed", 1738 "toggled",
1973 "nat", 1739 "nat",
1974 "INTERNAL_ADDRESS", 1740 "ENABLE_UPNP",
1975 gettext_noop ("Internal (private) IP address of the NAT"), 1741 gettext_noop ("Enable NAT traversal with UPnP/PMP"),
1976 "https://gnunet.org/configuration-nat", 1742 "https://gnunet.org/configuration-nat",
1977 &load_text, 1743 &load_yes_no,
1978 &save_text, NULL, 1744 &save_yes_no, NULL,
1979 NULL 1745 NULL,
1980 }, 1746 },
1981 1747
1982 { 1748 {
1983 "GNUNET_setup_transport_disable_ipv6_checkbutton", 1749 "GNUNET_setup_transport_icmp_server_enable_checkbutton",
1984 "toggled", 1750 "toggled",
1985 "nat", 1751 "nat",
1986 "DISABLEV6", 1752 "ENABLE_ICMP_SERVER",
1987 gettext_noop ("Disable IPv6 support"), 1753 gettext_noop ("Enable NAT traversal with ICMP as server"),
1988 "https://gnunet.org/configuration-ipv6", 1754 "https://gnunet.org/configuration-nat",
1989 &load_yes_no, 1755 &load_yes_no,
1990 &save_yes_no, NULL, 1756 &save_yes_no, NULL,
1991 NULL, 1757 NULL,
1992 }, 1758 },
1993 1759
1994 { 1760 {
1995 "GNUNET_setup_transport_udp_port_spinbutton", 1761 "GNUNET_setup_transport_external_ip_address_entry",
1996 "value-changed", 1762 "changed",
1997 "transport-udp", 1763 "nat",
1998 "PORT", 1764 "EXTERNAL_ADDRESS",
1999 gettext_noop ("Port for inbound UDP packets, use 0 if behind NAT"), 1765 gettext_noop ("External (public) IP address of the NAT"),
2000 "https://gnunet.org/configuration-udp", 1766 "https://gnunet.org/configuration-nat",
2001 &load_number, 1767 &load_text,
2002 &save_number, NULL, 1768 &save_text, NULL,
2003 NULL 1769 NULL},
2004 },
2005 1770
2006 { 1771 {
2007 "GNUNET_setup_transport_http_port_spinbutton", 1772 "GNUNET_setup_transport_icmp_client_enable_checkbutton",
2008 "value-changed", 1773 "toggled",
2009 "transport-http", 1774 "nat",
2010 "PORT", 1775 "ENABLE_ICMP_CLIENT",
2011 gettext_noop ("Port for inbound HTTP connections, use 0 if behind NAT"), 1776 gettext_noop ("Enable NAT traversal with ICMP as client"),
2012 "https://gnunet.org/configuration-http", 1777 "https://gnunet.org/configuration-nat",
2013 &load_number, 1778 &load_yes_no,
2014 &save_number, NULL, 1779 &save_yes_no, NULL,
2015 NULL 1780 toggle_internal_ip},
2016 },
2017 1781
2018 { 1782 {
2019 "GNUNET_setup_transport_https_port_spinbutton", 1783 "GNUNET_setup_transport_internal_ip_entry",
2020 "value-changed", 1784 "changed",
2021 "transport-https", 1785 "nat",
2022 "PORT", 1786 "INTERNAL_ADDRESS",
2023 gettext_noop ("Port for inbound HTTPS connections, use 0 if behind NAT"), 1787 gettext_noop ("Internal (private) IP address of the NAT"),
2024 "https://gnunet.org/configuration-https", 1788 "https://gnunet.org/configuration-nat",
2025 &load_number, 1789 &load_text,
2026 &save_number, NULL, 1790 &save_text, NULL,
2027 NULL 1791 NULL},
2028 },
2029
2030 /* FS TAB */
2031
2032 {
2033 "GNUNET_setup_fs_datastore_sqlite_radiobutton",
2034 "toggled",
2035 "datastore",
2036 "DATABASE",
2037 gettext_noop ("Use sqLite to store file-sharing content"),
2038 "https://gnunet.org/configuration-datastore",
2039 &load_option_list /* abuse! */,
2040 &save_option_list /* abuse! */, "sqlite",
2041 hide_sqlite_datastore_tab
2042 },
2043 1792
2044 { 1793 {
2045 "GNUNET_setup_fs_datastore_mysql_radiobutton", 1794 "GNUNET_setup_transport_disable_ipv6_checkbutton",
2046 "toggled", 1795 "toggled",
2047 "datastore", 1796 "nat",
2048 "DATABASE", 1797 "DISABLEV6",
2049 gettext_noop ("Use MySQL to store file-sharing content"), 1798 gettext_noop ("Disable IPv6 support"),
2050 "https://gnunet.org/configuration-datastore", 1799 "https://gnunet.org/configuration-ipv6",
2051 &load_option_list /* abuse! */, 1800 &load_yes_no,
2052 &save_option_list /* abuse! */, "mysql", 1801 &save_yes_no, NULL,
2053 hide_mysql_datastore_tab 1802 NULL,
2054 }, 1803 },
2055 1804
2056 { 1805 {
2057 "GNUNET_setup_fs_datastore_postgres_radiobutton", 1806 "GNUNET_setup_transport_udp_port_spinbutton",
2058 "toggled", 1807 "value-changed",
2059 "datastore", 1808 "transport-udp",
2060 "DATABASE", 1809 "PORT",
2061 gettext_noop ("Use Postgres to store file-sharing content"), 1810 gettext_noop ("Port for inbound UDP packets, use 0 if behind NAT"),
2062 "https://gnunet.org/configuration-datastore", 1811 "https://gnunet.org/configuration-udp",
2063 &load_option_list /* abuse! */, 1812 &load_number,
2064 &save_option_list /* abuse! */, "postgres", 1813 &save_number, NULL,
2065 hide_postgres_datastore_tab 1814 NULL},
2066 },
2067 1815
2068 { 1816 {
2069 "GNUNET_setup_datastore_mysql_database_name_entry", 1817 "GNUNET_setup_transport_http_port_spinbutton",
2070 "changed", 1818 "value-changed",
2071 "datastore-mysql", 1819 "transport-http",
2072 "DATABASE", 1820 "PORT",
2073 gettext_noop ("Name for the MySQL database"), 1821 gettext_noop ("Port for inbound HTTP connections, use 0 if behind NAT"),
2074 "https://gnunet.org/configuration-datastore", 1822 "https://gnunet.org/configuration-http",
2075 &load_text, 1823 &load_number,
2076 &save_text, NULL, 1824 &save_number, NULL,
2077 NULL 1825 NULL},
2078 },
2079
2080 {
2081 "GNUNET_setup_datastore_mysql_config_file_filechooserbutton",
2082 "selection-changed",
2083 "datastore-mysql",
2084 "CONFIG",
2085 gettext_noop ("Configuration file for MySQL access"),
2086 "http://dev.mysql.com/doc/refman/5.5/en/option-files.html",
2087 &load_filename,
2088 &save_filename, NULL,
2089 NULL
2090 },
2091 1826
2092 { 1827 {
2093 "GNUNET_setup_datastore_mysql_username_entry", 1828 "GNUNET_setup_transport_https_port_spinbutton",
2094 "changed", 1829 "value-changed",
2095 "datastore-mysql", 1830 "transport-https",
2096 "USER", 1831 "PORT",
2097 gettext_noop ("Username for MySQL access"), 1832 gettext_noop ("Port for inbound HTTPS connections, use 0 if behind NAT"),
2098 "https://gnunet.org/configuration-datastore", 1833 "https://gnunet.org/configuration-https",
2099 &load_text, 1834 &load_number,
2100 &save_text, NULL, 1835 &save_number, NULL,
2101 NULL 1836 NULL},
2102 }, 1837
1838 /* FS TAB */
2103 1839
2104 { 1840 {
2105 "GNUNET_setup_datastore_mysql_password_entry", 1841 "GNUNET_setup_fs_datastore_sqlite_radiobutton",
2106 "changed", 1842 "toggled",
2107 "datastore-mysql", 1843 "datastore",
2108 "PASSWORD", 1844 "DATABASE",
2109 gettext_noop ("Password for MySQL access"), 1845 gettext_noop ("Use sqLite to store file-sharing content"),
2110 "https://gnunet.org/configuration-datastore", 1846 "https://gnunet.org/configuration-datastore",
2111 &load_text, 1847 &load_option_list /* abuse! */ ,
2112 &save_text, NULL, 1848 &save_option_list /* abuse! */ , "sqlite",
2113 NULL 1849 hide_sqlite_datastore_tab},
2114 },
2115 1850
2116 { 1851 {
2117 "GNUNET_setup_datastore_mysql_hostname_entry", 1852 "GNUNET_setup_fs_datastore_mysql_radiobutton",
2118 "changed", 1853 "toggled",
2119 "datastore-mysql", 1854 "datastore",
2120 "HOST", 1855 "DATABASE",
2121 gettext_noop ("Name of host running MySQL database"), 1856 gettext_noop ("Use MySQL to store file-sharing content"),
2122 "https://gnunet.org/configuration-datastore", 1857 "https://gnunet.org/configuration-datastore",
2123 &load_text, 1858 &load_option_list /* abuse! */ ,
2124 &save_text, NULL, 1859 &save_option_list /* abuse! */ , "mysql",
2125 NULL 1860 hide_mysql_datastore_tab},
2126 },
2127 1861
2128 { 1862 {
2129 "GNUNET_setup_datastore_mysql_port_spinbutton", 1863 "GNUNET_setup_fs_datastore_postgres_radiobutton",
2130 "value-changed", 1864 "toggled",
2131 "datastore-mysql", 1865 "datastore",
2132 "PORT", 1866 "DATABASE",
2133 gettext_noop ("Port of MySQL database"), 1867 gettext_noop ("Use Postgres to store file-sharing content"),
2134 "https://gnunet.org/configuration-datastore", 1868 "https://gnunet.org/configuration-datastore",
2135 &load_number, 1869 &load_option_list /* abuse! */ ,
2136 &save_number, NULL, 1870 &save_option_list /* abuse! */ , "postgres",
2137 NULL 1871 hide_postgres_datastore_tab},
2138 },
2139 1872
2140 { 1873 {
2141 "GNUNET_setup_datastore_postgres_config_entry", 1874 "GNUNET_setup_datastore_mysql_database_name_entry",
2142 "changed", 1875 "changed",
2143 "datastore-postgres", 1876 "datastore-mysql",
2144 "CONFIG", 1877 "DATABASE",
2145 gettext_noop ("Configuration for Postgres (passed to PQconnectdb)"), 1878 gettext_noop ("Name for the MySQL database"),
2146 "http://www.postgresql.org/docs/8.1/static/libpq.html#LIBPQ-CONNECT", 1879 "https://gnunet.org/configuration-datastore",
2147 &load_text, 1880 &load_text,
2148 &save_text, NULL, 1881 &save_text, NULL,
2149 NULL 1882 NULL},
2150 },
2151
2152
2153 {
2154 "GNUNET_setup_fs_migration_from_checkbutton",
2155 "toggled",
2156 "fs",
2157 "CONTENT_PUSHING",
2158 gettext_noop ("Should we try to push our content to other peers?"),
2159 "https://gnunet.org/configuration-fs",
2160 &load_yes_no,
2161 &save_yes_no, NULL,
2162 NULL
2163 },
2164
2165 {
2166 "GNUNET_setup_fs_migration_to_checkbutton",
2167 "toggled",
2168 "fs",
2169 "CONTENT_CACHING",
2170 gettext_noop ("Are we allowed to cache content received from other peers?"),
2171 "https://gnunet.org/configuration-fs",
2172 &load_yes_no,
2173 &save_yes_no, NULL,
2174 NULL
2175 },
2176
2177 {
2178 "GNUNET_setup_fs_datacache_sqlite_radiobutton",
2179 "toggled",
2180 "dhtcache",
2181 "DATABASE",
2182 gettext_noop ("Use sqLite to cache DHT data"),
2183 "https://gnunet.org/configuration-datacache",
2184 &load_option_list /* abuse! */,
2185 &save_option_list /* abuse! */, "sqlite",
2186 hide_sqlite_datacache_tab
2187 },
2188 1883
2189 { 1884 {
2190 "GNUNET_setup_fs_datacache_mysql_radiobutton", 1885 "GNUNET_setup_datastore_mysql_config_file_filechooserbutton",
2191 "toggled", 1886 "selection-changed",
2192 "dhtcache", 1887 "datastore-mysql",
2193 "DATABASE", 1888 "CONFIG",
2194 gettext_noop ("Use MySQL to cache DHT data"), 1889 gettext_noop ("Configuration file for MySQL access"),
2195 "https://gnunet.org/configuration-datacache", 1890 "http://dev.mysql.com/doc/refman/5.5/en/option-files.html",
2196 &load_option_list /* abuse! */, 1891 &load_filename,
2197 &save_option_list /* abuse! */, "mysql", 1892 &save_filename, NULL,
2198 hide_mysql_datacache_tab 1893 NULL},
2199 },
2200 1894
2201 { 1895 {
2202 "GNUNET_setup_fs_datacache_postgres_radiobutton", 1896 "GNUNET_setup_datastore_mysql_username_entry",
2203 "toggled", 1897 "changed",
2204 "dhtcache", 1898 "datastore-mysql",
2205 "DATABASE", 1899 "USER",
2206 gettext_noop ("Use Postgres to cache DHT data"), 1900 gettext_noop ("Username for MySQL access"),
2207 "https://gnunet.org/configuration-datacache", 1901 "https://gnunet.org/configuration-datastore",
2208 &load_option_list /* abuse! */, 1902 &load_text,
2209 &save_option_list /* abuse! */, "postgres", 1903 &save_text, NULL,
2210 hide_postgres_datacache_tab 1904 NULL},
2211 },
2212
2213 {
2214 "GNUNET_setup_datacache_mysql_database_name_entry",
2215 "changed",
2216 "datacache-mysql",
2217 "DATABASE",
2218 gettext_noop ("Name for the MySQL database"),
2219 "https://gnunet.org/configuration-datacache",
2220 &load_text,
2221 &save_text, NULL,
2222 NULL
2223 },
2224
2225 {
2226 "GNUNET_setup_datacache_mysql_config_file_filechooserbutton",
2227 "selection-changed",
2228 "datacache-mysql",
2229 "CONFIG",
2230 gettext_noop ("Configuration file for MySQL access"),
2231 "http://dev.mysql.com/doc/refman/5.5/en/option-files.html",
2232 &load_filename,
2233 &save_filename, NULL,
2234 NULL
2235 },
2236 1905
2237 { 1906 {
2238 "GNUNET_setup_datacache_mysql_username_entry", 1907 "GNUNET_setup_datastore_mysql_password_entry",
2239 "changed", 1908 "changed",
2240 "datacache-mysql", 1909 "datastore-mysql",
2241 "USER", 1910 "PASSWORD",
2242 gettext_noop ("Username for MySQL access"), 1911 gettext_noop ("Password for MySQL access"),
2243 "https://gnunet.org/configuration-datacache", 1912 "https://gnunet.org/configuration-datastore",
2244 &load_text, 1913 &load_text,
2245 &save_text, NULL, 1914 &save_text, NULL,
2246 NULL 1915 NULL},
2247 },
2248 1916
2249 { 1917 {
2250 "GNUNET_setup_datacache_mysql_password_entry", 1918 "GNUNET_setup_datastore_mysql_hostname_entry",
2251 "changed", 1919 "changed",
2252 "datacache-mysql", 1920 "datastore-mysql",
2253 "PASSWORD", 1921 "HOST",
2254 gettext_noop ("Password for MySQL access"), 1922 gettext_noop ("Name of host running MySQL database"),
2255 "https://gnunet.org/configuration-datacache", 1923 "https://gnunet.org/configuration-datastore",
2256 &load_text, 1924 &load_text,
2257 &save_text, NULL, 1925 &save_text, NULL,
2258 NULL 1926 NULL},
2259 },
2260 1927
2261 { 1928 {
2262 "GNUNET_setup_datacache_mysql_hostname_entry", 1929 "GNUNET_setup_datastore_mysql_port_spinbutton",
2263 "changed", 1930 "value-changed",
2264 "datacache-mysql", 1931 "datastore-mysql",
2265 "HOST", 1932 "PORT",
2266 gettext_noop ("Name of host running MySQL database"), 1933 gettext_noop ("Port of MySQL database"),
2267 "https://gnunet.org/configuration-datacache", 1934 "https://gnunet.org/configuration-datastore",
2268 &load_text, 1935 &load_number,
2269 &save_text, NULL, 1936 &save_number, NULL,
2270 NULL 1937 NULL},
2271 },
2272 1938
2273 { 1939 {
2274 "GNUNET_setup_transport_wlan_interface_entry", 1940 "GNUNET_setup_datastore_postgres_config_entry",
2275 "changed", 1941 "changed",
2276 "transport-wlan", 1942 "datastore-postgres",
2277 "INTERFACE", 1943 "CONFIG",
2278 gettext_noop ("Name of monitoring interface to use (monX)"), 1944 gettext_noop ("Configuration for Postgres (passed to PQconnectdb)"),
2279 "https://gnunet.org/configuration-wlan", 1945 "http://www.postgresql.org/docs/8.1/static/libpq.html#LIBPQ-CONNECT",
2280 &load_text, 1946 &load_text,
2281 &save_text, NULL, 1947 &save_text, NULL,
2282 NULL 1948 NULL},
2283 },
2284 1949
2285 {
2286 "GNUNET_setup_datacache_mysql_port_spinbutton",
2287 "value-changed",
2288 "datacache-mysql",
2289 "PORT",
2290 gettext_noop ("Port of MySQL database"),
2291 "https://gnunet.org/configuration-datacache",
2292 &load_number,
2293 &save_number, NULL,
2294 NULL
2295 },
2296 1950
2297 { 1951 {
2298 "GNUNET_setup_datacache_postgres_config_entry", 1952 "GNUNET_setup_fs_migration_from_checkbutton",
2299 "changed", 1953 "toggled",
2300 "datacache-postgres", 1954 "fs",
2301 "CONFIG", 1955 "CONTENT_PUSHING",
2302 gettext_noop ("Configuration for Postgres (passed to PQconnectdb)"), 1956 gettext_noop ("Should we try to push our content to other peers?"),
2303 "http://www.postgresql.org/docs/8.1/static/libpq.html#LIBPQ-CONNECT", 1957 "https://gnunet.org/configuration-fs",
2304 &load_text, 1958 &load_yes_no,
2305 &save_text, NULL, 1959 &save_yes_no, NULL,
2306 NULL 1960 NULL},
2307 },
2308
2309 {
2310 "GNUNET_setup_vpn_master_interface_entry",
2311 "changed",
2312 "vpn",
2313 "IFNAME",
2314 gettext_noop ("Name of the virtual interface the GNUnet VPN should create"),
2315 "https://gnunet.org/configuration-vpn",
2316 &load_text,
2317 &save_text, NULL,
2318 NULL
2319 },
2320
2321 {
2322 "GNUNET_setup_vpn_master_interface_v4_ip_entry",
2323 "changed",
2324 "vpn",
2325 "IPV4ADDR",
2326 gettext_noop ("IPv4 address to use for the VPN interface"),
2327 "https://gnunet.org/configuration-vpn",
2328 &load_text,
2329 &save_text, NULL,
2330 NULL
2331 },
2332
2333 {
2334 "GNUNET_setup_vpn_master_interface_v4_mask_entry",
2335 "changed",
2336 "vpn",
2337 "IPV4MASK",
2338 gettext_noop ("IPv4 network mask to use for the VPN interface"),
2339 "https://gnunet.org/configuration-vpn",
2340 &load_text,
2341 &save_text, NULL,
2342 NULL
2343 },
2344
2345 {
2346 "GNUNET_setup_vpn_master_interface_v6_ip_entry",
2347 "changed",
2348 "vpn",
2349 "IPV6ADDR",
2350 gettext_noop ("IPv6 address to use for the VPN interface"),
2351 "https://gnunet.org/configuration-vpn",
2352 &load_text,
2353 &save_text, NULL,
2354 NULL
2355 },
2356
2357 {
2358 "GNUNET_setup_vpn_master_interface_v6_mask_spinbutton",
2359 "value-changed",
2360 "vpn",
2361 "IPV6MASK",
2362 gettext_noop ("IPv6 network prefix length to use for the VPN interface"),
2363 "https://gnunet.org/configuration-vpn",
2364 &load_number,
2365 &save_number, NULL,
2366 NULL
2367 },
2368 1961
2369 { 1962 {
2370 "GNUNET_setup_vpn_master_vdns_server_entry", 1963 "GNUNET_setup_fs_migration_to_checkbutton",
2371 "changed", 1964 "toggled",
2372 "vpn", 1965 "fs",
2373 "VIRTDNS", 1966 "CONTENT_CACHING",
2374 gettext_noop ("IP address of the virtual DNS server that resolves through GNUnet (use in resolve.conf if you want to resolve through some GNUnet DNS Exit)"), 1967 gettext_noop ("Are we allowed to cache content received from other peers?"),
2375 "https://gnunet.org/configuration-vpn", 1968 "https://gnunet.org/configuration-fs",
2376 &load_text, 1969 &load_yes_no,
2377 &save_text, NULL, 1970 &save_yes_no, NULL,
2378 NULL 1971 NULL},
2379 },
2380 1972
2381 { 1973 {
2382 "GNUNET_setup_vpn_enable_vpn_exit_checkbutton", 1974 "GNUNET_setup_fs_datacache_sqlite_radiobutton",
2383 "toggled", 1975 "toggled",
2384 "arm", 1976 "dhtcache",
2385 "DEFAULTSERVICES", 1977 "DATABASE",
2386 gettext_noop ("Activate the VPN exit to provide services and/or to enable others to use your Internet connection"), 1978 gettext_noop ("Use sqLite to cache DHT data"),
2387 "https://gnunet.org/configuration-exit", 1979 "https://gnunet.org/configuration-datacache",
2388 &load_option_list, 1980 &load_option_list /* abuse! */ ,
2389 &save_option_list, "exit", 1981 &save_option_list /* abuse! */ , "sqlite",
2390 hide_exit_options 1982 hide_sqlite_datacache_tab},
2391 },
2392 1983
2393 { 1984 {
2394 "GNUNET_setup_vpn_enable_dns_exit_checkbutton", 1985 "GNUNET_setup_fs_datacache_mysql_radiobutton",
2395 "toggled", 1986 "toggled",
2396 "dns", 1987 "dhtcache",
2397 "PROVIDE_EXIT", 1988 "DATABASE",
2398 gettext_noop ("Allow other peers to perform DNS resolutions using your Internet connection"), 1989 gettext_noop ("Use MySQL to cache DHT data"),
2399 "https://gnunet.org/configuration-dns", 1990 "https://gnunet.org/configuration-datacache",
2400 &load_yes_no, 1991 &load_option_list /* abuse! */ ,
2401 &save_yes_no, NULL, 1992 &save_option_list /* abuse! */ , "mysql",
2402 NULL 1993 hide_mysql_datacache_tab},
2403 },
2404 1994
2405 { 1995 {
2406 "GNUNET_setup_vpn_exit_interface_name_entry", 1996 "GNUNET_setup_fs_datacache_postgres_radiobutton",
2407 "changed", 1997 "toggled",
2408 "exit", 1998 "dhtcache",
2409 "IFNAME", 1999 "DATABASE",
2410 gettext_noop ("Name of the virtual interface the GNUnet exit service should create for traffic exiting the VPN to the Internet"), 2000 gettext_noop ("Use Postgres to cache DHT data"),
2411 "https://gnunet.org/configuration-exit", 2001 "https://gnunet.org/configuration-datacache",
2412 &load_text, 2002 &load_option_list /* abuse! */ ,
2413 &save_text, NULL, 2003 &save_option_list /* abuse! */ , "postgres",
2414 NULL 2004 hide_postgres_datacache_tab},
2415 },
2416
2417 {
2418 "GNUNET_setup_vpn_exit_interface_v4_ip_entry",
2419 "changed",
2420 "exit",
2421 "IPV4ADDR",
2422 gettext_noop ("IPv4 address to use for the VPN Exit interface"),
2423 "https://gnunet.org/configuration-exit",
2424 &load_text,
2425 &save_text, NULL,
2426 NULL
2427 },
2428
2429 {
2430 "GNUNET_setup_vpn_exit_interface_v4_mask_entry",
2431 "changed",
2432 "exit",
2433 "IPV4MASK",
2434 gettext_noop ("IPv4 network mask to use for the VPN Exit interface"),
2435 "https://gnunet.org/configuration-exit",
2436 &load_text,
2437 &save_text, NULL,
2438 NULL
2439 },
2440
2441 {
2442 "GNUNET_setup_vpn_exit_interface_v6_ip_entry",
2443 "changed",
2444 "exit",
2445 "IPV6ADDR",
2446 gettext_noop ("IPv6 address to use for the VPN Exit interface"),
2447 "https://gnunet.org/configuration-exit",
2448 &load_text,
2449 &save_text, NULL,
2450 NULL
2451 },
2452
2453 {
2454 "GNUNET_setup_vpn_exit_interface_v6_mask_spinbutton",
2455 "value-changed",
2456 "exit",
2457 "IPV6MASK",
2458 gettext_noop ("IPv6 network prefix length to use for the VPN Exit interface"),
2459 "https://gnunet.org/configuration-exit",
2460 &load_number,
2461 &save_number, NULL,
2462 NULL
2463 },
2464 2005
2006 {
2007 "GNUNET_setup_datacache_mysql_database_name_entry",
2008 "changed",
2009 "datacache-mysql",
2010 "DATABASE",
2011 gettext_noop ("Name for the MySQL database"),
2012 "https://gnunet.org/configuration-datacache",
2013 &load_text,
2014 &save_text, NULL,
2015 NULL},
2465 2016
2466 { 2017 {
2467 "GNUNET_setup_vpn_exit_enable_udp_checkbutton", 2018 "GNUNET_setup_datacache_mysql_config_file_filechooserbutton",
2468 "toggled", 2019 "selection-changed",
2469 "exit", 2020 "datacache-mysql",
2470 "ENABLE_UDP", 2021 "CONFIG",
2471 gettext_noop ("Allow other users to use your Internet connection for UDP traffic (via the Exit interface)"), 2022 gettext_noop ("Configuration file for MySQL access"),
2472 "https://gnunet.org/configuration-exit", 2023 "http://dev.mysql.com/doc/refman/5.5/en/option-files.html",
2473 &load_yes_no, 2024 &load_filename,
2474 &save_yes_no, NULL, 2025 &save_filename, NULL,
2475 NULL 2026 NULL},
2476 },
2477
2478 {
2479 "GNUNET_setup_vpn_exit_enable_tcp_checkbutton",
2480 "toggled",
2481 "exit",
2482 "ENABLE_TCP",
2483 gettext_noop ("Allow other users to use your Internet connection for TCP traffic (via the Exit interface)"),
2484 "https://gnunet.org/configuration-exit",
2485 &load_yes_no,
2486 &save_yes_no, NULL,
2487 NULL
2488 },
2489
2490 /* DNS treeview */
2491
2492 {
2493 "GNUNET_setup_vpn_dns_service_treeview",
2494 NULL,
2495 NULL,
2496 NULL,
2497 gettext_noop ("Specification of .gnunet hostnames and services offered by this peer"),
2498 "https://gnunet.org/configuration-dns",
2499 &load_vpn_dns_configuration,
2500 NULL, NULL,
2501 NULL
2502 },
2503
2504 {
2505 "GNUNET_setup_vpn_dns_service_dnsname_cellrenderertext",
2506 "editing-started",
2507 NULL,
2508 NULL,
2509 NULL,
2510 "https://gnunet.org/configuration-dns",
2511 NULL,
2512 &vpn_dns_service_dnsname_install_edited_handler,
2513 NULL,
2514 NULL
2515 },
2516 2027
2517 { 2028 {
2518 "GNUNET_setup_vpn_dns_service_tcpudp_cellrenderertext", 2029 "GNUNET_setup_datacache_mysql_username_entry",
2519 "editing-started", 2030 "changed",
2520 NULL, 2031 "datacache-mysql",
2521 NULL, 2032 "USER",
2522 NULL, 2033 gettext_noop ("Username for MySQL access"),
2523 "https://gnunet.org/configuration-dns", 2034 "https://gnunet.org/configuration-datacache",
2524 NULL, 2035 &load_text,
2525 &vpn_dns_service_tcpudp_install_edited_handler, 2036 &save_text, NULL,
2526 NULL, 2037 NULL},
2527 NULL
2528 },
2529 2038
2530 { 2039 {
2531 "GNUNET_setup_vpn_dns_service_sourceport_cellrenderertext", 2040 "GNUNET_setup_datacache_mysql_password_entry",
2532 "editing-started", 2041 "changed",
2533 NULL, 2042 "datacache-mysql",
2534 NULL, 2043 "PASSWORD",
2535 NULL, 2044 gettext_noop ("Password for MySQL access"),
2536 "https://gnunet.org/configuration-dns", 2045 "https://gnunet.org/configuration-datacache",
2537 NULL, 2046 &load_text,
2538 &vpn_dns_service_sourceport_install_edited_handler, 2047 &save_text, NULL,
2539 NULL, 2048 NULL},
2540 NULL 2049
2541 }, 2050 {
2542 2051 "GNUNET_setup_datacache_mysql_hostname_entry",
2543 { 2052 "changed",
2544 "GNUNET_setup_vpn_dns_service_targethostname_cellrenderertext", 2053 "datacache-mysql",
2545 "editing-started", 2054 "HOST",
2546 NULL, 2055 gettext_noop ("Name of host running MySQL database"),
2547 NULL, 2056 "https://gnunet.org/configuration-datacache",
2548 NULL, 2057 &load_text,
2549 "https://gnunet.org/configuration-dns", 2058 &save_text, NULL,
2550 NULL, 2059 NULL},
2551 &vpn_dns_service_targethostname_install_edited_handler, 2060
2552 NULL, 2061 {
2553 NULL 2062 "GNUNET_setup_transport_wlan_interface_entry",
2554 }, 2063 "changed",
2555 2064 "transport-wlan",
2556 { 2065 "INTERFACE",
2557 "GNUNET_setup_vpn_dns_service_targetport_cellrenderertext", 2066 gettext_noop ("Name of monitoring interface to use (monX)"),
2558 "editing-started", 2067 "https://gnunet.org/configuration-wlan",
2559 NULL, 2068 &load_text,
2560 NULL, 2069 &save_text, NULL,
2561 NULL, 2070 NULL},
2562 "https://gnunet.org/configuration-dns", 2071
2563 NULL, 2072 {
2564 &vpn_dns_service_targetport_install_edited_handler, 2073 "GNUNET_setup_datacache_mysql_port_spinbutton",
2565 NULL, 2074 "value-changed",
2566 NULL 2075 "datacache-mysql",
2567 }, 2076 "PORT",
2568 2077 gettext_noop ("Port of MySQL database"),
2569 /* END of list */ 2078 "https://gnunet.org/configuration-datacache",
2570 2079 &load_number,
2571 { NULL, NULL, NULL, NULL, NULL, 2080 &save_number, NULL,
2572 NULL, NULL, NULL, NULL } 2081 NULL},
2573 }; 2082
2083 {
2084 "GNUNET_setup_datacache_postgres_config_entry",
2085 "changed",
2086 "datacache-postgres",
2087 "CONFIG",
2088 gettext_noop ("Configuration for Postgres (passed to PQconnectdb)"),
2089 "http://www.postgresql.org/docs/8.1/static/libpq.html#LIBPQ-CONNECT",
2090 &load_text,
2091 &save_text, NULL,
2092 NULL},
2093
2094 {
2095 "GNUNET_setup_vpn_master_interface_entry",
2096 "changed",
2097 "vpn",
2098 "IFNAME",
2099 gettext_noop ("Name of the virtual interface the GNUnet VPN should create"),
2100 "https://gnunet.org/configuration-vpn",
2101 &load_text,
2102 &save_text, NULL,
2103 NULL},
2104
2105 {
2106 "GNUNET_setup_vpn_master_interface_v4_ip_entry",
2107 "changed",
2108 "vpn",
2109 "IPV4ADDR",
2110 gettext_noop ("IPv4 address to use for the VPN interface"),
2111 "https://gnunet.org/configuration-vpn",
2112 &load_text,
2113 &save_text, NULL,
2114 NULL},
2115
2116 {
2117 "GNUNET_setup_vpn_master_interface_v4_mask_entry",
2118 "changed",
2119 "vpn",
2120 "IPV4MASK",
2121 gettext_noop ("IPv4 network mask to use for the VPN interface"),
2122 "https://gnunet.org/configuration-vpn",
2123 &load_text,
2124 &save_text, NULL,
2125 NULL},
2126
2127 {
2128 "GNUNET_setup_vpn_master_interface_v6_ip_entry",
2129 "changed",
2130 "vpn",
2131 "IPV6ADDR",
2132 gettext_noop ("IPv6 address to use for the VPN interface"),
2133 "https://gnunet.org/configuration-vpn",
2134 &load_text,
2135 &save_text, NULL,
2136 NULL},
2137
2138 {
2139 "GNUNET_setup_vpn_master_interface_v6_mask_spinbutton",
2140 "value-changed",
2141 "vpn",
2142 "IPV6MASK",
2143 gettext_noop ("IPv6 network prefix length to use for the VPN interface"),
2144 "https://gnunet.org/configuration-vpn",
2145 &load_number,
2146 &save_number, NULL,
2147 NULL},
2148
2149 {
2150 "GNUNET_setup_vpn_master_vdns_server_entry",
2151 "changed",
2152 "vpn",
2153 "VIRTDNS",
2154 gettext_noop
2155 ("IP address of the virtual DNS server that resolves through GNUnet (use in resolve.conf if you want to resolve through some GNUnet DNS Exit)"),
2156 "https://gnunet.org/configuration-vpn",
2157 &load_text,
2158 &save_text, NULL,
2159 NULL},
2160
2161 {
2162 "GNUNET_setup_vpn_enable_vpn_exit_checkbutton",
2163 "toggled",
2164 "arm",
2165 "DEFAULTSERVICES",
2166 gettext_noop
2167 ("Activate the VPN exit to provide services and/or to enable others to use your Internet connection"),
2168 "https://gnunet.org/configuration-exit",
2169 &load_option_list,
2170 &save_option_list, "exit",
2171 hide_exit_options},
2172
2173 {
2174 "GNUNET_setup_vpn_enable_dns_exit_checkbutton",
2175 "toggled",
2176 "dns",
2177 "PROVIDE_EXIT",
2178 gettext_noop
2179 ("Allow other peers to perform DNS resolutions using your Internet connection"),
2180 "https://gnunet.org/configuration-dns",
2181 &load_yes_no,
2182 &save_yes_no, NULL,
2183 NULL},
2184
2185 {
2186 "GNUNET_setup_vpn_exit_interface_name_entry",
2187 "changed",
2188 "exit",
2189 "IFNAME",
2190 gettext_noop
2191 ("Name of the virtual interface the GNUnet exit service should create for traffic exiting the VPN to the Internet"),
2192 "https://gnunet.org/configuration-exit",
2193 &load_text,
2194 &save_text, NULL,
2195 NULL},
2196
2197 {
2198 "GNUNET_setup_vpn_exit_interface_v4_ip_entry",
2199 "changed",
2200 "exit",
2201 "IPV4ADDR",
2202 gettext_noop ("IPv4 address to use for the VPN Exit interface"),
2203 "https://gnunet.org/configuration-exit",
2204 &load_text,
2205 &save_text, NULL,
2206 NULL},
2207
2208 {
2209 "GNUNET_setup_vpn_exit_interface_v4_mask_entry",
2210 "changed",
2211 "exit",
2212 "IPV4MASK",
2213 gettext_noop ("IPv4 network mask to use for the VPN Exit interface"),
2214 "https://gnunet.org/configuration-exit",
2215 &load_text,
2216 &save_text, NULL,
2217 NULL},
2218
2219 {
2220 "GNUNET_setup_vpn_exit_interface_v6_ip_entry",
2221 "changed",
2222 "exit",
2223 "IPV6ADDR",
2224 gettext_noop ("IPv6 address to use for the VPN Exit interface"),
2225 "https://gnunet.org/configuration-exit",
2226 &load_text,
2227 &save_text, NULL,
2228 NULL},
2229
2230 {
2231 "GNUNET_setup_vpn_exit_interface_v6_mask_spinbutton",
2232 "value-changed",
2233 "exit",
2234 "IPV6MASK",
2235 gettext_noop
2236 ("IPv6 network prefix length to use for the VPN Exit interface"),
2237 "https://gnunet.org/configuration-exit",
2238 &load_number,
2239 &save_number, NULL,
2240 NULL},
2241
2242
2243 {
2244 "GNUNET_setup_vpn_exit_enable_udp_checkbutton",
2245 "toggled",
2246 "exit",
2247 "ENABLE_UDP",
2248 gettext_noop
2249 ("Allow other users to use your Internet connection for UDP traffic (via the Exit interface)"),
2250 "https://gnunet.org/configuration-exit",
2251 &load_yes_no,
2252 &save_yes_no, NULL,
2253 NULL},
2254
2255 {
2256 "GNUNET_setup_vpn_exit_enable_tcp_checkbutton",
2257 "toggled",
2258 "exit",
2259 "ENABLE_TCP",
2260 gettext_noop
2261 ("Allow other users to use your Internet connection for TCP traffic (via the Exit interface)"),
2262 "https://gnunet.org/configuration-exit",
2263 &load_yes_no,
2264 &save_yes_no, NULL,
2265 NULL},
2266
2267 /* DNS treeview */
2268
2269 {
2270 "GNUNET_setup_vpn_dns_service_treeview",
2271 NULL,
2272 NULL,
2273 NULL,
2274 gettext_noop
2275 ("Specification of .gnunet hostnames and services offered by this peer"),
2276 "https://gnunet.org/configuration-dns",
2277 &load_vpn_dns_configuration,
2278 NULL, NULL,
2279 NULL},
2280
2281 {
2282 "GNUNET_setup_vpn_dns_service_dnsname_cellrenderertext",
2283 "editing-started",
2284 NULL,
2285 NULL,
2286 NULL,
2287 "https://gnunet.org/configuration-dns",
2288 NULL,
2289 &vpn_dns_service_dnsname_install_edited_handler,
2290 NULL,
2291 NULL},
2292
2293 {
2294 "GNUNET_setup_vpn_dns_service_tcpudp_cellrenderertext",
2295 "editing-started",
2296 NULL,
2297 NULL,
2298 NULL,
2299 "https://gnunet.org/configuration-dns",
2300 NULL,
2301 &vpn_dns_service_tcpudp_install_edited_handler,
2302 NULL,
2303 NULL},
2304
2305 {
2306 "GNUNET_setup_vpn_dns_service_sourceport_cellrenderertext",
2307 "editing-started",
2308 NULL,
2309 NULL,
2310 NULL,
2311 "https://gnunet.org/configuration-dns",
2312 NULL,
2313 &vpn_dns_service_sourceport_install_edited_handler,
2314 NULL,
2315 NULL},
2316
2317 {
2318 "GNUNET_setup_vpn_dns_service_targethostname_cellrenderertext",
2319 "editing-started",
2320 NULL,
2321 NULL,
2322 NULL,
2323 "https://gnunet.org/configuration-dns",
2324 NULL,
2325 &vpn_dns_service_targethostname_install_edited_handler,
2326 NULL,
2327 NULL},
2328
2329 {
2330 "GNUNET_setup_vpn_dns_service_targetport_cellrenderertext",
2331 "editing-started",
2332 NULL,
2333 NULL,
2334 NULL,
2335 "https://gnunet.org/configuration-dns",
2336 NULL,
2337 &vpn_dns_service_targetport_install_edited_handler,
2338 NULL,
2339 NULL},
2340
2341 /* END of list */
2342
2343 {NULL, NULL, NULL, NULL, NULL,
2344 NULL, NULL, NULL, NULL}
2345};
2574 2346
2575/* end of gnunet-setup-options.c */ 2347/* end of gnunet-setup-options.c */
diff --git a/src/setup/gnunet-setup-transport-http.c b/src/setup/gnunet-setup-transport-http.c
index 17c116c6..2820f0a1 100644
--- a/src/setup/gnunet-setup-transport-http.c
+++ b/src/setup/gnunet-setup-transport-http.c
@@ -36,10 +36,9 @@
36void 36void
37GNUNET_setup_transport_http_test_button_clicked_cb () 37GNUNET_setup_transport_http_test_button_clicked_cb ()
38{ 38{
39 GNUNET_setup_transport_test ("transport-http", 39 GNUNET_setup_transport_test ("transport-http", GNUNET_YES,
40 GNUNET_YES, 40 "GNUNET_setup_transport_http_test_success_image",
41 "GNUNET_setup_transport_http_test_success_image", 41 "GNUNET_setup_transport_http_test_fail_image");
42 "GNUNET_setup_transport_http_test_fail_image");
43} 42}
44 43
45 44
diff --git a/src/setup/gnunet-setup-transport-https.c b/src/setup/gnunet-setup-transport-https.c
index 08554383..80ae2457 100644
--- a/src/setup/gnunet-setup-transport-https.c
+++ b/src/setup/gnunet-setup-transport-https.c
@@ -36,10 +36,9 @@
36void 36void
37GNUNET_setup_transport_https_test_button_clicked_cb () 37GNUNET_setup_transport_https_test_button_clicked_cb ()
38{ 38{
39 GNUNET_setup_transport_test ("transport-https", 39 GNUNET_setup_transport_test ("transport-https", GNUNET_YES,
40 GNUNET_YES, 40 "GNUNET_setup_transport_https_test_success_image",
41 "GNUNET_setup_transport_https_test_success_image", 41 "GNUNET_setup_transport_https_test_fail_image");
42 "GNUNET_setup_transport_https_test_fail_image");
43} 42}
44 43
45 44
diff --git a/src/setup/gnunet-setup-transport-plugins.c b/src/setup/gnunet-setup-transport-plugins.c
index 52fa9dea..f17b13d0 100644
--- a/src/setup/gnunet-setup-transport-plugins.c
+++ b/src/setup/gnunet-setup-transport-plugins.c
@@ -34,72 +34,66 @@
34 * @param name name of the plugin to check 34 * @param name name of the plugin to check
35 */ 35 */
36static void 36static void
37test_plugin (GtkWidget *widget, 37test_plugin (GtkWidget * widget, const char *name)
38 const char *name)
39{ 38{
40 if (GNUNET_YES == 39 if (GNUNET_YES == GNUNET_PLUGIN_test (name))
41 GNUNET_PLUGIN_test (name)) 40 {
42 { 41 gtk_widget_set_sensitive (widget, TRUE);
43 gtk_widget_set_sensitive (widget, 42 }
44 TRUE);
45 }
46 else 43 else
47 { 44 {
48 gtk_widget_set_sensitive (widget, 45 gtk_widget_set_sensitive (widget, FALSE);
49 FALSE); 46 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
50 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 47 }
51 FALSE);
52 }
53} 48}
54 49
55 50
56 51
57void 52void
58GNUNET_setup_transport_tcp_checkbutton_realize_cb (GtkWidget *widget, 53GNUNET_setup_transport_tcp_checkbutton_realize_cb (GtkWidget * widget,
59 gpointer user_data) 54 gpointer user_data)
60{ 55{
61 test_plugin (widget, "libgnunet_plugin_transport_tcp"); 56 test_plugin (widget, "libgnunet_plugin_transport_tcp");
62} 57}
63 58
64 59
65void 60void
66GNUNET_setup_transport_udp_checkbutton_realize_cb (GtkWidget *widget, 61GNUNET_setup_transport_udp_checkbutton_realize_cb (GtkWidget * widget,
67 gpointer user_data) 62 gpointer user_data)
68{ 63{
69 test_plugin (widget, "libgnunet_plugin_transport_udp"); 64 test_plugin (widget, "libgnunet_plugin_transport_udp");
70} 65}
71 66
72 67
73void 68void
74GNUNET_setup_transport_http_checkbutton_realize_cb (GtkWidget *widget, 69GNUNET_setup_transport_http_checkbutton_realize_cb (GtkWidget * widget,
75 gpointer user_data) 70 gpointer user_data)
76{ 71{
77 test_plugin (widget, "libgnunet_plugin_transport_http"); 72 test_plugin (widget, "libgnunet_plugin_transport_http");
78} 73}
79 74
80 75
81void 76void
82GNUNET_setup_transport_https_checkbutton_realize_cb (GtkWidget *widget, 77GNUNET_setup_transport_https_checkbutton_realize_cb (GtkWidget * widget,
83 gpointer user_data) 78 gpointer user_data)
84{ 79{
85 test_plugin (widget, "libgnunet_plugin_transport_https"); 80 test_plugin (widget, "libgnunet_plugin_transport_https");
86} 81}
87 82
88 83
89void 84void
90GNUNET_setup_transport_dv_checkbutton_realize_cb (GtkWidget *widget, 85GNUNET_setup_transport_dv_checkbutton_realize_cb (GtkWidget * widget,
91 gpointer user_data) 86 gpointer user_data)
92{ 87{
93 test_plugin (widget, "libgnunet_plugin_transport_dv"); 88 test_plugin (widget, "libgnunet_plugin_transport_dv");
94} 89}
95 90
96 91
97void 92void
98GNUNET_setup_transport_wlan_checkbutton_realize_cb (GtkWidget *widget, 93GNUNET_setup_transport_wlan_checkbutton_realize_cb (GtkWidget * widget,
99 gpointer user_data) 94 gpointer user_data)
100{ 95{
101 test_plugin (widget, "libgnunet_plugin_transport_wlan"); 96 test_plugin (widget, "libgnunet_plugin_transport_wlan");
102} 97}
103 98
104/* end of gnunet-setup-transport-plugins.c */ 99/* end of gnunet-setup-transport-plugins.c */
105
diff --git a/src/setup/gnunet-setup-transport-tcp.c b/src/setup/gnunet-setup-transport-tcp.c
index 89d8085c..d82fb16b 100644
--- a/src/setup/gnunet-setup-transport-tcp.c
+++ b/src/setup/gnunet-setup-transport-tcp.c
@@ -36,10 +36,9 @@
36void 36void
37GNUNET_setup_transport_tcp_test_button_clicked_cb () 37GNUNET_setup_transport_tcp_test_button_clicked_cb ()
38{ 38{
39 GNUNET_setup_transport_test ("transport-tcp", 39 GNUNET_setup_transport_test ("transport-tcp", GNUNET_YES,
40 GNUNET_YES, 40 "GNUNET_setup_transport_tcp_test_success_image",
41 "GNUNET_setup_transport_tcp_test_success_image", 41 "GNUNET_setup_transport_tcp_test_fail_image");
42 "GNUNET_setup_transport_tcp_test_fail_image");
43} 42}
44 43
45 44
diff --git a/src/setup/gnunet-setup-transport-test.c b/src/setup/gnunet-setup-transport-test.c
index 4bc9c26c..87f8fc9f 100644
--- a/src/setup/gnunet-setup-transport-test.c
+++ b/src/setup/gnunet-setup-transport-test.c
@@ -48,9 +48,9 @@ struct TestContext
48 48
49 /** 49 /**
50 * Name of widget to show on success. 50 * Name of widget to show on success.
51 */ 51 */
52 const char *success_image; 52 const char *success_image;
53 53
54 /** 54 /**
55 * Name of widget to show on failure. 55 * Name of widget to show on failure.
56 */ 56 */
@@ -66,39 +66,38 @@ struct TestContext
66 * @param result GNUNET_YES on success 66 * @param result GNUNET_YES on success
67 */ 67 */
68static void 68static void
69display_test_result (struct TestContext *tc, 69display_test_result (struct TestContext *tc, int result)
70 int result)
71{ 70{
72 GObject *w; 71 GObject *w;
73 72
74 if (GNUNET_YES != result) 73 if (GNUNET_YES != result)
75 { 74 {
76 w = GNUNET_SETUP_get_object (tc->failure_image); 75 w = GNUNET_SETUP_get_object (tc->failure_image);
77 if (NULL != w) 76 if (NULL != w)
78 gtk_widget_show (GTK_WIDGET (w)); 77 gtk_widget_show (GTK_WIDGET (w));
79 w = GNUNET_SETUP_get_object (tc->success_image); 78 w = GNUNET_SETUP_get_object (tc->success_image);
80 if (NULL != w) 79 if (NULL != w)
81 gtk_widget_hide (GTK_WIDGET (w)); 80 gtk_widget_hide (GTK_WIDGET (w));
82 } 81 }
83 else 82 else
84 { 83 {
85 w = GNUNET_SETUP_get_object (tc->failure_image); 84 w = GNUNET_SETUP_get_object (tc->failure_image);
86 if (NULL != w) 85 if (NULL != w)
87 gtk_widget_hide (GTK_WIDGET (w)); 86 gtk_widget_hide (GTK_WIDGET (w));
88 w = GNUNET_SETUP_get_object (tc->success_image); 87 w = GNUNET_SETUP_get_object (tc->success_image);
89 if (NULL != w) 88 if (NULL != w)
90 gtk_widget_show (GTK_WIDGET (w)); 89 gtk_widget_show (GTK_WIDGET (w));
91 } 90 }
92 if (GNUNET_SCHEDULER_NO_TASK != tc->tsk) 91 if (GNUNET_SCHEDULER_NO_TASK != tc->tsk)
93 { 92 {
94 GNUNET_SCHEDULER_cancel (tc->tsk); 93 GNUNET_SCHEDULER_cancel (tc->tsk);
95 tc->tsk = GNUNET_SCHEDULER_NO_TASK; 94 tc->tsk = GNUNET_SCHEDULER_NO_TASK;
96 } 95 }
97 if (NULL != tc->tst) 96 if (NULL != tc->tst)
98 { 97 {
99 GNUNET_NAT_test_stop (tc->tst); 98 GNUNET_NAT_test_stop (tc->tst);
100 tc->tst = NULL; 99 tc->tst = NULL;
101 } 100 }
102 GNUNET_free (tc); 101 GNUNET_free (tc);
103} 102}
104 103
@@ -111,8 +110,7 @@ display_test_result (struct TestContext *tc,
111 * @param success currently always GNUNET_OK 110 * @param success currently always GNUNET_OK
112 */ 111 */
113static void 112static void
114result_callback (void *cls, 113result_callback (void *cls, int success)
115 int success)
116{ 114{
117 struct TestContext *tc = cls; 115 struct TestContext *tc = cls;
118 116
@@ -128,8 +126,7 @@ result_callback (void *cls,
128 * @param tc scheduler callback 126 * @param tc scheduler callback
129 */ 127 */
130static void 128static void
131fail_timeout (void *cls, 129fail_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
132 const struct GNUNET_SCHEDULER_TaskContext *tc)
133{ 130{
134 struct TestContext *tstc = cls; 131 struct TestContext *tstc = cls;
135 132
@@ -148,10 +145,9 @@ fail_timeout (void *cls,
148 * @param failure_image image to show on failure 145 * @param failure_image image to show on failure
149 */ 146 */
150void 147void
151GNUNET_setup_transport_test (const char *section_name, 148GNUNET_setup_transport_test (const char *section_name, int is_tcp,
152 int is_tcp, 149 const char *success_image,
153 const char *success_image, 150 const char *failure_image)
154 const char *failure_image)
155{ 151{
156 struct TestContext *tc; 152 struct TestContext *tc;
157 unsigned long long bnd_port; 153 unsigned long long bnd_port;
@@ -159,19 +155,15 @@ GNUNET_setup_transport_test (const char *section_name,
159 GtkWidget *w; 155 GtkWidget *w;
160 156
161 if (GNUNET_OK != 157 if (GNUNET_OK !=
162 GNUNET_CONFIGURATION_get_value_number (cfg, 158 GNUNET_CONFIGURATION_get_value_number (cfg, section_name, "PORT",
163 section_name, 159 &bnd_port))
164 "PORT", 160 {
165 &bnd_port)) 161 GNUNET_break (0);
166 { 162 return;
167 GNUNET_break (0); 163 }
168 return;
169 }
170 if (GNUNET_OK != 164 if (GNUNET_OK !=
171 GNUNET_CONFIGURATION_get_value_number (cfg, 165 GNUNET_CONFIGURATION_get_value_number (cfg, section_name,
172 section_name, 166 "ADVERTISED_PORT", &adv_port))
173 "ADVERTISED_PORT",
174 &adv_port))
175 adv_port = bnd_port; 167 adv_port = bnd_port;
176 tc = GNUNET_malloc (sizeof (struct TestContext)); 168 tc = GNUNET_malloc (sizeof (struct TestContext));
177 tc->success_image = success_image; 169 tc->success_image = success_image;
@@ -180,20 +172,15 @@ GNUNET_setup_transport_test (const char *section_name,
180 gtk_widget_hide (w); 172 gtk_widget_hide (w);
181 GNUNET_assert (NULL != cfg); 173 GNUNET_assert (NULL != cfg);
182 GNUNET_RESOLVER_connect (cfg); 174 GNUNET_RESOLVER_connect (cfg);
183 tc->tst = GNUNET_NAT_test_start (cfg, 175 tc->tst =
184 is_tcp, 176 GNUNET_NAT_test_start (cfg, is_tcp, (uint16_t) bnd_port,
185 (uint16_t) bnd_port, 177 (uint16_t) adv_port, &result_callback, tc);
186 (uint16_t) adv_port,
187 &result_callback,
188 tc);
189 if (NULL == tc->tst) 178 if (NULL == tc->tst)
190 { 179 {
191 display_test_result (tc, GNUNET_SYSERR); 180 display_test_result (tc, GNUNET_SYSERR);
192 return; 181 return;
193 } 182 }
194 tc->tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 183 tc->tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &fail_timeout, tc);
195 &fail_timeout,
196 tc);
197} 184}
198 185
199/* end of gnunet-setup-transport-test.c */ 186/* end of gnunet-setup-transport-test.c */
diff --git a/src/setup/gnunet-setup-transport-udp.c b/src/setup/gnunet-setup-transport-udp.c
index f758f8d0..60421c78 100644
--- a/src/setup/gnunet-setup-transport-udp.c
+++ b/src/setup/gnunet-setup-transport-udp.c
@@ -37,10 +37,9 @@ void
37GNUNET_setup_transport_udp_test_button_clicked_cb () 37GNUNET_setup_transport_udp_test_button_clicked_cb ()
38{ 38{
39 39
40 GNUNET_setup_transport_test ("transport-udp", 40 GNUNET_setup_transport_test ("transport-udp", GNUNET_NO,
41 GNUNET_NO, 41 "GNUNET_setup_transport_udp_test_success_image",
42 "GNUNET_setup_transport_udp_test_success_image", 42 "GNUNET_setup_transport_udp_test_fail_image");
43 "GNUNET_setup_transport_udp_test_fail_image");
44 43
45} 44}
46 45
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c
index 6b4d243c..3fae215a 100644
--- a/src/setup/gnunet-setup-transport.c
+++ b/src/setup/gnunet-setup-transport.c
@@ -56,14 +56,15 @@ update_icmp_server_enable_button (int on)
56{ 56{
57 GtkToggleButton *button; 57 GtkToggleButton *button;
58 58
59 button = GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_transport_icmp_server_enable_checkbutton")); 59 button =
60 GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object
61 ("GNUNET_setup_transport_icmp_server_enable_checkbutton"));
60 if (button == NULL) 62 if (button == NULL)
61 { 63 {
62 GNUNET_break (0); 64 GNUNET_break (0);
63 return; 65 return;
64 } 66 }
65 gtk_toggle_button_set_active (button, 67 gtk_toggle_button_set_active (button, on ? TRUE : FALSE);
66 on ? TRUE : FALSE);
67} 68}
68 69
69 70
@@ -75,18 +76,17 @@ update_icmp_server_enable_button (int on)
75 * @param success currently always GNUNET_OK 76 * @param success currently always GNUNET_OK
76 */ 77 */
77static void 78static void
78result_callback (void *cls, 79result_callback (void *cls, int success)
79 int success)
80{ 80{
81 GNUNET_SCHEDULER_cancel (tsk); 81 GNUNET_SCHEDULER_cancel (tsk);
82 tsk = GNUNET_SCHEDULER_NO_TASK; 82 tsk = GNUNET_SCHEDULER_NO_TASK;
83 GNUNET_NAT_test_stop (tst); 83 GNUNET_NAT_test_stop (tst);
84 tst = NULL; 84 tst = NULL;
85 if (NULL != resolver) 85 if (NULL != resolver)
86 { 86 {
87 GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM)); 87 GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM));
88 GNUNET_OS_process_close (resolver); 88 GNUNET_OS_process_close (resolver);
89 } 89 }
90 update_icmp_server_enable_button (success); 90 update_icmp_server_enable_button (success);
91} 91}
92 92
@@ -99,8 +99,7 @@ result_callback (void *cls,
99 * @param tc scheduler callback 99 * @param tc scheduler callback
100 */ 100 */
101static void 101static void
102fail_timeout (void *cls, 102fail_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
103 const struct GNUNET_SCHEDULER_TaskContext *tc)
104{ 103{
105 GNUNET_assert (NULL != tst); 104 GNUNET_assert (NULL != tst);
106 tsk = GNUNET_SCHEDULER_NO_TASK; 105 tsk = GNUNET_SCHEDULER_NO_TASK;
@@ -116,27 +115,20 @@ fail_timeout (void *cls,
116 * @param cls the 'int*' for the result 115 * @param cls the 'int*' for the result
117 * @param tc scheduler context 116 * @param tc scheduler context
118 */ 117 */
119static void 118static void
120reversal_test (void *cls, 119reversal_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
121 const struct GNUNET_SCHEDULER_TaskContext *tc)
122{ 120{
123 int *ok = cls; 121 int *ok = cls;
124 122
125 GNUNET_assert (NULL != cfg); 123 GNUNET_assert (NULL != cfg);
126 GNUNET_RESOLVER_connect (cfg); 124 GNUNET_RESOLVER_connect (cfg);
127 tst = GNUNET_NAT_test_start (cfg, 125 tst = GNUNET_NAT_test_start (cfg, GNUNET_YES, 0, 0, &result_callback, ok);
128 GNUNET_YES,
129 0, 0,
130 &result_callback,
131 ok);
132 if (NULL == tst) 126 if (NULL == tst)
133 { 127 {
134 *ok = GNUNET_SYSERR; 128 *ok = GNUNET_SYSERR;
135 return; 129 return;
136 } 130 }
137 tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 131 tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &fail_timeout, ok);
138 &fail_timeout,
139 ok);
140} 132}
141 133
142/** 134/**
@@ -146,10 +138,10 @@ static void
146test_connection_reversal () 138test_connection_reversal ()
147{ 139{
148 if (NULL != resolver) 140 if (NULL != resolver)
149 return; /* test already active!? */ 141 return; /* test already active!? */
150 resolver = GNUNET_OS_start_process (NULL, NULL, 142 resolver =
151 "gnunet-service-resolver", 143 GNUNET_OS_start_process (NULL, NULL, "gnunet-service-resolver",
152 "gnunet-service-resolver", NULL); 144 "gnunet-service-resolver", NULL);
153 GNUNET_SCHEDULER_add_now (&reversal_test, NULL); 145 GNUNET_SCHEDULER_add_now (&reversal_test, NULL);
154} 146}
155 147
@@ -166,36 +158,31 @@ test_connection_reversal ()
166 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort 158 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
167 */ 159 */
168static int 160static int
169nipo (void *cls, 161nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr,
170 const char *name, 162 socklen_t addrlen)
171 int isDefault,
172 const struct sockaddr *
173 addr, socklen_t addrlen)
174{ 163{
175 const struct sockaddr_in *in; 164 const struct sockaddr_in *in;
176 char buf[INET_ADDRSTRLEN]; 165 char buf[INET_ADDRSTRLEN];
177 GtkEntry *entry; 166 GtkEntry *entry;
178 167
179 if (! isDefault) 168 if (!isDefault)
180 return GNUNET_OK; 169 return GNUNET_OK;
181 if (addrlen != sizeof (struct sockaddr_in)) 170 if (addrlen != sizeof (struct sockaddr_in))
182 return GNUNET_OK; 171 return GNUNET_OK;
183 in = (const struct sockaddr_in*) addr; 172 in = (const struct sockaddr_in *) addr;
184 173
185 /* set internal IP address */ 174 /* set internal IP address */
186 inet_ntop (AF_INET, &in->sin_addr, buf, sizeof(buf)); 175 inet_ntop (AF_INET, &in->sin_addr, buf, sizeof (buf));
187 GNUNET_CONFIGURATION_set_value_string (cfg, 176 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "INTERNAL_ADDRESS", buf);
188 "nat", 177 entry =
189 "INTERNAL_ADDRESS", 178 GTK_ENTRY (GNUNET_SETUP_get_object
190 buf); 179 ("GNUNET_setup_transport_internal_ip_entry"));
191 entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_transport_internal_ip_entry"));
192 if (entry == NULL) 180 if (entry == NULL)
193 { 181 {
194 GNUNET_break (0); 182 GNUNET_break (0);
195 return GNUNET_SYSERR; 183 return GNUNET_SYSERR;
196 } 184 }
197 gtk_entry_set_text (entry, 185 gtk_entry_set_text (entry, buf);
198 buf);
199 /* no need to continue iteration */ 186 /* no need to continue iteration */
200 return GNUNET_SYSERR; 187 return GNUNET_SYSERR;
201} 188}
@@ -208,8 +195,7 @@ nipo (void *cls,
208 * @param addr the address, NULL on errors 195 * @param addr the address, NULL on errors
209 */ 196 */
210static void 197static void
211set_external_ipv4 (void *cls, 198set_external_ipv4 (void *cls, const struct in_addr *addr)
212 const struct in_addr *addr)
213{ 199{
214 struct in_addr ia; 200 struct in_addr ia;
215 char buf[INET_ADDRSTRLEN]; 201 char buf[INET_ADDRSTRLEN];
@@ -218,46 +204,40 @@ set_external_ipv4 (void *cls,
218 GtkToggleButton *button; 204 GtkToggleButton *button;
219 205
220 if (NULL != addr) 206 if (NULL != addr)
221 { 207 {
222 /* enable 'behind nat' */ 208 /* enable 'behind nat' */
223 if (NULL != cfg) 209 if (NULL != cfg)
224 GNUNET_CONFIGURATION_set_value_string (cfg, 210 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "BEHIND_NAT", "YES");
225 "nat", 211 o = GNUNET_SETUP_get_object ("GNUNET_setup_transport_nat_checkbutton");
226 "BEHIND_NAT", 212 if (NULL != o)
227 "YES"); 213 {
228 o = GNUNET_SETUP_get_object ("GNUNET_setup_transport_nat_checkbutton"); 214 button = GTK_TOGGLE_BUTTON (o);
229 if (NULL != o) 215 if (button == NULL)
230 { 216 {
231 button = GTK_TOGGLE_BUTTON (o); 217 GNUNET_break (0);
232 if (button == NULL) 218 return;
233 { 219 }
234 GNUNET_break (0); 220 gtk_toggle_button_set_active (button, TRUE);
235 return;
236 }
237 gtk_toggle_button_set_active (button,
238 TRUE);
239 }
240
241 /* set external IP address */
242 inet_ntop (AF_INET, &ia, buf, sizeof(buf));
243 if (NULL != cfg)
244 GNUNET_CONFIGURATION_set_value_string (cfg,
245 "nat",
246 "EXTERNAL_ADDRESS",
247 buf);
248 o = GNUNET_SETUP_get_object ("GNUNET_setup_transport_external_ip_address_entry");
249 if (NULL != o)
250 {
251 entry = GTK_ENTRY (o);
252 if (entry == NULL)
253 {
254 GNUNET_break (0);
255 return;
256 }
257 gtk_entry_set_text (entry,
258 buf);
259 }
260 } 221 }
222
223 /* set external IP address */
224 inet_ntop (AF_INET, &ia, buf, sizeof (buf));
225 if (NULL != cfg)
226 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "EXTERNAL_ADDRESS",
227 buf);
228 o = GNUNET_SETUP_get_object
229 ("GNUNET_setup_transport_external_ip_address_entry");
230 if (NULL != o)
231 {
232 entry = GTK_ENTRY (o);
233 if (entry == NULL)
234 {
235 GNUNET_break (0);
236 return;
237 }
238 gtk_entry_set_text (entry, buf);
239 }
240 }
261} 241}
262 242
263 243
@@ -273,9 +253,7 @@ GNUNET_setup_transport_autoconfig_button_clicked_cb ()
273 char *tmp; 253 char *tmp;
274 254
275 /* try to detect external IP */ 255 /* try to detect external IP */
276 (void) GNUNET_NAT_mini_get_external_ipv4 (TIMEOUT, 256 (void) GNUNET_NAT_mini_get_external_ipv4 (TIMEOUT, &set_external_ipv4, NULL);
277 &set_external_ipv4,
278 NULL);
279 /* Try to detect internal IP */ 257 /* Try to detect internal IP */
280 GNUNET_OS_network_interfaces_list (&nipo, NULL); 258 GNUNET_OS_network_interfaces_list (&nipo, NULL);
281 259
@@ -283,45 +261,38 @@ GNUNET_setup_transport_autoconfig_button_clicked_cb ()
283 261
284 /* test gnunet-helper-nat-server */ 262 /* test gnunet-helper-nat-server */
285 tmp = NULL; 263 tmp = NULL;
286 hns = ( (GNUNET_OK == 264 hns =
287 GNUNET_CONFIGURATION_get_value_string (cfg, 265 ((GNUNET_OK ==
288 "nat", 266 GNUNET_CONFIGURATION_get_value_string (cfg, "nat", "EXTERNAL_ADDRESS",
289 "EXTERNAL_ADDRESS", 267 &tmp)) && (0 < strlen (tmp)) &&
290 &tmp)) && 268 (GNUNET_YES ==
291 (0 < strlen (tmp)) && 269 GNUNET_CONFIGURATION_get_value_yesno (cfg, "nat", "BEHIND_NAT")) &&
292 (GNUNET_YES == 270 (GNUNET_YES ==
293 GNUNET_CONFIGURATION_get_value_yesno (cfg, 271 GNUNET_OS_check_helper_binary ("gnunet-helper-nat-server")));
294 "nat",
295 "BEHIND_NAT")) &&
296 (GNUNET_YES ==
297 GNUNET_OS_check_helper_binary ("gnunet-helper-nat-server")) );
298 GNUNET_free_non_null (tmp); 272 GNUNET_free_non_null (tmp);
299 if (hns) 273 if (hns)
300 test_connection_reversal (); 274 test_connection_reversal ();
301 275
302 /* test gnunet-helper-nat-client */ 276 /* test gnunet-helper-nat-client */
303 tmp = NULL; 277 tmp = NULL;
304 hnc = ( (GNUNET_OK == 278 hnc =
305 GNUNET_CONFIGURATION_get_value_string (cfg, 279 ((GNUNET_OK ==
306 "nat", 280 GNUNET_CONFIGURATION_get_value_string (cfg, "nat", "INTERNAL_ADDRESS",
307 "INTERNAL_ADDRESS", 281 &tmp)) && (0 < strlen (tmp)) &&
308 &tmp)) && 282 (GNUNET_YES !=
309 (0 < strlen (tmp)) && 283 GNUNET_CONFIGURATION_get_value_yesno (cfg, "nat", "BEHIND_NAT")) &&
310 (GNUNET_YES != 284 (GNUNET_YES ==
311 GNUNET_CONFIGURATION_get_value_yesno (cfg, 285 GNUNET_OS_check_helper_binary ("gnunet-helper-nat-client")));
312 "nat",
313 "BEHIND_NAT")) &&
314 (GNUNET_YES ==
315 GNUNET_OS_check_helper_binary ("gnunet-helper-nat-client")) );
316 GNUNET_free_non_null (tmp); 286 GNUNET_free_non_null (tmp);
317 button = GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_transport_icmp_client_enable_checkbutton")); 287 button =
288 GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object
289 ("GNUNET_setup_transport_icmp_client_enable_checkbutton"));
318 if (button == NULL) 290 if (button == NULL)
319 { 291 {
320 GNUNET_break (0); 292 GNUNET_break (0);
321 return; 293 return;
322 } 294 }
323 gtk_toggle_button_set_active (button, 295 gtk_toggle_button_set_active (button, hnc ? TRUE : FALSE);
324 hnc ? TRUE : FALSE);
325} 296}
326 297
327/* end of gnunet-setup-transport.c */ 298/* end of gnunet-setup-transport.c */
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c
index 6844a076..dc8b6bcb 100644
--- a/src/setup/gnunet-setup.c
+++ b/src/setup/gnunet-setup.c
@@ -77,9 +77,8 @@ GNUNET_SETUP_get_object (const char *name)
77 77
78 78
79static gboolean 79static gboolean
80help_click_callback (GtkWidget *widget, 80help_click_callback (GtkWidget * widget, GdkEventButton * event,
81 GdkEventButton *event, 81 gpointer user_data)
82 gpointer user_data)
83{ 82{
84 const struct GNUNET_SETUP_OptionSpecification *os = user_data; 83 const struct GNUNET_SETUP_OptionSpecification *os = user_data;
85 GtkLinkButton *help; 84 GtkLinkButton *help;
@@ -87,10 +86,8 @@ help_click_callback (GtkWidget *widget,
87 if (event->type != GDK_BUTTON_PRESS) 86 if (event->type != GDK_BUTTON_PRESS)
88 return FALSE; 87 return FALSE;
89 help = GTK_LINK_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_help_text")); 88 help = GTK_LINK_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_help_text"));
90 gtk_link_button_set_uri (help, 89 gtk_link_button_set_uri (help, os->help_url);
91 os->help_url); 90 gtk_button_set_label (GTK_BUTTON (help), os->help_text);
92 gtk_button_set_label (GTK_BUTTON (help),
93 os->help_text);
94 return FALSE; 91 return FALSE;
95} 92}
96 93
@@ -104,7 +101,7 @@ help_click_callback (GtkWidget *widget,
104 */ 101 */
105static void 102static void
106update_visibility (const struct GNUNET_SETUP_OptionSpecification *os, 103update_visibility (const struct GNUNET_SETUP_OptionSpecification *os,
107 const char *value) 104 const char *value)
108{ 105{
109 unsigned int i; 106 unsigned int i;
110 const struct GNUNET_SETUP_VisibilitySpecification *vs; 107 const struct GNUNET_SETUP_VisibilitySpecification *vs;
@@ -115,51 +112,49 @@ update_visibility (const struct GNUNET_SETUP_OptionSpecification *os,
115 return; 112 return;
116 i = 0; 113 i = 0;
117 while (os->visibility[i].widget_name != NULL) 114 while (os->visibility[i].widget_name != NULL)
115 {
116 vs = &os->visibility[i];
117 widget = GTK_WIDGET (GNUNET_SETUP_get_object (vs->widget_name));
118 if (widget == NULL)
118 { 119 {
119 vs = &os->visibility[i]; 120 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Widget `%s' not found\n"),
120 widget = GTK_WIDGET (GNUNET_SETUP_get_object (vs->widget_name)); 121 vs->widget_name);
121 if (widget == NULL) 122 }
122 { 123 if (NULL != vs->show_value)
123 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 124 {
124 _("Widget `%s' not found\n"), 125 if (0 !=
125 vs->widget_name); 126 regcomp (&r, vs->show_value, REG_EXTENDED | REG_ICASE | REG_NOSUB))
126 } 127 {
127 if (NULL != vs->show_value) 128 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
128 { 129 _("Invalid regular expression `%s'\n"), vs->show_value);
129 if (0 != regcomp (&r, vs->show_value, REG_EXTENDED | REG_ICASE | REG_NOSUB)) 130 i++;
130 { 131 continue;
131 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 132 }
132 _("Invalid regular expression `%s'\n"), 133 if (0 == regexec (&r, value, 0, NULL, 0))
133 vs->show_value); 134 gtk_widget_show (widget);
134 i++; 135 else
135 continue; 136 gtk_widget_hide (widget);
136 } 137 regfree (&r);
137 if (0 == regexec (&r, value, 0, NULL, 0)) 138 }
138 gtk_widget_show (widget); 139 if (NULL != vs->hide_value)
139 else 140 {
140 gtk_widget_hide (widget); 141 if (0 != regcomp (&r, vs->hide_value, REG_ICASE | REG_NOSUB))
141 regfree (&r); 142 {
142 } 143 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
143 if (NULL != vs->hide_value) 144 _("Invalid regular expression `%s'\n"), vs->show_value);
144 { 145 i++;
145 if (0 != regcomp (&r, vs->hide_value, REG_ICASE | REG_NOSUB)) 146 continue;
146 { 147 }
147 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 148 if (0 == regexec (&r, value, 0, NULL, 0))
148 _("Invalid regular expression `%s'\n"), 149 gtk_widget_hide (widget);
149 vs->show_value); 150 else
150 i++; 151 gtk_widget_show (widget);
151 continue; 152 regfree (&r);
152 }
153 if (0 == regexec (&r, value, 0, NULL, 0))
154 gtk_widget_hide (widget);
155 else
156 gtk_widget_show (widget);
157 regfree (&r);
158 }
159 i++;
160 } 153 }
154 i++;
155 }
161} 156}
162 157
163 158
164/** 159/**
165 * Function called whenever a widget changes its state. 160 * Function called whenever a widget changes its state.
@@ -173,24 +168,18 @@ widget_state_change_callback (const struct GNUNET_SETUP_OptionSpecification *os)
173 widget = GNUNET_SETUP_get_object (os->widget_name); 168 widget = GNUNET_SETUP_get_object (os->widget_name);
174 GNUNET_assert (NULL != os->save_function); 169 GNUNET_assert (NULL != os->save_function);
175 if (GNUNET_OK != 170 if (GNUNET_OK !=
176 os->save_function (os->load_save_cls, 171 os->save_function (os->load_save_cls, os->section, os->option, widget,
177 os->section, 172 cfg))
178 os->option, 173 {
179 widget, 174 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
180 cfg)) 175 _("Failed to obtain option value from widget `%s'\n"),
181 { 176 os->widget_name);
182 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 177 return;
183 _("Failed to obtain option value from widget `%s'\n"), 178 }
184 os->widget_name); 179 if ((os->section != NULL) && (os->option != NULL))
185 return;
186 }
187 if ( (os->section != NULL) &&
188 (os->option != NULL) )
189 GNUNET_assert (GNUNET_OK == 180 GNUNET_assert (GNUNET_OK ==
190 GNUNET_CONFIGURATION_get_value_string (cfg, 181 GNUNET_CONFIGURATION_get_value_string (cfg, os->section,
191 os->section, 182 os->option, &value));
192 os->option,
193 &value));
194 else 183 else
195 value = NULL; 184 value = NULL;
196 update_visibility (os, value); 185 update_visibility (os, value);
@@ -211,85 +200,71 @@ load_options ()
211 200
212 i = 0; 201 i = 0;
213 while (option_specifications[i].widget_name != NULL) 202 while (option_specifications[i].widget_name != NULL)
203 {
204 os = &option_specifications[i];
205 widget = GNUNET_SETUP_get_object (os->widget_name);
206 if (NULL == widget)
214 { 207 {
215 os = &option_specifications[i]; 208 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Widget `%s' not found\n"),
216 widget = GNUNET_SETUP_get_object (os->widget_name); 209 os->widget_name);
217 if (NULL == widget)
218 {
219 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
220 _("Widget `%s' not found\n"),
221 os->widget_name);
222 i++;
223 continue;
224 }
225 if (os->load_function != NULL)
226 {
227 if ( (NULL == os->section) ||
228 (NULL == os->option) )
229 {
230 if (GNUNET_OK !=
231 os->load_function (os->load_save_cls,
232 NULL, NULL, NULL,
233 widget,
234 cfg))
235 {
236 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
237 _("Failed to initialize widget `%s'\n"),
238 os->widget_name);
239 }
240 }
241 else
242 {
243 if (GNUNET_OK !=
244 GNUNET_CONFIGURATION_get_value_string (cfg,
245 os->section,
246 os->option,
247 &value))
248 {
249 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
250 _("No default value known for option `%s' in section `%s'\n"),
251 os->option,
252 os->section);
253 }
254 else
255 {
256 if (GNUNET_OK !=
257 os->load_function (os->load_save_cls,
258 os->section, os->option,
259 value,
260 widget,
261 cfg))
262 {
263 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
264 _("Failed to initialize widget `%s' with value `%s'\n"),
265 os->widget_name,
266 value);
267 }
268 else
269 {
270 update_visibility (os, value);
271 }
272 GNUNET_free (value);
273 }
274 }
275 }
276 if (os->help_text != NULL)
277 {
278 g_signal_connect (widget,
279 "button-press-event",
280 G_CALLBACK (&help_click_callback),
281 (void*) os);
282 }
283 if (os->change_signal != NULL)
284 {
285 GNUNET_assert (NULL != os->save_function);
286 g_signal_connect_swapped (widget,
287 os->change_signal,
288 G_CALLBACK (&widget_state_change_callback),
289 (void*) os);
290 }
291 i++; 210 i++;
211 continue;
292 } 212 }
213 if (os->load_function != NULL)
214 {
215 if ((NULL == os->section) || (NULL == os->option))
216 {
217 if (GNUNET_OK !=
218 os->load_function (os->load_save_cls, NULL, NULL, NULL, widget,
219 cfg))
220 {
221 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
222 _("Failed to initialize widget `%s'\n"), os->widget_name);
223 }
224 }
225 else
226 {
227 if (GNUNET_OK !=
228 GNUNET_CONFIGURATION_get_value_string (cfg, os->section, os->option,
229 &value))
230 {
231 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
232 _
233 ("No default value known for option `%s' in section `%s'\n"),
234 os->option, os->section);
235 }
236 else
237 {
238 if (GNUNET_OK !=
239 os->load_function (os->load_save_cls, os->section, os->option,
240 value, widget, cfg))
241 {
242 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
243 _("Failed to initialize widget `%s' with value `%s'\n"),
244 os->widget_name, value);
245 }
246 else
247 {
248 update_visibility (os, value);
249 }
250 GNUNET_free (value);
251 }
252 }
253 }
254 if (os->help_text != NULL)
255 {
256 g_signal_connect (widget, "button-press-event",
257 G_CALLBACK (&help_click_callback), (void *) os);
258 }
259 if (os->change_signal != NULL)
260 {
261 GNUNET_assert (NULL != os->save_function);
262 g_signal_connect_swapped (widget, os->change_signal,
263 G_CALLBACK (&widget_state_change_callback),
264 (void *) os);
265 }
266 i++;
267 }
293 268
294} 269}
295 270
@@ -297,29 +272,25 @@ load_options ()
297/** 272/**
298 * Callback invoked if the application is supposed to exit. 273 * Callback invoked if the application is supposed to exit.
299 */ 274 */
300void 275void
301GNUNET_SETUP_quit_cb (GtkObject *object, 276GNUNET_SETUP_quit_cb (GtkObject * object, gpointer user_data)
302 gpointer user_data)
303{ 277{
304 struct GNUNET_CONFIGURATION_Handle *cfgDefault; 278 struct GNUNET_CONFIGURATION_Handle *cfgDefault;
305 279
306 GNUNET_GTK_main_loop_quit (ml); 280 GNUNET_GTK_main_loop_quit (ml);
307 cfgDefault = GNUNET_CONFIGURATION_create (); 281 cfgDefault = GNUNET_CONFIGURATION_create ();
308 (void) GNUNET_CONFIGURATION_load (cfgDefault, NULL); /* load defaults only */ 282 (void) GNUNET_CONFIGURATION_load (cfgDefault, NULL); /* load defaults only */
309 if (GNUNET_OK != 283 if (GNUNET_OK != GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, cfgName))
310 GNUNET_CONFIGURATION_write_diffs (cfgDefault, 284 gret = 1;
311 cfg,
312 cfgName))
313 gret = 1;
314 GNUNET_CONFIGURATION_destroy (cfgDefault); 285 GNUNET_CONFIGURATION_destroy (cfgDefault);
315 GNUNET_CONFIGURATION_destroy (cfg); 286 GNUNET_CONFIGURATION_destroy (cfg);
316 cfg = NULL; 287 cfg = NULL;
317 if (NULL != resolver) 288 if (NULL != resolver)
318 { 289 {
319 GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM)); 290 GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM));
320 GNUNET_OS_process_close (resolver); 291 GNUNET_OS_process_close (resolver);
321 resolver = NULL; 292 resolver = NULL;
322 } 293 }
323} 294}
324 295
325 296
@@ -330,18 +301,17 @@ GNUNET_SETUP_quit_cb (GtkObject *object,
330 * @param tc scheduler context 301 * @param tc scheduler context
331 */ 302 */
332static void 303static void
333run (void *cls, 304run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
334 const struct GNUNET_SCHEDULER_TaskContext *tc)
335{ 305{
336 ml = cls; 306 ml = cls;
337 GtkWidget *main_window; 307 GtkWidget *main_window;
338 308
339 cfg = GNUNET_CONFIGURATION_create (); 309 cfg = GNUNET_CONFIGURATION_create ();
340 (void) GNUNET_CONFIGURATION_load (cfg, cfgName); 310 (void) GNUNET_CONFIGURATION_load (cfg, cfgName);
341 main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); 311 main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog"));
342 resolver = GNUNET_OS_start_process (NULL, NULL, 312 resolver =
343 "gnunet-service-resolver", 313 GNUNET_OS_start_process (NULL, NULL, "gnunet-service-resolver",
344 "gnunet-service-resolver", NULL); 314 "gnunet-service-resolver", NULL);
345 load_options (); 315 load_options ();
346 gtk_widget_show (main_window); 316 gtk_widget_show (main_window);
347 gtk_window_present (GTK_WINDOW (main_window)); 317 gtk_window_present (GTK_WINDOW (main_window));
@@ -356,8 +326,7 @@ run (void *cls,
356 * @return 0 on success 326 * @return 0 on success
357 */ 327 */
358int 328int
359main (int argc, 329main (int argc, char *const *argv)
360 char *const *argv)
361{ 330{
362 struct GNUNET_GETOPT_CommandLineOption options[] = { 331 struct GNUNET_GETOPT_CommandLineOption options[] = {
363 GNUNET_GETOPT_OPTION_CFG_FILE (&cfgName), 332 GNUNET_GETOPT_OPTION_CFG_FILE (&cfgName),
@@ -372,16 +341,12 @@ main (int argc,
372 loglev = GNUNET_strdup ("WARNING"); 341 loglev = GNUNET_strdup ("WARNING");
373 342
374 if (GNUNET_OK == 343 if (GNUNET_OK ==
375 GNUNET_GTK_main_loop_start ("gnunet-setup", 344 GNUNET_GTK_main_loop_start ("gnunet-setup", "guunet-setup", argc, argv,
376 "guunet-setup", 345 options, "gnunet_setup_gtk_main_window.glade",
377 argc, 346 &run))
378 argv,
379 options,
380 "gnunet_setup_gtk_main_window.glade",
381 &run))
382 ret = gret; 347 ret = gret;
383 else 348 else
384 ret = 1; 349 ret = 1;
385 GNUNET_free (cfgName); 350 GNUNET_free (cfgName);
386 GNUNET_free (loglev); 351 GNUNET_free (loglev);
387 return ret; 352 return ret;