gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r13819 - in gnunet-setup: contrib src


From: gnunet
Subject: [GNUnet-SVN] r13819 - in gnunet-setup: contrib src
Date: Mon, 29 Nov 2010 00:16:25 +0100

Author: grothoff
Date: 2010-11-29 00:16:25 +0100 (Mon, 29 Nov 2010)
New Revision: 13819

Added:
   gnunet-setup/src/gnunet-setup-transport-tcp.c
Modified:
   gnunet-setup/contrib/gnunet-setup.glade
   gnunet-setup/src/Makefile.am
   gnunet-setup/src/gnunet-setup-options.c
Log:
towards a more reasonable TCP configuration

Modified: gnunet-setup/contrib/gnunet-setup.glade
===================================================================
--- gnunet-setup/contrib/gnunet-setup.glade     2010-11-28 21:22:27 UTC (rev 
13818)
+++ gnunet-setup/contrib/gnunet-setup.glade     2010-11-28 23:16:25 UTC (rev 
13819)
@@ -2,6 +2,12 @@
 <interface>
   <requires lib="gtk+" version="2.20"/>
   <!-- interface-naming-policy project-wide -->
+  <object class="GtkListStore" id="GNUNET_setup_transport_tcp_my_ip_liststore">
+    <columns>
+      <!-- column-name ip -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datastore_quota_adjustment">
     <property name="lower">1000000</property>
     <property name="upper">999999999999</property>
@@ -43,7 +49,6 @@
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" 
id="GNUNET_setup_transport_tcp_port_adjustment">
-    <property name="lower">1</property>
     <property name="upper">65535</property>
     <property name="value">2086</property>
     <property name="step_increment">1</property>
@@ -69,7 +74,6 @@
     <property name="default_height">550</property>
     <property name="icon_name">preferences-system</property>
     <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
@@ -725,12 +729,12 @@
                       <object class="GtkVBox" 
id="GNUNET_setup_transport_tcp_vbox">
                         <property name="visible">True</property>
                         <child>
-                          <object class="GtkHBox" id="tcp_hbox">
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_port_hbox">
                             <property name="visible">True</property>
                             <child>
                               <object class="GtkLabel" 
id="GNUNET_setup_transport_tcp_port_label">
                                 <property name="visible">True</property>
-                                <property name="label" 
translatable="yes">Port:</property>
+                                <property name="label" translatable="yes">Bind 
to port:</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -752,14 +756,456 @@
                                 <property name="position">1</property>
                               </packing>
                             </child>
