aboutsummaryrefslogtreecommitdiff
path: root/src/nat
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-01-26 10:06:46 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-01-26 10:06:46 +0000
commit57d6cf3c8765c511a80e8b873500d213cc884ac7 (patch)
treeb02d175434ed6760acef188e3431fab477fa19fd /src/nat
parent8384033b4d63e8dff136dc67e9b207401a49246d (diff)
downloadgnunet-57d6cf3c8765c511a80e8b873500d213cc884ac7.tar.gz
gnunet-57d6cf3c8765c511a80e8b873500d213cc884ac7.zip
initial changes to get the nat test to run
Diffstat (limited to 'src/nat')
-rw-r--r--src/nat/test-nat.conf350
-rw-r--r--src/nat/test_nat.c23
2 files changed, 371 insertions, 2 deletions
diff --git a/src/nat/test-nat.conf b/src/nat/test-nat.conf
new file mode 100644
index 000000000..9c74535ef
--- /dev/null
+++ b/src/nat/test-nat.conf
@@ -0,0 +1,350 @@
1[PATHS]
2SERVICEHOME = /tmp/nat-test
3# SERVICEHOME = /var/lib/gnunet/
4# DEFAULTCONFIG = /etc/gnunet.conf
5# If 'DEFAULTCONFIG' is not defined, the current
6# configuration file is assumed to be the default,
7# which is what we want by default...
8
9[gnunetd]
10HOSTKEY = $SERVICEHOME/.hostkey
11
12[TESTING]
13WEAKRANDOM = NO
14
15[client]
16HOME = $SERVICEHOME
17
18[transport-tcp]
19# Use 0 to ONLY advertise as a peer behind NAT (no port binding)
20PORT = 2086
21ADVERTISED_PORT = 2086
22
23# Are we behind NAT?
24BEHIND_NAT = YES
25
26# Is the NAT hole-punched?
27PUNCHED_NAT = NO
28
29# Disable UPNP by default until it gets cleaner!
30ENABLE_UPNP = NO
31
32# External IP address of the NAT box (if known); IPv4 dotted-decimal ONLY at this time (should allow DynDNS!)
33# normal interface IP address for non-NATed peers;
34# possibly auto-detected (using UPnP) if possible if not specified
35# EXTERNAL_ADDRESS =
36
37# Should we use ICMP-based NAT traversal to try connect to NATed peers
38# or, if we are behind NAT, to allow connections to us?
39ENABLE_ICMP_CLIENT = YES
40ENABLE_ICMP_SERVER = YES
41
42# IP address of the interface connected to the NAT box; IPv4 dotted-decimal ONLY;
43# normal interface IP address for non-NATed peers;
44# likely auto-detected (via interface list) if not specified (!)
45# INTERNAL_ADDRESS =
46
47# Only bind to a specific IP address; if both are given, this should be idential to INTERNAL_ADDRESS
48# (but use different: this one restricts our bind!)
49# BINDTO =
50
51TIMEOUT = 300000
52
53# Disable IPv6 support
54# DISABLEV6 =
55# ACCEPT_FROM =
56# ACCEPT_FROM6 =
57# REJECT_FROM =
58# REJECT_FROM6 =
59
60[transport-udp]
61PORT = 2086
62# BEHIND_NAT =
63# BINDTO =
64# ALLOW_NAT =
65# ONLY_NAT_ADDRESSES =
66# INTERNAL_ADDRESS =
67# EXTERNAL_ADDRESS =
68
69[transport-http]
70PORT = 1080
71
72[transport-https]
73PORT = 4433
74
75[arm]
76PORT = 2087
77HOSTNAME = localhost
78HOME = $SERVICEHOME
79CONFIG = $DEFAULTCONFIG
80BINARY = gnunet-service-arm
81ACCEPT_FROM = 127.0.0.1;
82ACCEPT_FROM6 = ::1;
83DEFAULTSERVICES = topology hostlist
84UNIXPATH = /tmp/gnunet-service-arm.sock
85UNIX_MATCH_UID = YES
86UNIX_MATCH_GID = YES
87# GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs
88# GLOBAL_PREFIX =
89# USERNAME =
90# MAXBUF =
91# TIMEOUT =
92# DISABLEV6 =
93# BINDTO =
94# REJECT_FROM =
95# REJECT_FROM6 =
96# PREFIX =
97
98[statistics]
99AUTOSTART = YES
100PORT = 2088
101HOSTNAME = localhost
102HOME = $SERVICEHOME
103CONFIG = $DEFAULTCONFIG
104BINARY = gnunet-service-statistics
105ACCEPT_FROM = 127.0.0.1;
106ACCEPT_FROM6 = ::1;
107UNIXPATH = /tmp/gnunet-service-statistics.sock
108UNIX_MATCH_UID = NO
109UNIX_MATCH_GID = YES
110# DISABLE_SOCKET_FORWARDING = NO
111# USERNAME =
112# MAXBUF =
113# TIMEOUT =
114# DISABLEV6 =
115# BINDTO =
116# REJECT_FROM =
117# REJECT_FROM6 =
118# PREFIX =
119
120[resolver]
121AUTOSTART = YES
122PORT = 2089
123HOSTNAME = localhost
124HOME = $SERVICEHOME
125CONFIG = $DEFAULTCONFIG
126BINARY = gnunet-service-resolver
127ACCEPT_FROM = 127.0.0.1;
128ACCEPT_FROM6 = ::1;
129UNIXPATH = /tmp/gnunet-service-resolver.sock
130UNIX_MATCH_UID = NO
131UNIX_MATCH_GID = NO
132# DISABLE_SOCKET_FORWARDING = NO
133# USERNAME =
134# MAXBUF =
135# TIMEOUT =
136# DISABLEV6 =
137# BINDTO =
138# REJECT_FROM =
139# REJECT_FROM6 =
140# PREFIX =
141
142[peerinfo]
143AUTOSTART = YES
144PORT = 2090
145HOSTNAME = localhost
146HOME = $SERVICEHOME
147CONFIG = $DEFAULTCONFIG
148BINARY = gnunet-service-peerinfo
149ACCEPT_FROM = 127.0.0.1;
150ACCEPT_FROM6 = ::1;
151UNIXPATH = /tmp/gnunet-service-peerinfo.sock
152UNIX_MATCH_UID = NO
153UNIX_MATCH_GID = YES
154# DISABLE_SOCKET_FORWARDING = NO
155# USERNAME =
156# MAXBUF =
157# TIMEOUT =
158# DISABLEV6 =
159# BINDTO =
160# REJECT_FROM =
161# REJECT_FROM6 =
162# PREFIX =
163HOSTS = $SERVICEHOME/data/hosts/
164
165
166[transport]
167AUTOSTART = YES
168PORT = 2091
169HOSTNAME = localhost
170HOME = $SERVICEHOME
171CONFIG = $DEFAULTCONFIG
172BINARY = gnunet-service-transport
173NEIGHBOUR_LIMIT = 50
174ACCEPT_FROM = 127.0.0.1;
175ACCEPT_FROM6 = ::1;
176PLUGINS = tcp
177UNIXPATH = /tmp/gnunet-service-transport.sock
178BLACKLIST_FILE = $SERVICEHOME/blacklist
179UNIX_MATCH_UID = YES
180UNIX_MATCH_GID = YES
181# DISABLE_SOCKET_FORWARDING = NO
182# USERNAME =
183# MAXBUF =
184# TIMEOUT =
185# DISABLEV6 =
186# BINDTO =
187# REJECT_FROM =
188# REJECT_FROM6 =
189# PREFIX =
190
191[core]
192AUTOSTART = YES
193PORT = 2092
194HOSTNAME = localhost
195HOME = $SERVICEHOME
196CONFIG = $DEFAULTCONFIG
197BINARY = gnunet-service-core
198ACCEPT_FROM = 127.0.0.1;
199ACCEPT_FROM6 = ::1;
200# quotas are in bytes per second now!
201TOTAL_QUOTA_IN = 65536
202TOTAL_QUOTA_OUT = 65536
203UNIXPATH = /tmp/gnunet-service-core.sock
204UNIX_MATCH_UID = YES
205UNIX_MATCH_GID = YES
206# DISABLE_SOCKET_FORWARDING = NO
207# DEBUG = YES
208# USERNAME =
209# MAXBUF =
210# TIMEOUT =
211# DISABLEV6 =
212# BINDTO =
213# REJECT_FROM =
214# REJECT_FROM6 =
215# PREFIX =
216
217
218[topology]
219MINIMUM-FRIENDS = 0
220FRIENDS-ONLY = NO
221AUTOCONNECT = YES
222TARGET-CONNECTION-COUNT = 16
223FRIENDS = $SERVICEHOME/friends
224CONFIG = $DEFAULTCONFIG
225BINARY = gnunet-daemon-topology
226
227[hostlist]
228# port for hostlist http server
229HTTPPORT = 8080
230HOME = $SERVICEHOME
231HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data
232CONFIG = $DEFAULTCONFIG
233BINARY = gnunet-daemon-hostlist
234# consider having "-e" as default as well once implemented
235OPTIONS = -b
236SERVERS = http://v9.gnunet.org:58080/
237# proxy for downloading hostlists
238HTTP-PROXY =
239
240
241[datastore]
242AUTOSTART = YES
243UNIXPATH = /tmp/gnunet-service-datastore.sock
244UNIX_MATCH_UID = YES
245UNIX_MATCH_GID = YES
246PORT = 2093
247HOSTNAME = localhost
248HOME = $SERVICEHOME
249CONFIG = $DEFAULTCONFIG
250BINARY = gnunet-service-datastore
251ACCEPT_FROM = 127.0.0.1;
252ACCEPT_FROM6 = ::1;
253QUOTA = 100000000
254BLOOMFILTER = $SERVICEHOME/fs/bloomfilter
255DATABASE = sqlite
256# DISABLE_SOCKET_FORWARDING = NO
257
258[datastore-sqlite]
259FILENAME = $SERVICEHOME/datastore/sqlite.db
260
261[datastore-postgres]
262CONFIG = connect_timeout=10; dbname=gnunet
263
264[datastore-mysql]
265DATABASE = gnunet
266CONFIG = ~/.my.cnf
267# USER = gnunet
268# PASSWORD =
269# HOST = localhost
270# PORT = 3306
271
272[datacache-mysql]
273DATABASE = gnunetcheck
274CONFIG = ~/.my.cnf
275# USER = gnunet
276# PASSWORD =
277# HOST = localhost
278# PORT = 3306
279
280
281[fs]
282AUTOSTART = YES
283INDEXDB = $SERVICEHOME/idxinfo.lst
284TRUST = $SERVICEHOME/data/credit/
285IDENTITY_DIR = $SERVICEHOME/identities/
286STATE_DIR = $SERVICEHOME/persistence/
287UPDATE_DIR = $SERVICEHOME/updates/
288PORT = 2094
289HOSTNAME = localhost
290HOME = $SERVICEHOME
291CONFIG = $DEFAULTCONFIG
292BINARY = gnunet-service-fs
293ACCEPT_FROM = 127.0.0.1;
294ACCEPT_FROM6 = ::1;
295
296CONTENT_CACHING = YES
297CONTENT_PUSHING = YES
298
299UNIXPATH = /tmp/gnunet-service-fs.sock
300UNIX_MATCH_UID = NO
301UNIX_MATCH_GID = YES
302# DISABLE_SOCKET_FORWARDING = NO
303# DEBUG = YES
304MAX_PENDING_REQUESTS = 65536
305# Maximum frequency we're allowed to poll the datastore
306# for content for migration (can be used to reduce
307# GNUnet's disk-IO rate)
308MIN_MIGRATION_DELAY = 1000
309EXPECTED_NEIGHBOUR_COUNT = 128
310
311[dht]
312AUTOSTART = YES
313PORT = 2095
314HOSTNAME = localhost
315HOME = $SERVICEHOME
316CONFIG = $DEFAULTCONFIG
317BINARY = gnunet-service-dht
318ACCEPT_FROM = 127.0.0.1;
319ACCEPT_FROM6 = ::1;
320BUCKET_SIZE = 4
321UNIXPATH = /tmp/gnunet-service-dht.sock
322UNIX_MATCH_UID = YES
323UNIX_MATCH_GID = YES
324# DISABLE_SOCKET_FORWARDING = NO
325# DEBUG = YES
326# USERNAME =
327# MAXBUF =
328# TIMEOUT =
329# DISABLEV6 =
330# BINDTO =
331# REJECT_FROM =
332# REJECT_FROM6 =
333# PREFIX =
334# DO_FIND_PEER =
335# STRICT_KADEMLIA =
336# USE_MAX_HOPS =
337# MAX_HOPS =
338# REPUBLISH = YES
339# REPLICATION_FREQUENCY = 60
340# STOP_ON_CLOSEST =
341# STOP_FOUND =
342# CONVERGE_MODIFIER =
343
344
345[dhtcache]
346DATABASE = sqlite
347QUOTA = 1024000
348
349[block]
350PLUGINS = fs dht test
diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c
index c71623c2e..9fab3a9ba 100644
--- a/src/nat/test_nat.c
+++ b/src/nat/test_nat.c
@@ -136,12 +136,31 @@ main (int argc, char *const argv[])
136 GNUNET_GETOPT_OPTION_END 136 GNUNET_GETOPT_OPTION_END
137 }; 137 };
138 138
139 GNUNET_log_setup ("test-nat", "DEBUG", NULL); 139 char *const argv_prog[] = {
140 "test-nat",
141 "-c",
142 "test-nat.conf",
143 "-L",
144#if VERBOSE
145 "DEBUG",
146#else
147 "WARNING",
148#endif
149 NULL
150 };
151
152 GNUNET_log_setup ("test-nat",
153#if VERBOSE
154 "DEBUG",
155#else
156 "WARNING",
157#endif
158 NULL);
140 159
141 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 160 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
142 "Testing NAT library, timeout set to %d seconds\n", TIMEOUT); 161 "Testing NAT library, timeout set to %d seconds\n", TIMEOUT);
143 162
144 GNUNET_PROGRAM_run (argc, argv, "test-nat", "nohelp", options, &run, NULL); 163 GNUNET_PROGRAM_run (5, argv_prog, "test-nat", "nohelp", options, &run, NULL);
145 164
146 return 0; 165 return 0;
147} 166}