aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-09 09:20:32 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-09 09:20:32 +0100
commit1457d002e1d256eee8dd086caf9a0454564ba91b (patch)
tree325f92da8a7cf2680b88a4f12c646b9276ccc781
parente027b29ed6ce6eb04896605ccd727d4610986d67 (diff)
downloadgnunet-gtk-1457d002e1d256eee8dd086caf9a0454564ba91b.tar.gz
gnunet-gtk-1457d002e1d256eee8dd086caf9a0454564ba91b.zip
removing obsoleted NAT configuration options from gnunet-setup
-rw-r--r--.gitignore37
-rw-r--r--contrib/gnunet_setup_main_window.glade385
-rw-r--r--doc/gnunet-setup.13
-rw-r--r--src/setup/Makefile.am1
-rw-r--r--src/setup/gnunet-setup-options.c108
-rw-r--r--src/setup/gnunet-setup-transport.c604
-rw-r--r--src/setup/gnunet-setup-transport.h58
-rw-r--r--src/setup/gnunet-setup.c28
8 files changed, 83 insertions, 1141 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..8f88dddb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,37 @@
1*~
2*.a
3*.la
4*.lo
5*.log
6*.o
7*.orig
8*.rej
9*.swp
10*.trs
11.deps/
12.libs/
13.svn/
14Makefile
15Makefile.in
16aclocal.m4
17autom4te.cache/
18compile
19config.guess
20config.log
21config.status
22config.sub
23configure
24depcomp
25gnunet_config.h
26gnunet_config.h.in
27install-sh
28libtool
29ltmain.sh
30lynXified.*
31missing
32po/*.gmo
33pkgconfig/*.pc
34src/*/*.conf
35stamp-h1
36test-driver
37INSTALL
diff --git a/contrib/gnunet_setup_main_window.glade b/contrib/gnunet_setup_main_window.glade
index aad7f7ac..f5cf9967 100644
--- a/contrib/gnunet_setup_main_window.glade
+++ b/contrib/gnunet_setup_main_window.glade
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Generated with glade 3.16.1 --> 2<!-- Generated with glade 3.18.3 -->
3<interface> 3<interface>
4 <requires lib="gtk+" version="3.4"/> 4 <requires lib="gtk+" version="3.4"/>
5 <object class="GtkAdjustment" id="GNUNET_setup_bandwidth_in_adjustment"> 5 <object class="GtkAdjustment" id="GNUNET_setup_bandwidth_in_adjustment">
@@ -1289,358 +1289,66 @@
1289 <property name="can_focus">False</property> 1289 <property name="can_focus">False</property>
1290 <property name="left_padding">12</property> 1290 <property name="left_padding">12</property>
1291 <child> 1291 <child>
1292 <object class="GtkBox" id="GNUNET_setup_bandwidth_vbox"> 1292 <object class="GtkGrid" id="GNUNET_setup_bandwidth_grid">
1293 <property name="visible">True</property> 1293 <property name="visible">True</property>
1294 <property name="can_focus">False</property> 1294 <property name="can_focus">False</property>
1295 <property name="orientation">vertical</property> 1295 <property name="row_spacing">5</property>
1296 <property name="column_spacing">5</property>
1297 <property name="row_homogeneous">True</property>
1296 <child> 1298 <child>
1297 <object class="GtkBox" id="GNUNET_setup_bandwidth_hbox"> 1299 <object class="GtkLabel" id="GNUNET_setup_bandwidth_in_label">
1298 <property name="visible">True</property> 1300 <property name="visible">True</property>
1299 <property name="can_focus">False</property> 1301 <property name="can_focus">False</property>
1300 <child> 1302 <property name="label" translatable="yes">Max. download bandwidth (B/s):</property>
1301 <object class="GtkLabel" id="GNUNET_setup_bandwidth_in_label">
1302 <property name="visible">True</property>
1303 <property name="can_focus">False</property>
1304 <property name="label" translatable="yes">Max. download bandwidth (B/s):</property>
1305 </object>
1306 <packing>
1307 <property name="expand">False</property>
1308 <property name="fill">False</property>
1309 <property name="padding">5</property>
1310 <property name="position">0</property>
1311 </packing>
1312 </child>
1313 <child>
1314 <object class="GtkSpinButton" id="GNUNET_setup_bandwidth_in_spinbutton">
1315 <property name="visible">True</property>
1316 <property name="can_focus">True</property>
1317 <property name="invisible_char">•</property>
1318 <property name="primary_icon_activatable">False</property>
1319 <property name="secondary_icon_activatable">False</property>
1320 <property name="adjustment">GNUNET_setup_bandwidth_in_adjustment</property>
1321 <property name="numeric">True</property>
1322 </object>
1323 <packing>
1324 <property name="expand">False</property>
1325 <property name="fill">False</property>
1326 <property name="position">1</property>
1327 </packing>
1328 </child>
1329 <child>
1330 <object class="GtkLabel" id="GNUNET_setup_bandwidth_out_label">
1331 <property name="visible">True</property>
1332 <property name="can_focus">False</property>
1333 <property name="label" translatable="yes">Max. upload bandwidth (B/s)</property>
1334 </object>
1335 <packing>
1336 <property name="expand">True</property>
1337 <property name="fill">True</property>
1338 <property name="position">2</property>
1339 </packing>
1340 </child>
1341 <child>
1342 <object class="GtkSpinButton" id="GNUNET_setup_bandwidth_out_spinbutton">
1343 <property name="visible">True</property>
1344 <property name="can_focus">True</property>
1345 <property name="invisible_char">•</property>
1346 <property name="primary_icon_activatable">False</property>
1347 <property name="secondary_icon_activatable">False</property>
1348 <property name="adjustment">GNUNET_setup_bandwidth_out_adjustment</property>
1349 <property name="numeric">True</property>
1350 </object>
1351 <packing>
1352 <property name="expand">True</property>
1353 <property name="fill">True</property>
1354 <property name="position">3</property>
1355 </packing>
1356 </child>
1357 </object> 1303 </object>
1358 <packing> 1304 <packing>
1359 <property name="expand">False</property> 1305 <property name="left_attach">0</property>
1360 <property name="fill">False</property> 1306 <property name="top_attach">0</property>
1361 <property name="position">0</property>
1362 </packing> 1307 </packing>
1363 </child> 1308 </child>
1364 </object>
1365 </child>
1366 </object>
1367 </child>
1368 <child type="label">
1369 <object class="GtkLabel" id="GNUNET_setup_bandwidth_label">
1370 <property name="visible">True</property>
1371 <property name="can_focus">False</property>
1372 <property name="label" translatable="yes">&lt;b&gt;Bandwidth Configuration&lt;/b&gt;</property>
1373 <property name="use_markup">True</property>
1374 </object>
1375 </child>
1376 </object>
1377 <packing>
1378 <property name="expand">False</property>
1379 <property name="fill">False</property>
1380 <property name="position">0</property>
1381 </packing>
1382 </child>
1383 <child>
1384 <object class="GtkFrame" id="GNUNET_setup_transport_nat_frame">
1385 <property name="visible">True</property>
1386 <property name="can_focus">False</property>
1387 <property name="label_xalign">0</property>
1388 <property name="shadow_type">none</property>
1389 <child>
1390 <object class="GtkAlignment" id="GNUNET_setup_transport_nat_alignment">
1391 <property name="visible">True</property>
1392 <property name="can_focus">False</property>
1393 <property name="left_padding">12</property>
1394 <child>
1395 <object class="GtkBox" id="GNUNET_setup_transport_nat_vbox">
1396 <property name="visible">True</property>
1397 <property name="can_focus">False</property>
1398 <property name="orientation">vertical</property>
1399 <child> 1309 <child>
1400 <object class="GtkBox" id="GNUNET_setup_transport_nat_hbox"> 1310 <object class="GtkLabel" id="GNUNET_setup_bandwidth_out_label">
1401 <property name="visible">True</property> 1311 <property name="visible">True</property>
1402 <property name="can_focus">False</property> 1312 <property name="can_focus">False</property>
1403 <child> 1313 <property name="label" translatable="yes">Max. upload bandwidth (B/s):</property>
1404 <object class="GtkCheckButton" id="GNUNET_setup_transport_nat_checkbutton">
1405 <property name="label" translatable="yes">Peer is behind _NAT</property>
1406 <property name="visible">True</property>
1407 <property name="can_focus">True</property>
1408 <property name="receives_default">False</property>
1409 <property name="tooltip_text" translatable="yes">Check this box if your machine is behind a NAT box (router that performs network address translation). Leave off if your machine has a globally unique IPv4 address. NAT options only impact IPv4 addresses at this time.</property>
1410 <property name="use_underline">True</property>
1411 <property name="xalign">0</property>
1412 <property name="draw_indicator">True</property>
1413 </object>
1414 <packing>
1415 <property name="expand">False</property>
1416 <property name="fill">False</property>
1417 <property name="padding">5</property>
1418 <property name="position">0</property>
1419 </packing>
1420 </child>
1421 <child>
1422 <object class="GtkButton" id="GNUNET_setup_transport_autoconfig_button">
1423 <property name="label" translatable="yes">Attempt automatic configuration</property>
1424 <property name="visible">True</property>
1425 <property name="can_focus">True</property>
1426 <property name="receives_default">True</property>
1427 <signal name="clicked" handler="GNUNET_setup_transport_autoconfig_button_clicked_cb" swapped="no"/>
1428 </object>
1429 <packing>
1430 <property name="expand">False</property>
1431 <property name="fill">False</property>
1432 <property name="padding">5</property>
1433 <property name="position">1</property>
1434 </packing>
1435 </child>
1436 <child>
1437 <object class="GtkCheckButton" id="GNUNET_setup_transport_disable_ipv6_checkbutton">
1438 <property name="label" translatable="yes">Disable IPv_6 support</property>
1439 <property name="visible">True</property>
1440 <property name="can_focus">True</property>
1441 <property name="receives_default">False</property>
1442 <property name="tooltip_text" translatable="yes">Disable advertising IPv6 addresses. Check this box if you know that your system has no IPv6 Internet connectivity.</property>
1443 <property name="use_underline">True</property>
1444 <property name="xalign">0</property>
1445 <property name="draw_indicator">True</property>
1446 </object>
1447 <packing>
1448 <property name="expand">False</property>
1449 <property name="fill">False</property>
1450 <property name="padding">5</property>
1451 <property name="position">2</property>
1452 </packing>
1453 </child>
1454 </object> 1314 </object>
1455 <packing> 1315 <packing>
1456 <property name="expand">False</property> 1316 <property name="left_attach">0</property>
1457 <property name="fill">False</property> 1317 <property name="top_attach">1</property>
1458 <property name="padding">5</property>
1459 <property name="position">0</property>
1460 </packing> 1318 </packing>
1461 </child> 1319 </child>
1462 <child> 1320 <child>
1463 <object class="GtkBox" id="GNUNET_setup_transport_nat_options_hbox"> 1321 <object class="GtkSpinButton" id="GNUNET_setup_bandwidth_in_spinbutton">
1464 <property name="visible">True</property> 1322 <property name="visible">True</property>
1465 <property name="can_focus">False</property> 1323 <property name="can_focus">True</property>
1466 <property name="spacing">20</property> 1324 <property name="invisible_char">•</property>
1467 <child> 1325 <property name="text" translatable="yes">65536</property>
1468 <object class="GtkLabel" id="GNUNET_setup_transport_nat_options_spacer_label"> 1326 <property name="primary_icon_activatable">False</property>
1469 <property name="visible">True</property> 1327 <property name="secondary_icon_activatable">False</property>
1470 <property name="can_focus">False</property> 1328 <property name="adjustment">GNUNET_setup_bandwidth_in_adjustment</property>
1471 </object> 1329 <property name="numeric">True</property>
1472 <packing> 1330 <property name="value">65536</property>
1473 <property name="expand">False</property>
1474 <property name="fill">False</property>
1475 <property name="padding">5</property>
1476 <property name="position">0</property>
1477 </packing>
1478 </child>
1479 <child>
1480 <object class="GtkBox" id="GNUNET_setup_transport_nat_options_vbox">
1481 <property name="visible">True</property>
1482 <property name="can_focus">False</property>
1483 <property name="orientation">vertical</property>
1484 <child>
1485 <object class="GtkCheckButton" id="GNUNET_setup_transport_hole_punched_checkbutton">
1486 <property name="label" translatable="yes">NAT ports have been opened manually</property>
1487 <property name="visible">True</property>
1488 <property name="can_focus">True</property>
1489 <property name="receives_default">False</property>
1490 <property name="tooltip_text" translatable="yes">Set this option if you have configured your NAT to forward the ports for the various enabled GNUnet transports. If the external ports are different, the respective values of the external port should be specified under "advertised port" for the respective transport. You also need to specify the "External (public) IPv4 address" of your NAT box below.</property>
1491 <property name="xalign">0</property>
1492 <property name="draw_indicator">True</property>
1493 </object>
1494 <packing>
1495 <property name="expand">False</property>
1496 <property name="fill">True</property>
1497 <property name="position">0</property>
1498 </packing>
1499 </child>
1500 <child>
1501 <object class="GtkCheckButton" id="GNUNET_setup_transport_upnp_enable_checkbutton">
1502 <property name="label" translatable="yes">Enable NAT traversal via UPnP or PMP</property>
1503 <property name="visible">True</property>
1504 <property name="can_focus">True</property>
1505 <property name="receives_default">False</property>
1506 <property name="tooltip_text" translatable="yes">This option enables the use of upnpc from miniupnpd for NAT traversal</property>
1507 <property name="xalign">0</property>
1508 <property name="draw_indicator">True</property>
1509 </object>
1510 <packing>
1511 <property name="expand">False</property>
1512 <property name="fill">False</property>
1513 <property name="position">1</property>
1514 </packing>
1515 </child>
1516 <child>
1517 <object class="GtkCheckButton" id="GNUNET_setup_transport_icmp_server_enable_checkbutton">
1518 <property name="label" translatable="yes">Enable NAT traversal using ICMP method</property>
1519 <property name="visible">True</property>
1520 <property name="can_focus">True</property>
1521 <property name="receives_default">False</property>
1522 <property name="tooltip_text" translatable="yes">This option enables the use of the "Autonomous NAT Traversal" method (presented at P2P 2010). It requires gnunet-helper-nat-server to be installed SUID on the local system.</property>
1523 <property name="xalign">0</property>
1524 <property name="draw_indicator">True</property>
1525 </object>
1526 <packing>
1527 <property name="expand">False</property>
1528 <property name="fill">False</property>
1529 <property name="position">2</property>
1530 </packing>
1531 </child>
1532 <child>
1533 <object class="GtkBox" id="GNUNET_setup_transport_external_ip_hbox">
1534 <property name="visible">True</property>
1535 <property name="can_focus">False</property>
1536 <child>
1537 <object class="GtkLabel" id="GNUNET_setup_transport_external_ip_label">
1538 <property name="visible">True</property>
1539 <property name="can_focus">False</property>
1540 <property name="tooltip_text" translatable="yes">Globally visible IP address of your system (IP address of the external interface of your NAT). You can also specify a hostname, in which case GNUnet will periodically look up the hostname in DNS to determine our external IP address (DynDNS setup).</property>
1541 <property name="label" translatable="yes">External (public) IPv4 address:</property>
1542 </object>
1543 <packing>
1544 <property name="expand">False</property>
1545 <property name="fill">False</property>
1546 <property name="padding">5</property>
1547 <property name="position">0</property>
1548 </packing>
1549 </child>
1550 <child>
1551 <object class="GtkEntry" id="GNUNET_setup_transport_external_ip_address_entry">
1552 <property name="visible">True</property>
1553 <property name="can_focus">True</property>
1554 <property name="max_length">255</property>
1555 <property name="invisible_char">●</property>
1556 <property name="primary_icon_activatable">False</property>
1557 <property name="secondary_icon_activatable">False</property>
1558 </object>
1559 <packing>
1560 <property name="expand">True</property>
1561 <property name="fill">True</property>
1562 <property name="padding">5</property>
1563 <property name="position">1</property>
1564 </packing>
1565 </child>
1566 </object>
1567 <packing>
1568 <property name="expand">False</property>
1569 <property name="fill">False</property>
1570 <property name="position">3</property>
1571 </packing>
1572 </child>
1573 <child>
1574 <object class="GtkCheckButton" id="GNUNET_setup_transport_icmp_client_enable_checkbutton">
1575 <property name="label" translatable="yes">Enable connecting to NATed peers using ICMP method</property>
1576 <property name="visible">True</property>
1577 <property name="can_focus">True</property>
1578 <property name="receives_default">False</property>
1579 <property name="tooltip_text" translatable="yes">This method allows this peer to initiate connections to NATed peers using the 'Autonomous NAT traversal' method (presented at P2P 2010). It requires having gnunet-helper-nat-client installed SUID on the local system.</property>
1580 <property name="xalign">0</property>
1581 <property name="active">True</property>
1582 <property name="draw_indicator">True</property>
1583 </object>
1584 <packing>
1585 <property name="expand">False</property>
1586 <property name="fill">False</property>
1587 <property name="position">4</property>
1588 </packing>
1589 </child>
1590 <child>
1591 <object class="GtkBox" id="GNUNET_setup_transport_internal_ip_hbox">
1592 <property name="visible">True</property>
1593 <property name="can_focus">False</property>
1594 <child>
1595 <object class="GtkLabel" id="GNUNET_setup_transport_internal_ip_label">
1596 <property name="visible">True</property>
1597 <property name="can_focus">False</property>
1598 <property name="tooltip_text" translatable="yes">Specify the IPv4 address of your computers main network interface (typically eth0 or wlan0).</property>
1599 <property name="label" translatable="yes">Internal (private) IPv4 address:</property>
1600 </object>
1601 <packing>
1602 <property name="expand">False</property>
1603 <property name="fill">False</property>
1604 <property name="padding">5</property>
1605 <property name="position">0</property>
1606 </packing>
1607 </child>
1608 <child>
1609 <object class="GtkEntry" id="GNUNET_setup_transport_internal_ip_entry">
1610 <property name="visible">True</property>
1611 <property name="can_focus">True</property>
1612 <property name="max_length">15</property>
1613 <property name="invisible_char">●</property>
1614 <property name="width_chars">15</property>
1615 <property name="primary_icon_activatable">False</property>
1616 <property name="secondary_icon_activatable">False</property>
1617 </object>
1618 <packing>
1619 <property name="expand">True</property>
1620 <property name="fill">True</property>
1621 <property name="position">1</property>
1622 </packing>
1623 </child>
1624 </object>
1625 <packing>
1626 <property name="expand">True</property>
1627 <property name="fill">True</property>
1628 <property name="position">5</property>
1629 </packing>
1630 </child>
1631 </object>
1632 <packing>
1633 <property name="expand">True</property>
1634 <property name="fill">True</property>
1635 <property name="position">1</property>
1636 </packing>
1637 </child>
1638 </object> 1331 </object>
1639 <packing> 1332 <packing>
1640 <property name="expand">False</property> 1333 <property name="left_attach">1</property>
1641 <property name="fill">False</property> 1334 <property name="top_attach">0</property>
1642 <property name="padding">5</property> 1335 </packing>
1643 <property name="position">1</property> 1336 </child>
1337 <child>
1338 <object class="GtkSpinButton" id="GNUNET_setup_bandwidth_out_spinbutton">
1339 <property name="visible">True</property>
1340 <property name="can_focus">True</property>
1341 <property name="invisible_char">•</property>
1342 <property name="text" translatable="yes">65536</property>
1343 <property name="primary_icon_activatable">False</property>
1344 <property name="secondary_icon_activatable">False</property>
1345 <property name="adjustment">GNUNET_setup_bandwidth_out_adjustment</property>
1346 <property name="numeric">True</property>
1347 <property name="value">65536</property>
1348 </object>
1349 <packing>
1350 <property name="left_attach">1</property>
1351 <property name="top_attach">1</property>
1644 </packing> 1352 </packing>
1645 </child> 1353 </child>
1646 </object> 1354 </object>
@@ -1648,19 +1356,18 @@
1648 </object> 1356 </object>
1649 </child> 1357 </child>
1650 <child type="label"> 1358 <child type="label">
1651 <object class="GtkLabel" id="GNUNET_setup_transport_nat_label"> 1359 <object class="GtkLabel" id="GNUNET_setup_bandwidth_label">
1652 <property name="visible">True</property> 1360 <property name="visible">True</property>
1653 <property name="can_focus">False</property> 1361 <property name="can_focus">False</property>
1654 <property name="label" translatable="yes">&lt;b&gt;NAT Traversal Configuration&lt;/b&gt;</property> 1362 <property name="label" translatable="yes">&lt;b&gt;Bandwidth Configuration&lt;/b&gt;</property>
1655 <property name="use_markup">True</property> 1363 <property name="use_markup">True</property>
1656 </object> 1364 </object>
1657 </child> 1365 </child>
1658 </object> 1366 </object>
1659 <packing> 1367 <packing>
1660 <property name="expand">True</property> 1368 <property name="expand">False</property>
1661 <property name="fill">True</property> 1369 <property name="fill">False</property>
1662 <property name="padding">5</property> 1370 <property name="position">0</property>
1663 <property name="position">1</property>
1664 </packing> 1371 </packing>
1665 </child> 1372 </child>
1666 </object> 1373 </object>
diff --git a/doc/gnunet-setup.1 b/doc/gnunet-setup.1
index 7f6a37c8..47ac94d3 100644
--- a/doc/gnunet-setup.1
+++ b/doc/gnunet-setup.1
@@ -13,9 +13,6 @@ The first time you run gnunet\-setup, the goal will typically be to configure th
13It is recommended that "/etc/gnunet.conf" should be a world\-readable copy of the peer's GNUnet configuration. Note that GNUnet configuration files (as generated by gnunet\-setup) only contain those values that differ from the defaults. Also note that "gnunet\-arm" will by default look for a configuration in "$HOME/.config/gnunet.conf" (or, "$XDG_CONFIG_DIR/gnunet.conf" if "$XDG_CONFIG_DIR" is set); thus, if your configuration is in "/etc/gnunet.conf", you have to pass "\-c /etc/gnunet.conf" to gnunet\-arm or set "$XDG_CONFIG_DIR" to "/etc/". 13It is recommended that "/etc/gnunet.conf" should be a world\-readable copy of the peer's GNUnet configuration. Note that GNUnet configuration files (as generated by gnunet\-setup) only contain those values that differ from the defaults. Also note that "gnunet\-arm" will by default look for a configuration in "$HOME/.config/gnunet.conf" (or, "$XDG_CONFIG_DIR/gnunet.conf" if "$XDG_CONFIG_DIR" is set); thus, if your configuration is in "/etc/gnunet.conf", you have to pass "\-c /etc/gnunet.conf" to gnunet\-arm or set "$XDG_CONFIG_DIR" to "/etc/".
14 14
15.TP 15.TP
16\fB\-a\fR, \fB\-\-autoconfig\fR
17try to automatically configure networking for the peer without starting the interactive GUI
18.TP
19\fB\-c \fIFILENAME\fR, \fB\-\-config=FILENAME\fR 16\fB\-c \fIFILENAME\fR, \fB\-\-config=FILENAME\fR
20load config file (default: ~/.config/gnunet.conf) 17load config file (default: ~/.config/gnunet.conf)
21.TP 18.TP
diff --git a/src/setup/Makefile.am b/src/setup/Makefile.am
index dc0c04a0..b06071d5 100644
--- a/src/setup/Makefile.am
+++ b/src/setup/Makefile.am
@@ -20,7 +20,6 @@ gnunet_setup_SOURCES = \
20 gnunet-setup-transport-https.c \ 20 gnunet-setup-transport-https.c \
21 gnunet-setup-transport-tcp.c \ 21 gnunet-setup-transport-tcp.c \
22 gnunet-setup-transport-udp.c \ 22 gnunet-setup-transport-udp.c \
23 gnunet-setup-transport.c gnunet-setup-transport.h \
24 gnunet-setup-datastore-plugins.c \ 23 gnunet-setup-datastore-plugins.c \
25 gnunet-setup-datastore-config.c \ 24 gnunet-setup-datastore-config.c \
26 gnunet-setup-datacache-plugins.c \ 25 gnunet-setup-datacache-plugins.c \
diff --git a/src/setup/gnunet-setup-options.c b/src/setup/gnunet-setup-options.c
index 34ae07a0..d6ab22c4 100644
--- a/src/setup/gnunet-setup-options.c
+++ b/src/setup/gnunet-setup-options.c
@@ -1271,28 +1271,6 @@ static struct GNUNET_SETUP_VisibilitySpecification hide_all_tcp_options[] = {
1271 1271
1272 1272
1273/** 1273/**
1274 * Hide NATed peer options.
1275 */
1276static struct GNUNET_SETUP_VisibilitySpecification toggle_nat_options[] = {
1277 {"GNUNET_setup_transport_hole_punched_checkbutton", "^YES$", NULL},
1278 {"GNUNET_setup_transport_upnp_enable_checkbutton", "^YES$", NULL},
1279 {"GNUNET_setup_transport_icmp_server_enable_checkbutton", "^YES$", NULL},
1280 {"GNUNET_setup_transport_external_ip_hbox", "^YES$", NULL},
1281 {NULL, NULL, NULL}
1282};
1283
1284/**
1285 * Hide hole-punched NATed peer options.
1286 */
1287static struct GNUNET_SETUP_VisibilitySpecification toggle_nat_punched_options[]
1288 = {
1289 {"GNUNET_setup_transport_upnp_enable_checkbutton", "^NO$", NULL},
1290 {"GNUNET_setup_transport_icmp_server_enable_checkbutton", "^NO$", NULL},
1291 {NULL, NULL, NULL}
1292};
1293
1294
1295/**
1296 * Hide internal IP options. 1274 * Hide internal IP options.
1297 */ 1275 */
1298static struct GNUNET_SETUP_VisibilitySpecification toggle_internal_ip[] = { 1276static struct GNUNET_SETUP_VisibilitySpecification toggle_internal_ip[] = {
@@ -1746,92 +1724,6 @@ const struct GNUNET_SETUP_OptionSpecification option_specifications[] = {
1746 NULL }, 1724 NULL },
1747 1725
1748 { 1726 {
1749 "GNUNET_setup_transport_nat_checkbutton",
1750 "toggled",
1751 "nat",
1752 "BEHIND_NAT",
1753 gettext_noop ("Check if this peer is behind a NAT"),
1754 "https://gnunet.org/configuration-nat",
1755 &load_yes_no,
1756 &save_yes_no, NULL,
1757 NULL, NULL,
1758 toggle_nat_options},
1759
1760 {
1761 "GNUNET_setup_transport_hole_punched_checkbutton",
1762 "toggled",
1763 "nat",
1764 "PUNCHED_NAT",
1765 gettext_noop ("Check if the NAT has been configured manually to forward ports"),
1766 "https://gnunet.org/configuration-nat",
1767 &load_yes_no,
1768 &save_yes_no, NULL,
1769 NULL, NULL,
1770 toggle_nat_punched_options},
1771
1772 {
1773 "GNUNET_setup_transport_upnp_enable_checkbutton",
1774 "toggled",
1775 "nat",
1776 "ENABLE_UPNP",
1777 gettext_noop ("Enable NAT traversal with UPnP/PMP"),
1778 "https://gnunet.org/configuration-nat",
1779 &load_yes_no,
1780 &save_yes_no, NULL,
1781 NULL, NULL,
1782 NULL,
1783 },
1784
1785 {
1786 "GNUNET_setup_transport_icmp_server_enable_checkbutton",
1787 "toggled",
1788 "nat",
1789 "ENABLE_ICMP_SERVER",
1790 gettext_noop ("Enable NAT traversal with ICMP as server"),
1791 "https://gnunet.org/configuration-nat",
1792 &load_yes_no,
1793 &save_yes_no, NULL,
1794 NULL, NULL,
1795 NULL,
1796 },
1797
1798 {
1799 "GNUNET_setup_transport_external_ip_address_entry",
1800 "changed",
1801 "nat",
1802 "EXTERNAL_ADDRESS",
1803 gettext_noop ("External (public) IP address of the NAT"),
1804 "https://gnunet.org/configuration-nat",
1805 &load_text,
1806 &save_text, NULL,
1807 NULL, NULL,
1808 NULL},
1809
1810 {
1811 "GNUNET_setup_transport_icmp_client_enable_checkbutton",
1812 "toggled",
1813 "nat",
1814 "ENABLE_ICMP_CLIENT",
1815 gettext_noop ("Enable NAT traversal with ICMP as client"),
1816 "https://gnunet.org/configuration-nat",
1817 &load_yes_no,
1818 &save_yes_no, NULL,
1819 NULL, NULL,
1820 toggle_internal_ip},
1821
1822 {
1823 "GNUNET_setup_transport_internal_ip_entry",
1824 "changed",
1825 "nat",
1826 "INTERNAL_ADDRESS",
1827 gettext_noop ("Internal (private) IP address of the NAT"),
1828 "https://gnunet.org/configuration-nat",
1829 &load_text,
1830 &save_text, NULL,
1831 NULL, NULL,
1832 NULL},
1833
1834 {
1835 "GNUNET_setup_transport_disable_ipv6_checkbutton", 1727 "GNUNET_setup_transport_disable_ipv6_checkbutton",
1836 "toggled", 1728 "toggled",
1837 "nat", 1729 "nat",
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c
deleted file mode 100644
index c242c50d..00000000
--- a/src/setup/gnunet-setup-transport.c
+++ /dev/null
@@ -1,604 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2010, 2012, 2013 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21/**
22 * @file src/setup/gnunet-setup-transport.c
23 * @brief support for transport (NAT) configuration
24 * @author Christian Grothoff
25 *
26 * TODO:
27 * - cummulate collected information in the context
28 * - implement and refine existing network setup tests
29 * - if NAT detected and all traversal methods fail and no IPv6,
30 * set transport plugin ports to 0
31 */
32#include "gnunet-setup.h"
33#include "gnunet-setup-transport.h"
34#include <gnunet/gnunet_util_lib.h>
35#include <gnunet/gnunet_resolver_service.h>
36#include <gnunet/gnunet_nat_lib.h>
37
38/**
39 * How long do we wait for the NAT test to report success?
40 */
41#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
42
43/**
44 * Phases of the auto configuration.
45 */
46enum AutoPhase
47{
48 /**
49 * Initial start value.
50 */
51 AUTO_INIT = 0,
52
53 /**
54 * Test if we are online.
55 */
56 AUTO_ONLINE = 1,
57
58 /**
59 * Test our external IP.
60 */
61 AUTO_EXTERNAL_IP,
62
63 /**
64 * Test our internal IP.
65 */
66 AUTO_LOCAL_IP,
67
68 /**
69 * Test if NAT was punched.
70 */
71 AUTO_NAT_PUNCHED,
72
73 /**
74 * Test if UPnP is working.
75 */
76 AUTO_UPNPC,
77
78 /**
79 * Test if ICMP server works.
80 */
81 AUTO_ICMP_SERVER,
82
83 /**
84 * Test if ICMP client works.
85 */
86 AUTO_ICMP_CLIENT,
87
88 /**
89 * Last phase, we're done.
90 */
91 AUTO_DONE
92
93};
94
95
96/**
97 * Context for the autoconfig test.
98 */
99struct GNUNET_SetupAutoContext
100{
101
102 /**
103 * Handle to the active NAT test.
104 */
105 struct GNUNET_NAT_Test *tst;
106
107 /**
108 * Function to call when done.
109 */
110 GNUNET_SetupAutoConfigFinished fin_cb;
111
112 /**
113 * Closure for 'fin_cb'.
114 */
115 void *fin_cb_cls;
116
117 /**
118 * Handle for active 'GNUNET_NAT_mini_get_external_ipv4'-operation.
119 */
120 struct GNUNET_NAT_ExternalHandle *eh;
121
122 /**
123 * Task identifier for the timeout.
124 */
125 struct GNUNET_SCHEDULER_Task * tsk;
126
127 /**
128 * Where are we in the test?
129 */
130 enum AutoPhase phase;
131
132};
133
134
135/**
136 * Run the next phase of the auto test.
137 */
138static void
139next_phase (struct GNUNET_SetupAutoContext *ac);
140
141
142/**
143 * Update the ICMP server button based on the result.
144 *
145 * @param on #GNUNET_YES to enable, #GNUNET_NO to disable
146 */
147static void
148update_icmp_server_enable_button (int on)
149{
150 GtkToggleButton *button;
151
152 button =
153 GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object
154 ("GNUNET_setup_transport_icmp_server_enable_checkbutton"));
155 if (button == NULL)
156 {
157 GNUNET_break (0);
158 return;
159 }
160 gtk_toggle_button_set_active (button, on ? TRUE : FALSE);
161}
162
163
164/**
165 * Function called by NAT on success.
166 * Clean up and update GUI (with success).
167 *
168 * @param cls closure (unused)
169 * @param result error status
170 */
171static void
172result_callback (void *cls,
173 enum GNUNET_NAT_StatusCode result)
174{
175 struct GNUNET_SetupAutoContext *ac = cls;
176
177 GNUNET_SCHEDULER_cancel (ac->tsk);
178 ac->tsk = NULL;
179 GNUNET_NAT_test_stop (ac->tst);
180 ac->tst = NULL;
181 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
182 (GNUNET_NAT_ERROR_SUCCESS == result)
183 ? _("NAT traversal with ICMP Server succeeded.\n")
184 : _("NAT traversal with ICMP Server failed.\n"));
185 update_icmp_server_enable_button ((GNUNET_NAT_ERROR_SUCCESS == result));
186 if (NULL != cfg)
187 GNUNET_CONFIGURATION_set_value_string (cfg,
188 "nat",
189 "ENABLE_ICMP_SERVER",
190 (GNUNET_NAT_ERROR_SUCCESS == result)
191 ? "YES": "NO");
192 next_phase (ac);
193}
194
195
196/**
197 * Main function for the connection reversal test.
198 *
199 * @param cls the 'int*' for the result
200 */
201static void
202reversal_test (void *cls)
203{
204 struct GNUNET_SetupAutoContext *ac = cls;
205
206 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
207 _("Testing connection reversal with ICMP server.\n"));
208 GNUNET_assert (NULL != cfg);
209 GNUNET_RESOLVER_connect (cfg);
210 ac->tst = GNUNET_NAT_test_start (cfg,
211 GNUNET_YES,
212 0, 0, TIMEOUT,
213 &result_callback, ac);
214 if (NULL == ac->tst)
215 {
216 next_phase (ac);
217 return;
218 }
219}
220
221
222/**
223 * Test if we are online at all.
224 *
225 * @param ac auto setup context
226 */
227static void
228test_online (struct GNUNET_SetupAutoContext *ac)
229{
230 // FIXME: not implemented
231 next_phase (ac);
232}
233
234
235/**
236 * Set our external IPv4 address.
237 *
238 * @param cls closure with our setup context
239 * @param addr the address, NULL on errors
240 * @param result error code
241 */
242static void
243set_external_ipv4 (void *cls,
244 const struct in_addr *addr,
245 enum GNUNET_NAT_StatusCode result)
246{
247 struct GNUNET_SetupAutoContext *ac = cls;
248 char buf[INET_ADDRSTRLEN];
249 GObject *o;
250
251 ac->eh = NULL;
252 if (NULL == addr)
253 {
254 next_phase (ac);
255 return;
256 }
257 /* enable 'behind nat' */
258 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
259 _("Detected external IP `%s'\n"),
260 inet_ntop (AF_INET,
261 addr,
262 buf,
263 sizeof (buf)));
264 if (NULL != cfg)
265 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "BEHIND_NAT", "YES");
266 o = GNUNET_SETUP_get_object ("GNUNET_setup_transport_nat_checkbutton");
267 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (o), TRUE);
268
269 /* set external IP address */
270 if (NULL == inet_ntop (AF_INET, addr, buf, sizeof (buf)))
271 {
272 GNUNET_break (0);
273 next_phase (ac);
274 return;
275 }
276 if (NULL != cfg)
277 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "EXTERNAL_ADDRESS",
278 buf);
279 o = GNUNET_SETUP_get_object ("GNUNET_setup_transport_external_ip_address_entry");
280 gtk_entry_set_text (GTK_ENTRY (o), buf);
281 next_phase (ac);
282}
283
284
285/**
286 * Determine our external IPv4 address.
287 *
288 * @param ac auto setup context
289 */
290static void
291test_external_ip (struct GNUNET_SetupAutoContext *ac)
292{
293 // FIXME: CPS?
294 /* try to detect external IP */
295 ac->eh = GNUNET_NAT_mini_get_external_ipv4 (TIMEOUT,
296 &set_external_ipv4, ac);
297}
298
299
300/**
301 * Process list of local IP addresses. Find and set the
302 * one of the default interface.
303 *
304 * @param cls pointer to int to store if we have a non-local IPv6 address
305 * @param name name of the interface (can be NULL for unknown)
306 * @param isDefault is this presumably the default interface
307 * @param addr address of this interface (can be NULL for unknown or unassigned)
308 * @param broadcast_addr the broadcast address (can be NULL for unknown or unassigned)
309 * @param netmask the network mask (can be NULL for unknown or unassigned))
310 * @param addrlen length of the address
311 * @return #GNUNET_OK to continue iteration, #GNUNET_SYSERR to abort
312 */
313static int
314nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr,
315 const struct sockaddr *broadcast_addr, const struct sockaddr *netmask,
316 socklen_t addrlen)
317{
318 int *have_v6 = cls;
319 const struct sockaddr_in *in;
320 char buf[INET_ADDRSTRLEN];
321 GtkEntry *entry;
322
323 if (!isDefault)
324 return GNUNET_OK;
325 if ( (sizeof (struct sockaddr_in6) == addrlen) &&
326 (0 != memcmp (&in6addr_loopback,
327 &((struct sockaddr_in6 *)addr)->sin6_addr,
328 sizeof (struct in6_addr))) &&
329 (! IN6_IS_ADDR_LINKLOCAL (&((const struct sockaddr_in6*) addr)->sin6_addr)))
330 {
331 *have_v6 = GNUNET_YES;
332 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
333 _("This system has a global IPv6 address, setting IPv6 to supported.\n"));
334 return GNUNET_OK;
335 }
336 if (addrlen != sizeof (struct sockaddr_in))
337 return GNUNET_OK;
338 in = (const struct sockaddr_in *) addr;
339
340 /* set internal IP address */
341 if (NULL == inet_ntop (AF_INET, &in->sin_addr, buf, sizeof (buf)))
342 {
343 GNUNET_break (0);
344 return GNUNET_OK;
345 }
346 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "INTERNAL_ADDRESS", buf);
347 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
348 _("Detected internal network address `%s'.\n"),
349 buf);
350 entry =
351 GTK_ENTRY (GNUNET_SETUP_get_object
352 ("GNUNET_setup_transport_internal_ip_entry"));
353 gtk_entry_set_text (entry, buf);
354 /* no need to continue iteration */
355 return GNUNET_SYSERR;
356}
357
358
359/**
360 * Determine our local IP addresses; detect internal IP & IPv6-support
361 *
362 * @param ac auto setup context
363 */
364static void
365test_local_ip (struct GNUNET_SetupAutoContext *ac)
366{
367 GtkToggleButton *button;
368 int have_v6;
369
370 have_v6 = GNUNET_NO;
371 GNUNET_OS_network_interfaces_list (&nipo, &have_v6);
372 button = GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_transport_disable_ipv6_checkbutton"));
373 gtk_toggle_button_set_active (button,
374 (GNUNET_YES == have_v6) ? FALSE : TRUE);
375 if (NULL != cfg)
376 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "DISABLEV6",
377 (GNUNET_YES == have_v6) ? "NO" : "YES");
378 next_phase (ac);
379}
380
381
382/**
383 * Test if NAT has been punched
384 *
385 * @param ac auto setup context
386 */
387static void
388test_nat_punched (struct GNUNET_SetupAutoContext *ac)
389{
390 // FIXME: not implemented
391 next_phase (ac);
392}
393
394
395/**
396 * Test if UPnPC works.
397 *
398 * @param ac auto setup context
399 */
400static void
401test_upnpc (struct GNUNET_SetupAutoContext *ac)
402{
403 int have_upnpc;
404 GtkToggleButton *button;
405
406 /* test if upnpc is available */
407 button = GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_transport_upnp_enable_checkbutton"));
408 have_upnpc = (GNUNET_SYSERR !=
409 GNUNET_OS_check_helper_binary ("upnpc",GNUNET_NO, NULL));
410 /* FIXME: test if upnpc is actually working, that is, if transports
411 start to work once we use UPnP */
412 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
413 (have_upnpc)
414 ? _("upnpc found, enabling its use\n")
415 : _("upnpc not found\n"));
416 gtk_toggle_button_set_active (button,
417 have_upnpc
418 ? TRUE
419 : FALSE);
420 if (NULL != cfg)
421 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_UPNP",
422 (GNUNET_YES == have_upnpc) ? "YES" : "NO");
423 next_phase (ac);
424}
425
426
427/**
428 * Test if ICMP server is working
429 *
430 * @param ac auto setup context
431 */
432static void
433test_icmp_server (struct GNUNET_SetupAutoContext *ac)
434{
435 int hns;
436 char *tmp;
437 char *binary;
438
439 tmp = NULL;
440 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-server");
441 hns =
442 ((GNUNET_OK ==
443 GNUNET_CONFIGURATION_get_value_string (cfg, "nat", "EXTERNAL_ADDRESS",
444 &tmp)) && (0 < strlen (tmp)) &&
445 (GNUNET_YES ==
446 GNUNET_CONFIGURATION_get_value_yesno (cfg, "nat", "BEHIND_NAT")) &&
447 (GNUNET_YES ==
448 GNUNET_OS_check_helper_binary (binary,GNUNET_NO, NULL)));
449 GNUNET_free_non_null (tmp);
450 GNUNET_free (binary);
451 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
452 (hns)
453 ? _("gnunet-helper-nat-server found, testing it\n")
454 : _("No working gnunet-helper-nat-server found\n"));
455 if (hns)
456 GNUNET_SCHEDULER_add_now (&reversal_test, ac);
457 else
458 next_phase (ac);
459}
460
461
462/**
463 * Test if ICMP client is working
464 *
465 * @param ac auto setup context
466 */
467static void
468test_icmp_client (struct GNUNET_SetupAutoContext *ac)
469{
470 GtkToggleButton *button;
471 int hnc;
472 char *tmp;
473 char *binary;
474
475 tmp = NULL;
476 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-client");
477 hnc =
478 ((GNUNET_OK ==
479 GNUNET_CONFIGURATION_get_value_string (cfg, "nat", "INTERNAL_ADDRESS",
480 &tmp)) && (0 < strlen (tmp)) &&
481 (GNUNET_YES !=
482 GNUNET_CONFIGURATION_get_value_yesno (cfg, "nat", "BEHIND_NAT")) &&
483 (GNUNET_YES ==
484 GNUNET_OS_check_helper_binary (binary,GNUNET_NO, NULL)));
485 GNUNET_free_non_null (tmp);
486 GNUNET_free (binary);
487 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
488 (hnc)
489 ? _("gnunet-helper-nat-client found, enabling it\n")
490 : _("gnunet-helper-nat-client not found or behind NAT, disabling it\n"));
491 button =
492 GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object
493 ("GNUNET_setup_transport_icmp_client_enable_checkbutton"));
494 gtk_toggle_button_set_active (button, hnc ? TRUE : FALSE);
495 next_phase (ac);
496}
497
498
499/**
500 * User asked for autoconfiguration. Try the full program.
501 *
502 * @param fin_cb function to call when done
503 * @param fin_cb_cls closure for 'fin_cb'
504 * @return handle for the operation
505 */
506struct GNUNET_SetupAutoContext *
507GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb,
508 void *fin_cb_cls)
509{
510 struct GNUNET_SetupAutoContext *ac;
511
512 ac = GNUNET_new (struct GNUNET_SetupAutoContext);
513 ac->fin_cb = fin_cb;
514 ac->fin_cb_cls = fin_cb_cls;
515
516 /* never use loopback addresses if user wanted autoconfiguration */
517 GNUNET_CONFIGURATION_set_value_string (cfg, "nat",
518 "USE_LOCALADDR",
519 "NO");
520 next_phase (ac);
521 return ac;
522}
523
524
525/**
526 * Run the next phase of the auto test.
527 */
528static void
529next_phase (struct GNUNET_SetupAutoContext *ac)
530{
531 ac->phase++;
532 switch (ac->phase)
533 {
534 case AUTO_INIT:
535 GNUNET_assert (0);
536 break;
537 case AUTO_ONLINE:
538 test_online (ac);
539 break;
540 case AUTO_EXTERNAL_IP:
541 test_external_ip (ac);
542 break;
543 case AUTO_LOCAL_IP:
544 test_local_ip (ac);
545 break;
546 case AUTO_NAT_PUNCHED:
547 test_nat_punched (ac);
548 break;
549 case AUTO_UPNPC:
550 test_upnpc (ac);
551 break;
552 case AUTO_ICMP_SERVER:
553 test_icmp_server (ac);
554 break;
555 case AUTO_ICMP_CLIENT:
556 test_icmp_client (ac);
557 break;
558 case AUTO_DONE:
559 ac->fin_cb (ac->fin_cb_cls);
560 GNUNET_free (ac);
561 return;
562 }
563}
564
565
566/**
567 * Autoconfiguration test is finished, clear the block so
568 * that it can be run again.
569 *
570 * @param cls pointer to the location that needs to be NULLed
571 */
572static void
573clear_ac (void *cls)
574{
575 struct GNUNET_SetupAutoContext **acp = cls;
576
577 *acp = NULL;
578 gtk_widget_set_sensitive (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_transport_autoconfig_button")),
579 TRUE);
580}
581
582
583/**
584 * User asked for autoconfiguration. Try the full program
585 */
586void
587GNUNET_setup_transport_autoconfig_button_clicked_cb ()
588{
589 static struct GNUNET_SetupAutoContext *ac;
590
591 /* make sure only one test is running at a time */
592 if (NULL != ac)
593 {
594 GNUNET_break (0);
595 return;
596 }
597 gtk_widget_set_sensitive (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_transport_autoconfig_button")),
598 FALSE);
599 ac = GNUNET_setup_transport_autoconfig_start (&clear_ac,
600 &ac);
601}
602
603
604/* end of gnunet-setup-transport.c */
diff --git a/src/setup/gnunet-setup-transport.h b/src/setup/gnunet-setup-transport.h
deleted file mode 100644
index fbef4faa..00000000
--- a/src/setup/gnunet-setup-transport.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2010, 2012 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21/**
22 * @file src/setup/gnunet-setup-transport.h
23 * @brief support for transport (NAT) configuration
24 * @author Christian Grothoff
25 */
26#ifndef GNUNET_SETUP_TRANSPORT_H
27#define GNUNET_SETUP_TRANSPORT_H
28#include "gnunet-setup.h"
29#include <gnunet/gnunet_util_lib.h>
30#include <gnunet/gnunet_resolver_service.h>
31#include <gnunet/gnunet_nat_lib.h>
32
33/**
34 * Handle for the autoconfig operation.
35 */
36struct GNUNET_SetupAutoContext;
37
38/**
39 * Function called upon completion of the operation.
40 *
41 * @param cls closure
42 */
43typedef void (*GNUNET_SetupAutoConfigFinished)(void *cls);
44
45
46/**
47 * User asked for autoconfiguration. Try the full program.
48 *
49 * @param fin_cb function to call when done
50 * @param fin_cb_cls closure for 'fin_cb'
51 * @return handle for the operation
52 */
53struct GNUNET_SetupAutoContext *
54GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb,
55 void *fin_cb_cls);
56
57
58#endif
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c
index d4da0554..f1bc7c23 100644
--- a/src/setup/gnunet-setup.c
+++ b/src/setup/gnunet-setup.c
@@ -24,7 +24,6 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "gnunet-setup.h" 26#include "gnunet-setup.h"
27#include "gnunet-setup-transport.h"
28#include "gnunet-setup-options.h" 27#include "gnunet-setup-options.h"
29#include <gnunet/gnunet_constants.h> 28#include <gnunet/gnunet_constants.h>
30#include <regex.h> 29#include <regex.h>
@@ -53,11 +52,6 @@ struct GNUNET_CONFIGURATION_Handle *cfg;
53 */ 52 */
54static int gret; 53static int gret;
55 54
56/**
57 * Run autoconfig-only and then exit immediately.
58 */
59static int do_autoconfig;
60
61#ifndef MINGW 55#ifndef MINGW
62/** 56/**
63 * Flag to enable privilege escalation. 57 * Flag to enable privilege escalation.
@@ -433,18 +427,6 @@ GNUNET_setup_launch_edit_friends_button_clicked_cb (GtkButton *button,
433 427
434 428
435/** 429/**
436 * Called once the autoconfiguration is done. Triggers shutdown.
437 *
438 * @param cls unused
439 */
440static void
441autoconfig_finished_cb (void *cls)
442{
443 GNUNET_SCHEDULER_shutdown ();
444}
445
446
447/**
448 * Actual main method that sets up the configuration window. 430 * Actual main method that sets up the configuration window.
449 * 431 *
450 * @param cls the main loop handle 432 * @param cls the main loop handle
@@ -519,13 +501,6 @@ run (void *cls)
519 main_window); 501 main_window);
520 load_options (); 502 load_options ();
521 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); 503 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL);
522 if (do_autoconfig)
523 {
524 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
525 _("Attempting fully-automatic, non-interactive network configuration\n"));
526 GNUNET_setup_transport_autoconfig_start (&autoconfig_finished_cb, NULL);
527 return;
528 }
529 gtk_widget_show (main_window); 504 gtk_widget_show (main_window);
530 gtk_window_present (GTK_WINDOW (main_window)); 505 gtk_window_present (GTK_WINDOW (main_window));
531} 506}
@@ -542,9 +517,6 @@ int
542main (int argc, char *const *argv) 517main (int argc, char *const *argv)
543{ 518{
544 struct GNUNET_GETOPT_CommandLineOption options[] = { 519 struct GNUNET_GETOPT_CommandLineOption options[] = {
545 { 'a', "autoconfig", NULL,
546 gettext_noop ("attempt automatic configuration of the network and instantly exit"),
547 0, &GNUNET_GETOPT_set_one, &do_autoconfig },
548#ifndef MINGW 520#ifndef MINGW
549 { 'e', "elevate-priviledges", NULL, 521 { 'e', "elevate-priviledges", NULL,
550 gettext_noop ("run as user 'gnunet', if necessary by executing gksu to elevate rights"), 522 gettext_noop ("run as user 'gnunet', if necessary by executing gksu to elevate rights"),