+                            <child>
+                              <object class="GtkLabel" 
id="GNUNET_setup_transport_tcp_port_detail_label">
+                                <property name="visible">True</property>
+                                <property name="label" translatable="yes">Use 
Port "0" to only allow outgoing TCP connections</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">10</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="padding">5</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_adv_port_hbox">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkLabel" 
id="GNUNET_setup_transport_tcp_adv_port_label">
+                                <property name="visible">True</property>
+                                <property name="label" 
translatable="yes">Advertised port:</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">5</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" 
id="GNUNET_setup_transport_tcp_adv_port_spinbutton">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property 
name="adjustment">GNUNET_setup_transport_tcp_adv_port_adjustment</property>
+                                <property name="numeric">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">5</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" 
id="GNUNET_setup_transport_tcp_adv_detail_label">
+                                <property name="visible">True</property>
+                                <property name="label" 
translatable="yes">External port visible on our public IP address after 
mappings by NAT/firewalls</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHSeparator" id="hseparator6">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="padding">5</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_autoconfig_hbox">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkLabel" id="label1">
+                                <property name="visible">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" 
id="GNUNET_setup_transport_tcp_autoconfig_button">
+                                <property name="label" 
translatable="yes">Attempt automatic configuration</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="receives_default">True</property>
+                                <property 
name="use_action_appearance">False</property>
+                                <signal name="activate" 
handler="GNUNET_setup_transport_tcp_autoconfig_button_activate_cb" 
swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">5</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label2">
+                                <property name="visible">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">5</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHSeparator" id="hseparator7">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="padding">5</property>
+                            <property name="position">4</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_nat_hbox">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkCheckButton" 
id="GNUNET_setup_transport_tcp_nat_checkbutton">
+                                <property name="label" translatable="yes">Peer 
is behind _NAT</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="receives_default">False</property>
+                                <property 
name="use_action_appearance">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">5</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">5</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_nat_options_hbox">
+                            <property name="visible">True</property>
+                            <property name="spacing">20</property>
+                            <child>
+                              <object class="GtkLabel" id="label6">
+                                <property name="visible">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkVBox" 
id="GNUNET_setup_transport_tcp_nat_options_vbox">
+                                <property name="visible">True</property>
+                                <child>
+                                  <object class="GtkCheckButton" 
id="GNUNET_setup_transport_tcp_hole_punched_checkbutton">
+                                    <property name="label" 
translatable="yes">NAT has been hole-punched manually</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property 
name="receives_default">False</property>
+                                    <property 
name="use_action_appearance">False</property>
+                                    <property 
name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" 
id="GNUNET_setup_transport_tcp_upnp_enable_checkbutton">
+                                    <property name="label" 
translatable="yes">Enable NAT traversal via UPnP or PMP</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property 
name="receives_default">False</property>
+                                    <property 
name="use_action_appearance">False</property>
+                                    <property 
name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" 
id="GNUNET_setup_transport_tcp_icmp_server_enable_checkbutton">
+                                    <property name="label" 
translatable="yes">Enable NAT traversal using ICMP method</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property 
name="receives_default">False</property>
+                                    <property 
name="use_action_appearance">False</property>
+                                    <property 
name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_external_ip_hbox">
+                                    <property name="visible">True</property>
+                                    <child>
+                                      <object class="GtkLabel" 
id="GNUNET_setup_transport_tcp_external_ip_label">
+                                        <property 
name="visible">True</property>
+                                        <property name="label" 
translatable="yes">External (public) IPv4 address:</property>
+                                      </object>
+                                      <packing>
+                                        <property 
name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="padding">5</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkEntry" 
id="GNUNET_setup_transport_tcp_external_ip_address_entry">
+                                        <property 
name="visible">True</property>
+                                        <property 
name="can_focus">True</property>
+                                        <property 
name="invisible_char">●</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="padding">5</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">3</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" 
id="GNUNET_setup_transport_tcp_icmp_client_enable_checkbutton">
+                                    <property name="label" 
translatable="yes">Enable connecting to NATed peers using ICMP method</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property 
name="receives_default">False</property>
+                                    <property 
name="use_action_appearance">False</property>
+                                    <property name="active">True</property>
+                                    <property 
name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">4</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkHBox" id="hbox23">
+                                    <property name="visible">True</property>
+                                    <child>
+                                      <object class="GtkLabel" 
id="GNUNET_setup_transport_tcp_internal_ip_label">
+                                        <property 
name="visible">True</property>
+                                        <property name="label" 
translatable="yes">Internal (private) IPv4 address:</property>
+                                      </object>
+                                      <packing>
+                                        <property 
name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="padding">5</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkComboBoxEntry" 
id="GNUNET_setup_transport_tcp_internal_ip_comboboxentry">
+                                        <property 
name="visible">True</property>
+                                        <property 
name="model">GNUNET_setup_transport_tcp_internal_ip_liststore</property>
+                                        <property 
name="text_column">0</property>
+                                        <signal name="changed" 
handler="GNUNET_setup_transport_tcp_internal_ip_comboboxentry_changed_cb" 
swapped="no"/>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="padding">5</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">5</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">5</property>
+                            <property name="position">6</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHSeparator" id="hseparator8">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="padding">5</property>
+                            <property name="position">7</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_ipv6_hbox">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkCheckButton" 
id="GNUNET_setup_transport_tcp_disable_ipv6_checkbutton">
+                                <property name="label" 
translatable="yes">Disable IPv_6 support</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="receives_default">False</property>
+                                <property 
name="use_action_appearance">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">5</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">8</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHSeparator" id="hseparator9">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="padding">5</property>
+                            <property name="position">9</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" 
id="GNUNET_setup_transport_tcp_test_hbox">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkLabel" id="label3">
+                                <property name="visible">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" 
id="GNUNET_setup_transport_tcp_test_button">
+                                <property name="label" translatable="yes">Test 
configuration</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="receives_default">True</property>
+                                <property 
name="use_action_appearance">False</property>
+                                <signal name="activate" 
handler="GNUNET_setup_transport_tcp_test_button_activate_cb" swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkImage" 
id="GNUNET_setup_transport_tcp_test_success_image">
+                                <property name="stock">gtk-ok</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkImage" 
id="GNUNET_setup_transport_tcp_test_fail_image">
+                                <property 
name="stock">gtk-dialog-error</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">3</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label5">
+                                <property name="visible">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">4</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">5</property>
+                            <property name="position">10</property>
+                          </packing>
+                        </child>
+                        <child>
                           <placeholder/>
                         </child>
                       </object>
@@ -1550,14 +1996,41 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkCheckButton" 
id="GNUNET_setup_fs_migration_checkbutton">
-                            <property name="label" translatable="yes">Enable 
content migration</property>
+                          <object class="GtkHBox" 
id="GNUNET_setup_fs_migration_hbox">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property 
name="use_action_appearance">False</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
+                            <child>
+                              <object class="GtkCheckButton" 
id="GNUNET_setup_fs_migration_from_checkbutton">
+                                <property name="label" 
translatable="yes">Enable unsolicited content transmission from this 
peer</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="receives_default">False</property>
+                                <property 
name="use_action_appearance">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">5</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" 
id="GNUNET_setup_fs_migration_to_checkbutton">
+                                <property name="label" 
translatable="yes">Enable caching content at this peer</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="receives_default">False</property>
+                                <property 
name="use_action_appearance">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -2279,4 +2752,17 @@
       <column type="gboolean"/>
     </columns>
   </object>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_tcp_adv_port_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">2086</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkListStore" 
id="GNUNET_setup_transport_tcp_internal_ip_liststore">
+    <columns>
+      <!-- column-name ip -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
 </interface>

Modified: gnunet-setup/src/Makefile.am
===================================================================
--- gnunet-setup/src/Makefile.am        2010-11-28 21:22:27 UTC (rev 13818)
+++ gnunet-setup/src/Makefile.am        2010-11-28 23:16:25 UTC (rev 13819)
@@ -11,6 +11,7 @@
   gnunet-setup.c gnunet-setup.h \
   gnunet-setup-options.c gnunet-setup-options.h \
   gnunet-setup-transport-plugins.c \
+  gnunet-setup-transport-tcp.c \
   gnunet-setup-datastore-plugins.c \
   gnunet-setup-datastore-config.c \
   gnunet-setup-datacache-plugins.c \

Modified: gnunet-setup/src/gnunet-setup-options.c
===================================================================
--- gnunet-setup/src/gnunet-setup-options.c     2010-11-28 21:22:27 UTC (rev 
13818)
+++ gnunet-setup/src/gnunet-setup-options.c     2010-11-28 23:16:25 UTC (rev 
13819)
@@ -226,6 +226,54 @@
 
 
 /**
+ * Initialize a GtkComboBox based on a text option.
+ *
+ * @param cls closure
+ * @param section section with the value
+ * @param option option name
+ * @param value value as a string
+ * @param widget widget to initialize
+ * @param cfg configuration handle
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
+ */
+static int
+load_combo_text (const void *cls,
+                const char *section,
+                const char *option,
+                const char *value,
+                GObject *widget,
+                const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  GNUNET_break (0);
+  return GNUNET_SYSERR;
+}
+
+
+/**
+ * Set text option based on a GtkComboBox.
+ *
+ * @param cls closure
+ * @param section section with the value
+ * @param option option name
+ * @param widget widget to initialize
+ * @param cfg configuration handle to update
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
+ */
+static int
+save_combo_text (const void *cls,
+                const char *section,
+                const char *option,
+                GObject *widget,
+                struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  GNUNET_break (0);
+  return GNUNET_SYSERR;
+}
+
+
+
+
+/**
  * Initialize a GtkSpinButton based on a numeric option.
  *
  * @param cls closure
@@ -704,6 +752,42 @@
 
 
 /**
+ * Hide most TCP options if port is zero.
+ */
+static struct GNUNET_SETUP_VisibilitySpecification hide_all_tcp_options[] =
+{
+  { "GNUNET_setup_transport_tcp_adv_port_hbox", NULL, "^0$" },
+  { "GNUNET_setup_transport_tcp_autoconfig_hbox", NULL, "^0$" },
+  { "GNUNET_setup_transport_tcp_nat_hbox", NULL, "^0$" },
+  { "GNUNET_setup_transport_tcp_nat_options_hbox", NULL, "^0$" },
+  { NULL, NULL, NULL }
+};
+
+
+/**
+ * Hide NATed peer options.
+ */
+static struct GNUNET_SETUP_VisibilitySpecification toggle_tcp_nat_options[] =
+{
+  { "GNUNET_setup_transport_tcp_hole_punched_checkbutton", "^YES$", NULL },
+  { "GNUNET_setup_transport_tcp_upnp_enable_checkbutton", "^YES$", NULL },
+  { "GNUNET_setup_transport_tcp_icmp_server_enable_checkbutton", "^YES$", NULL 
},
+  { "GNUNET_setup_transport_tcp_external_ip_hbox", "^YES$", NULL },
+  { NULL, NULL, NULL }
+};
+
+/**
+ * Hide hole-punched NATed peer options.
+ */
+static struct GNUNET_SETUP_VisibilitySpecification 
toggle_tcp_nat_punched_options[] =
+{
+  { "GNUNET_setup_transport_tcp_upnp_enable_checkbutton", "^NO$", NULL },
+  { "GNUNET_setup_transport_tcp_icmp_server_enable_checkbutton", "^NO$", NULL 
},
+  { NULL, NULL, NULL }
+};
+
+
+/**
  * Option specification data.
  */
 const struct GNUNET_SETUP_OptionSpecification option_specifications[] =
@@ -979,14 +1063,122 @@
       "value-changed",
       "transport-tcp",
       "PORT",
-      gettext_noop ("Port for inbound TCP connections, use 0 if behind NAT"),
+      gettext_noop ("Port we bind to for TCP"),
       "https://gnunet.org/configuration-tcp";,
       &load_number,
       &save_number, NULL,
+      hide_all_tcp_options
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_adv_port_spinbutton",
+      "value-changed",
+      "transport-tcp",
+      "ADVERTISED_PORT",
+      gettext_noop ("Port visible to other peers"),
+      "https://gnunet.org/configuration-tcp";,
+      &load_number,
+      &save_number, NULL,
       NULL
     },
 
     {
+      "GNUNET_setup_transport_tcp_nat_checkbutton",
+      "toggled",
+      "transport-tcp",
+      "BEHIND_NAT",
+      gettext_noop ("Check if this peer is behind a NAT"),
+      "https://gnunet.org/configuration-nat";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      toggle_tcp_nat_options
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_hole_punched_checkbutton",
+      "toggled",
+      "transport-tcp",
+      "PUNCHED_NAT",
+      gettext_noop ("Check if the NAT has been hole-punched manually"),
+      "https://gnunet.org/configuration-nat";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      toggle_tcp_nat_punched_options
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_upnp_enable_checkbutton",
+      "toggled",
+      "transport-tcp",
+      "ENABLE_UPNP",
+      gettext_noop ("Enable NAT traversal with UPnP/PMP"),
+      "https://gnunet.org/configuration-nat";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      NULL,
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_icmp_server_enable_checkbutton",
+      "toggled",
+      "transport-tcp",
+      "ENABLE_ICMP_SERVER",
+      gettext_noop ("Enable NAT traversal with ICMP as server"),
+      "https://gnunet.org/configuration-nat";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      NULL,
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_external_ip_address_entry",
+      "changed",
+      "transport-tcp",
+      "EXTERNAL_ADDRESS",
+      gettext_noop ("External (public) IP address of the NAT"),
+      "https://gnunet.org/configuration-nat";,
+      &load_text,
+      &save_text, NULL,
+      NULL
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_icmp_client_enable_checkbutton",
+      "toggled",
+      "transport-tcp",
+      "ENABLE_ICMP_CLIENT",
+      gettext_noop ("Enable NAT traversal with ICMP as client"),
+      "https://gnunet.org/configuration-nat";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      NULL,
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_internal_ip_comboboxentry",
+      "changed",
+      "transport-tcp",
+      "EXTERNAL_ADDRESS",
+      gettext_noop ("External (public) IP address of the NAT"),
+      "https://gnunet.org/configuration-nat";,
+      &load_combo_text,
+      &save_combo_text, NULL,
+      NULL
+    },
+
+    {
+      "GNUNET_setup_transport_tcp_disable_ipv6_checkbutton",
+      "toggled",
+      "transport-tcp",
+      "DISABLEV6",
+      gettext_noop ("Disable IPv6 support"),
+      "https://gnunet.org/configuration-ipv6";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      NULL,
+    },
+
+    {
       "GNUNET_setup_transport_udp_port_spinbutton",
       "value-changed",
       "transport-udp",
@@ -1146,16 +1338,28 @@
 
     
     { 
-      "GNUNET_setup_fs_migration_checkbutton",
+      "GNUNET_setup_fs_migration_from_checkbutton",
       "toggled",
       "fs",
-      "ACTIVEMIGRATION",
-      gettext_noop ("Is content migration allowed?"),
+      "CONTENT_PUSHING",
+      gettext_noop ("Should we try to push our content to other peers?"),
       "https://gnunet.org/configuration-fs";,
       &load_yes_no,
       &save_yes_no, NULL,
       NULL
     },    
+
+    { 
+      "GNUNET_setup_fs_migration_to_checkbutton",
+      "toggled",
+      "fs",
+      "CONTENT_CACHING",
+      gettext_noop ("Are we allowed to cache content received from other 
peers?"),
+      "https://gnunet.org/configuration-fs";,
+      &load_yes_no,
+      &save_yes_no, NULL,
+      NULL
+    },    
     
     {
       "GNUNET_setup_fs_datacache_sqlite_radiobutton",

Added: gnunet-setup/src/gnunet-setup-transport-tcp.c
===================================================================
--- gnunet-setup/src/gnunet-setup-transport-tcp.c                               
(rev 0)
+++ gnunet-setup/src/gnunet-setup-transport-tcp.c       2010-11-28 23:16:25 UTC 
(rev 13819)
@@ -0,0 +1,74 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/gnunet-setup-transport-tcp.c
+ * @brief support for TCP configuration
+ * @author Christian Grothoff
+ */
+#include "gnunet-setup.h"
+#include <gnunet/gnunet_datacache_plugin.h>
+
+
+static void
+show (const char *name)
+{
+  gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (builder, 
+                                                      name)));
+}
+
+
+static void
+hide (const char *name)
+{
+  gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, 
+                                                      name)));
+}
+
+void
+XXX_checkbutton_toggled_cb (GtkToggleButton *button,
+                           gpointer user_data)
+{
+  if (TRUE ==
+      gtk_toggle_button_get_active (button))
+    {
+      show ("GNUNET_setup_transport_tcp_upnp_checkbutton");
+    }
+  else
+    {
+      hide ("GNUNET_setup_transport_tcp_upnp_checkbutton");
+    }
+}
+
+void
+GNUNET_setup_transport_tcp_autoconfig_button_activate_cb ()
+{
+  GNUNET_break (0);
+}
+
+void
+GNUNET_setup_transport_tcp_test_button_activate_cb ()
+{
+  GNUNET_break (0);
+}
+
+
+/* end of gnunet-setup-transport-tcp.c */
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]