aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-23 17:19:53 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-23 17:19:53 +0100
commit61787bfa37e0ac5998e01d9c4806600033c19c74 (patch)
tree1ceb843f63aa076682ebfa2de2250dc32ee65004
parent4a3be482811fe8ed1502fea2c12a8449b560a99e (diff)
downloadgnunet-61787bfa37e0ac5998e01d9c4806600033c19c74.tar.gz
gnunet-61787bfa37e0ac5998e01d9c4806600033c19c74.zip
rename fest: use new libgnunetnt instead of old libgnunetats logic for network type classification
-rw-r--r--src/ats-tests/ats-testing-log.c2
-rw-r--r--src/ats-tests/ats-testing.c2
-rw-r--r--src/ats-tool/Makefile.am1
-rw-r--r--src/ats-tool/gnunet-ats.c16
-rw-r--r--src/ats/Makefile.am3
-rw-r--r--src/ats/ats_api_scanner.c382
-rw-r--r--src/ats/ats_api_scheduling.c6
-rw-r--r--src/ats/gnunet-ats-solver-eval.c44
-rw-r--r--src/ats/gnunet-service-ats_addresses.c4
-rw-r--r--src/ats/gnunet-service-ats_addresses.h12
-rw-r--r--src/ats/gnunet-service-ats_performance.c6
-rw-r--r--src/ats/gnunet-service-ats_plugins.c20
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c2
-rw-r--r--src/ats/perf_ats_solver.c22
-rw-r--r--src/ats/plugin_ats_mlp.c34
-rw-r--r--src/ats/plugin_ats_proportional.c6
-rw-r--r--src/ats/plugin_ats_ril.c12
-rw-r--r--src/ats/test_ats_api.c8
-rw-r--r--src/ats/test_ats_reservation_api.c2
-rw-r--r--src/dv/dv_api.c4
-rw-r--r--src/dv/gnunet-dv.c4
-rw-r--r--src/dv/gnunet-service-dv.c16
-rw-r--r--src/dv/plugin_transport_dv.c18
-rw-r--r--src/hello/hello-ng.c6
-rw-r--r--src/include/gnunet_ats_plugin.h4
-rw-r--r--src/include/gnunet_ats_service.h93
-rw-r--r--src/include/gnunet_dv_service.h4
-rw-r--r--src/include/gnunet_hello_lib.h10
-rw-r--r--src/include/gnunet_transport_communication_service.h4
-rw-r--r--src/include/gnunet_transport_hello_service.h2
-rw-r--r--src/include/gnunet_transport_monitor_service.h2
-rw-r--r--src/include/gnunet_transport_plugin.h8
-rw-r--r--src/nt/nt.c9
-rw-r--r--src/transport/Makefile.am1
-rw-r--r--src/transport/gnunet-communicator-unix.c4
-rw-r--r--src/transport/gnunet-service-tng.c12
-rw-r--r--src/transport/gnunet-service-transport.c10
-rw-r--r--src/transport/gnunet-service-transport.h2
-rw-r--r--src/transport/gnunet-service-transport_ats.c6
-rw-r--r--src/transport/gnunet-service-transport_plugins.c6
-rw-r--r--src/transport/gnunet-service-transport_validation.c8
-rw-r--r--src/transport/plugin_transport_http_client.c14
-rw-r--r--src/transport/plugin_transport_http_common.c6
-rw-r--r--src/transport/plugin_transport_http_common.h2
-rw-r--r--src/transport/plugin_transport_http_server.c8
-rw-r--r--src/transport/plugin_transport_tcp.c16
-rw-r--r--src/transport/plugin_transport_template.c8
-rw-r--r--src/transport/plugin_transport_udp.c30
-rw-r--r--src/transport/plugin_transport_udp.h2
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c8
-rw-r--r--src/transport/plugin_transport_unix.c10
-rw-r--r--src/transport/plugin_transport_wlan.c16
-rw-r--r--src/transport/plugin_transport_xt.c16
-rw-r--r--src/transport/plugin_transport_xu.c26
-rw-r--r--src/transport/test_plugin_transport.c4
-rw-r--r--src/transport/test_quota_compliance.c6
-rw-r--r--src/transport/transport.h6
-rw-r--r--src/transport/transport_api2_communication.c8
-rw-r--r--src/transport/transport_api2_monitor.c2
59 files changed, 267 insertions, 738 deletions
diff --git a/src/ats-tests/ats-testing-log.c b/src/ats-tests/ats-testing-log.c
index 3d409d53a..1099a4b36 100644
--- a/src/ats-tests/ats-testing-log.c
+++ b/src/ats-tests/ats-testing-log.c
@@ -131,7 +131,7 @@ struct PartnerLoggingTimestep
131 131
132 uint32_t ats_utilization_in; 132 uint32_t ats_utilization_in;
133 133
134 enum GNUNET_ATS_Network_Type ats_network_type; 134 enum GNUNET_NetworkType ats_network_type;
135 135
136 double pref_bandwidth; 136 double pref_bandwidth;
137 double pref_delay; 137 double pref_delay;
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c
index 058e29cde..967f6213d 100644
--- a/src/ats-tests/ats-testing.c
+++ b/src/ats-tests/ats-testing.c
@@ -850,7 +850,7 @@ main_run (void *cls,
850 /* Initialize properties */ 850 /* Initialize properties */
851 top->sps[c_s].partners[c_m].props.delay = GNUNET_TIME_UNIT_ZERO; 851 top->sps[c_s].partners[c_m].props.delay = GNUNET_TIME_UNIT_ZERO;
852 top->sps[c_s].partners[c_m].props.distance = 0; 852 top->sps[c_s].partners[c_m].props.distance = 0;
853 top->sps[c_s].partners[c_m].props.scope = GNUNET_ATS_NET_UNSPECIFIED; 853 top->sps[c_s].partners[c_m].props.scope = GNUNET_NT_UNSPECIFIED;
854 top->sps[c_s].partners[c_m].props.utilization_in = 0; 854 top->sps[c_s].partners[c_m].props.utilization_in = 0;
855 top->sps[c_s].partners[c_m].props.utilization_out = 0; 855 top->sps[c_s].partners[c_m].props.utilization_out = 0;
856 } 856 }
diff --git a/src/ats-tool/Makefile.am b/src/ats-tool/Makefile.am
index 02a21591b..55bfe1322 100644
--- a/src/ats-tool/Makefile.am
+++ b/src/ats-tool/Makefile.am
@@ -17,6 +17,7 @@ gnunet_ats_SOURCES = \
17gnunet_ats_LDADD = \ 17gnunet_ats_LDADD = \
18 $(top_builddir)/src/util/libgnunetutil.la \ 18 $(top_builddir)/src/util/libgnunetutil.la \
19 $(top_builddir)/src/ats/libgnunetats.la \ 19 $(top_builddir)/src/ats/libgnunetats.la \
20 $(top_builddir)/src/nt/libgnunetnt.la \
20 $(top_builddir)/src/transport/libgnunettransport.la \ 21 $(top_builddir)/src/transport/libgnunettransport.la \
21 $(top_builddir)/src/hello/libgnunethello.la \ 22 $(top_builddir)/src/hello/libgnunethello.la \
22 $(GN_LIBINTL) 23 $(GN_LIBINTL)
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 2db0a47d9..0d26ba5d9 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -394,7 +394,7 @@ transport_addr_to_str_cb (void *cls,
394 GNUNET_i2s (&pr->address->peer), 394 GNUNET_i2s (&pr->address->peer),
395 pr->address->transport_name, 395 pr->address->transport_name,
396 address, 396 address,
397 GNUNET_ATS_print_network_type (pr->properties.scope), 397 GNUNET_NT_to_string (pr->properties.scope),
398 ntohl (pr->bandwidth_out.value__), 398 ntohl (pr->bandwidth_out.value__),
399 ntohl (pr->bandwidth_in.value__), 399 ntohl (pr->bandwidth_in.value__),
400 pr->active ? _("active ") : _("inactive ")); 400 pr->active ? _("active ") : _("inactive "));
@@ -641,15 +641,15 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
641 unsigned long long int quota_in; 641 unsigned long long int quota_in;
642 int c; 642 int c;
643 643
644 for (c = 0; (c < GNUNET_ATS_NetworkTypeCount); c++) 644 for (c = 0; (c < GNUNET_NT_COUNT); c++)
645 { 645 {
646 646
647 GNUNET_asprintf (&entry_out, 647 GNUNET_asprintf (&entry_out,
648 "%s_QUOTA_OUT", 648 "%s_QUOTA_OUT",
649 GNUNET_ATS_print_network_type (c)); 649 GNUNET_NT_to_string (c));
650 GNUNET_asprintf (&entry_in, 650 GNUNET_asprintf (&entry_in,
651 "%s_QUOTA_IN", 651 "%s_QUOTA_IN",
652 GNUNET_ATS_print_network_type (c)); 652 GNUNET_NT_to_string (c));
653 653
654 /* quota out */ 654 /* quota out */
655 if (GNUNET_OK == 655 if (GNUNET_OK ==
@@ -671,7 +671,7 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
671 { 671 {
672 FPRINTF (stderr, 672 FPRINTF (stderr,
673 "Outbound quota for network `%11s' not configured!\n", 673 "Outbound quota for network `%11s' not configured!\n",
674 GNUNET_ATS_print_network_type (c)); 674 GNUNET_NT_to_string (c));
675 GNUNET_asprintf (&quota_out_str, "-"); 675 GNUNET_asprintf (&quota_out_str, "-");
676 } 676 }
677 GNUNET_free (entry_out); 677 GNUNET_free (entry_out);
@@ -694,20 +694,20 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
694 { 694 {
695 FPRINTF (stderr, 695 FPRINTF (stderr,
696 "Inbound quota for network `%11s' not configured!\n", 696 "Inbound quota for network `%11s' not configured!\n",
697 GNUNET_ATS_print_network_type (c)); 697 GNUNET_NT_to_string (c));
698 GNUNET_asprintf (&quota_in_str, "-"); 698 GNUNET_asprintf (&quota_in_str, "-");
699 } 699 }
700 GNUNET_free(entry_in); 700 GNUNET_free(entry_in);
701 701
702 FPRINTF (stdout, 702 FPRINTF (stdout,
703 _("Quota for network `%11s' (in/out): %10s / %10s\n"), 703 _("Quota for network `%11s' (in/out): %10s / %10s\n"),
704 GNUNET_ATS_print_network_type (c), 704 GNUNET_NT_to_string (c),
705 quota_in_str, 705 quota_in_str,
706 quota_out_str); 706 quota_out_str);
707 GNUNET_free(quota_out_str); 707 GNUNET_free(quota_out_str);
708 GNUNET_free(quota_in_str); 708 GNUNET_free(quota_in_str);
709 } 709 }
710 return GNUNET_ATS_NetworkTypeCount; 710 return GNUNET_NT_COUNT;
711} 711}
712 712
713 713
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am
index 759dac0be..6a5c924e0 100644
--- a/src/ats/Makefile.am
+++ b/src/ats/Makefile.am
@@ -34,8 +34,8 @@ endif
34 34
35libgnunetats_la_SOURCES = \ 35libgnunetats_la_SOURCES = \
36 ats_api_connectivity.c \ 36 ats_api_connectivity.c \
37 ats_api_scanner.c \
38 ats_api_scheduling.c \ 37 ats_api_scheduling.c \
38 ats_api_scanner.c \
39 ats_api_performance.c 39 ats_api_performance.c
40libgnunetats_la_LIBADD = \ 40libgnunetats_la_LIBADD = \
41 $(top_builddir)/src/hello/libgnunethello.la \ 41 $(top_builddir)/src/hello/libgnunethello.la \
@@ -90,6 +90,7 @@ gnunet_service_ats_SOURCES = \
90 gnunet-service-ats_scheduling.c gnunet-service-ats_scheduling.h \ 90 gnunet-service-ats_scheduling.c gnunet-service-ats_scheduling.h \
91 gnunet-service-ats_reservations.c gnunet-service-ats_reservations.h 91 gnunet-service-ats_reservations.c gnunet-service-ats_reservations.h
92gnunet_service_ats_LDADD = \ 92gnunet_service_ats_LDADD = \
93 $(top_builddir)/src/nt/libgnunetnt.la \
93 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 94 $(top_builddir)/src/statistics/libgnunetstatistics.la \
94 $(top_builddir)/src/util/libgnunetutil.la \ 95 $(top_builddir)/src/util/libgnunetutil.la \
95 libgnunetats.la \ 96 libgnunetats.la \
diff --git a/src/ats/ats_api_scanner.c b/src/ats/ats_api_scanner.c
index 46afb46f0..7fb125e6f 100644
--- a/src/ats/ats_api_scanner.c
+++ b/src/ats/ats_api_scanner.c
@@ -25,41 +25,6 @@
25#include "gnunet_ats_service.h" 25#include "gnunet_ats_service.h"
26 26
27/** 27/**
28 * How frequently do we scan the interfaces for changes to the addresses?
29 */
30#define INTERFACE_PROCESSING_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2)
31
32
33/**
34 * Convert a `enum GNUNET_ATS_Network_Type` to a string
35 *
36 * @param net the network type
37 * @return a string or NULL if invalid
38 */
39const char *
40GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net)
41{
42 switch (net)
43 {
44 case GNUNET_ATS_NET_UNSPECIFIED:
45 return "UNSPECIFIED";
46 case GNUNET_ATS_NET_LOOPBACK:
47 return "LOOPBACK";
48 case GNUNET_ATS_NET_LAN:
49 return "LAN";
50 case GNUNET_ATS_NET_WAN:
51 return "WAN";
52 case GNUNET_ATS_NET_WLAN:
53 return "WLAN";
54 case GNUNET_ATS_NET_BT:
55 return "BLUETOOTH";
56 default:
57 return NULL;
58 }
59}
60
61
62/**
63 * Convert ATS properties from host to network byte order. 28 * Convert ATS properties from host to network byte order.
64 * 29 *
65 * @param nbo[OUT] value written 30 * @param nbo[OUT] value written
@@ -95,351 +60,4 @@ GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo,
95} 60}
96 61
97 62
98/**
99 * We keep a list of our local networks so we can answer
100 * LAN vs. WAN questions. Note: WLAN is not detected yet.
101 * (maybe we can do that heuristically based on interface
102 * name in the future?).
103 */
104struct ATS_Network
105{
106 /**
107 * Kept in a DLL.
108 */
109 struct ATS_Network *next;
110
111 /**
112 * Kept in a DLL.
113 */
114 struct ATS_Network *prev;
115
116 /**
117 * Network address.
118 */
119 struct sockaddr *network;
120
121 /**
122 * Netmask to determine what is in the LAN.
123 */
124 struct sockaddr *netmask;
125
126 /**
127 * How long are @e network and @e netmask?
128 */
129 socklen_t length;
130};
131
132
133/**
134 * Handle to the interface scanner.
135 */
136struct GNUNET_ATS_InterfaceScanner
137{
138
139 /**
140 * Head of LAN networks list.
141 */
142 struct ATS_Network *net_head;
143
144 /**
145 * Tail of LAN networks list.
146 */
147 struct ATS_Network *net_tail;
148
149 /**
150 * Task for periodically refreshing our LAN network list.
151 */
152 struct GNUNET_SCHEDULER_Task *interface_task;
153
154};
155
156
157/**
158 * Delete all entries from the current network list.
159 *
160 * @param is scanner to clean up
161 */
162static void
163delete_networks (struct GNUNET_ATS_InterfaceScanner *is)
164{
165 struct ATS_Network *cur;
166
167 while (NULL != (cur = is->net_head))
168 {
169 GNUNET_CONTAINER_DLL_remove (is->net_head,
170 is->net_tail,
171 cur);
172 GNUNET_free (cur);
173 }
174}
175
176
177/**
178 * Function invoked for each interface found. Adds the interface's
179 * network addresses to the respective DLL, so we can distinguish
180 * between LAN and WAN.
181 *
182 * @param cls closure with the `struct GNUNET_ATS_InterfaceScanner`
183 * @param name name of the interface (can be NULL for unknown)
184 * @param isDefault is this presumably the default interface
185 * @param addr address of this interface (can be NULL for unknown or unassigned)
186 * @param broadcast_addr the broadcast address (can be NULL for unknown or unassigned)
187 * @param netmask the network mask (can be NULL for unknown or unassigned)
188 * @param addrlen length of the address
189 * @return #GNUNET_OK to continue iteration
190 */
191static int
192interface_proc (void *cls,
193 const char *name,
194 int isDefault,
195 const struct sockaddr *addr,
196 const struct sockaddr *broadcast_addr,
197 const struct sockaddr *netmask,
198 socklen_t addrlen)
199{
200 struct GNUNET_ATS_InterfaceScanner *is = cls;
201 /* Calculate network */
202 struct ATS_Network *net = NULL;
203
204 /* Skipping IPv4 loopback addresses since we have special check */
205 if (addr->sa_family == AF_INET)
206 {
207 const struct sockaddr_in *a4 = (const struct sockaddr_in *) addr;
208
209 if ((a4->sin_addr.s_addr & htonl(0xff000000)) == htonl (0x7f000000))
210 return GNUNET_OK;
211 }
212 /* Skipping IPv6 loopback addresses since we have special check */
213 if (addr->sa_family == AF_INET6)
214 {
215 const struct sockaddr_in6 *a6 = (const struct sockaddr_in6 *) addr;
216 if (IN6_IS_ADDR_LOOPBACK (&a6->sin6_addr))
217 return GNUNET_OK;
218 }
219
220 if (addr->sa_family == AF_INET)
221 {
222 const struct sockaddr_in *addr4 = (const struct sockaddr_in *) addr;
223 const struct sockaddr_in *netmask4 = (const struct sockaddr_in *) netmask;
224 struct sockaddr_in *tmp;
225 struct sockaddr_in network4;
226
227 net = GNUNET_malloc (sizeof (struct ATS_Network) + 2 * sizeof (struct sockaddr_in));
228 tmp = (struct sockaddr_in *) &net[1];
229 net->network = (struct sockaddr *) &tmp[0];
230 net->netmask = (struct sockaddr *) &tmp[1];
231 net->length = addrlen;
232
233 memset (&network4, 0, sizeof (network4));
234 network4.sin_family = AF_INET;
235#if HAVE_SOCKADDR_IN_SIN_LEN
236 network4.sin_len = sizeof (network4);
237#endif
238 network4.sin_addr.s_addr = (addr4->sin_addr.s_addr & netmask4->sin_addr.s_addr);
239
240 GNUNET_memcpy (net->netmask, netmask4, sizeof (struct sockaddr_in));
241 GNUNET_memcpy (net->network, &network4, sizeof (struct sockaddr_in));
242 }
243
244 if (addr->sa_family == AF_INET6)
245 {
246 const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *) addr;
247 const struct sockaddr_in6 *netmask6 = (const struct sockaddr_in6 *) netmask;
248 struct sockaddr_in6 * tmp;
249 struct sockaddr_in6 network6;
250
251 net = GNUNET_malloc (sizeof (struct ATS_Network) + 2 * sizeof (struct sockaddr_in6));
252 tmp = (struct sockaddr_in6 *) &net[1];
253 net->network = (struct sockaddr *) &tmp[0];
254 net->netmask = (struct sockaddr *) &tmp[1];
255 net->length = addrlen;
256
257 memset (&network6, 0, sizeof (network6));
258 network6.sin6_family = AF_INET6;
259#if HAVE_SOCKADDR_IN_SIN_LEN
260 network6.sin6_len = sizeof (network6);
261#endif
262 unsigned int c = 0;
263 uint32_t *addr_elem = (uint32_t *) &addr6->sin6_addr;
264 uint32_t *mask_elem = (uint32_t *) &netmask6->sin6_addr;
265 uint32_t *net_elem = (uint32_t *) &network6.sin6_addr;
266 for (c = 0; c < 4; c++)
267 net_elem[c] = addr_elem[c] & mask_elem[c];
268
269 GNUNET_memcpy (net->netmask, netmask6, sizeof (struct sockaddr_in6));
270 GNUNET_memcpy (net->network, &network6, sizeof (struct sockaddr_in6));
271 }
272 if (NULL == net)
273 return GNUNET_OK; /* odd / unsupported address family */
274
275 /* Store in list */
276#if VERBOSE_ATS
277 char * netmask = GNUNET_strdup (GNUNET_a2s((struct sockaddr *) net->netmask, addrlen));
278 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
279 "ats-scanner-api",
280 "Adding network `%s', netmask `%s'\n",
281 GNUNET_a2s ((struct sockaddr *) net->network,
282 addrlen),
283 netmask);
284 GNUNET_free (netmask);
285#endif
286 GNUNET_CONTAINER_DLL_insert (is->net_head,
287 is->net_tail,
288 net);
289
290 return GNUNET_OK;
291}
292
293
294/**
295 * Periodically get list of network addresses from our interfaces.
296 *
297 * @param cls closure
298 */
299static void
300get_addresses (void *cls)
301{
302 struct GNUNET_ATS_InterfaceScanner *is = cls;
303
304 is->interface_task = NULL;
305 delete_networks (is);
306 GNUNET_OS_network_interfaces_list (&interface_proc,
307 is);
308 is->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVAL,
309 &get_addresses,
310 is);
311}
312
313
314/**
315 * Returns where the address is located: LAN or WAN or ...
316 *
317 * @param is the interface scanner handle
318 * @param addr address
319 * @param addrlen address length
320 * @return type of the network the address belongs to
321 */
322enum GNUNET_ATS_Network_Type
323GNUNET_ATS_scanner_address_get_type (struct GNUNET_ATS_InterfaceScanner *is,
324 const struct sockaddr *addr,
325 socklen_t addrlen)
326{
327 struct ATS_Network *cur = is->net_head;
328 enum GNUNET_ATS_Network_Type type = GNUNET_ATS_NET_UNSPECIFIED;
329
330 switch (addr->sa_family)
331 {
332 case AF_UNIX:
333 type = GNUNET_ATS_NET_LOOPBACK;
334 break;
335 case AF_INET:
336 {
337 const struct sockaddr_in *a4 = (const struct sockaddr_in *) addr;
338
339 if ((a4->sin_addr.s_addr & htonl(0xff000000)) == htonl (0x7f000000))
340 type = GNUNET_ATS_NET_LOOPBACK;
341 break;
342 }
343 case AF_INET6:
344 {
345 const struct sockaddr_in6 *a6 = (const struct sockaddr_in6 *) addr;
346
347 if (IN6_IS_ADDR_LOOPBACK (&a6->sin6_addr))
348 type = GNUNET_ATS_NET_LOOPBACK;
349 break;
350 }
351 default:
352 GNUNET_break (0);
353 break;
354 }
355
356 /* Check local networks */
357 while ((NULL != cur) && (GNUNET_ATS_NET_UNSPECIFIED == type))
358 {
359 if (addrlen != cur->length)
360 {
361 cur = cur->next;
362 continue;
363 }
364 if (addr->sa_family == AF_INET)
365 {
366 const struct sockaddr_in *a4 = (const struct sockaddr_in *) addr;
367 const struct sockaddr_in *net4 = (const struct sockaddr_in *) cur->network;
368 const struct sockaddr_in *mask4 = (const struct sockaddr_in *) cur->netmask;
369
370 if (((a4->sin_addr.s_addr & mask4->sin_addr.s_addr)) == net4->sin_addr.s_addr)
371 type = GNUNET_ATS_NET_LAN;
372 }
373 if (addr->sa_family == AF_INET6)
374 {
375 const struct sockaddr_in6 *a6 = (const struct sockaddr_in6 *) addr;
376 const struct sockaddr_in6 *net6 = (const struct sockaddr_in6 *) cur->network;
377 const struct sockaddr_in6 *mask6 = (const struct sockaddr_in6 *) cur->netmask;
378
379 int res = GNUNET_YES;
380 int c = 0;
381 uint32_t *addr_elem = (uint32_t *) &a6->sin6_addr;
382 uint32_t *mask_elem = (uint32_t *) &mask6->sin6_addr;
383 uint32_t *net_elem = (uint32_t *) &net6->sin6_addr;
384 for (c = 0; c < 4; c++)
385 if ((addr_elem[c] & mask_elem[c]) != net_elem[c])
386 res = GNUNET_NO;
387
388 if (res == GNUNET_YES)
389 type = GNUNET_ATS_NET_LAN;
390 }
391 cur = cur->next;
392 }
393
394 /* no local network found for this address, default: WAN */
395 if (type == GNUNET_ATS_NET_UNSPECIFIED)
396 type = GNUNET_ATS_NET_WAN;
397 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
398 "ats-scanner-api",
399 "`%s' is in network `%s'\n",
400 GNUNET_a2s (addr,
401 addrlen),
402 GNUNET_ATS_print_network_type (type));
403 return type;
404}
405
406
407/**
408 * Initialize the interface scanner.
409 *
410 * @return interface scanner
411 */
412struct GNUNET_ATS_InterfaceScanner *
413GNUNET_ATS_scanner_init ()
414{
415 struct GNUNET_ATS_InterfaceScanner *is;
416
417 is = GNUNET_new (struct GNUNET_ATS_InterfaceScanner);
418 GNUNET_OS_network_interfaces_list (&interface_proc,
419 is);
420 is->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVAL,
421 &get_addresses,
422 is);
423 return is;
424}
425
426
427/**
428 * Client is done with the interface scanner, release resources.
429 *
430 * @param is handle to release
431 */
432void
433GNUNET_ATS_scanner_done (struct GNUNET_ATS_InterfaceScanner *is)
434{
435 if (NULL != is->interface_task)
436 {
437 GNUNET_SCHEDULER_cancel (is->interface_task);
438 is->interface_task = NULL;
439 }
440 delete_networks (is);
441 GNUNET_free (is);
442}
443
444
445/* end of ats_api_scanner.c */ 63/* end of ats_api_scanner.c */
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 783b9f596..2ce6aed3d 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -476,7 +476,7 @@ send_add_address_message (struct GNUNET_ATS_SchedulingHandle *sh,
476 476
477 if (NULL == sh->mq) 477 if (NULL == sh->mq)
478 return; /* disconnected, skip for now */ 478 return; /* disconnected, skip for now */
479 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ar->properties.scope); 479 GNUNET_break (GNUNET_NT_UNSPECIFIED != ar->properties.scope);
480 namelen = strlen (ar->address->transport_name) + 1; 480 namelen = strlen (ar->address->transport_name) + 1;
481 msize = ar->address->address_length + namelen; 481 msize = ar->address->address_length + namelen;
482 ev = GNUNET_MQ_msg_extra (m, msize, GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD); 482 ev = GNUNET_MQ_msg_extra (m, msize, GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD);
@@ -652,7 +652,7 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
652 GNUNET_break (0); 652 GNUNET_break (0);
653 return NULL; 653 return NULL;
654 } 654 }
655 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 655 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
656 namelen = strlen (address->transport_name) + 1; 656 namelen = strlen (address->transport_name) + 1;
657 msize = address->address_length + namelen; 657 msize = address->address_length + namelen;
658 if ((msize + sizeof (struct AddressUpdateMessage) >= GNUNET_MAX_MESSAGE_SIZE) || 658 if ((msize + sizeof (struct AddressUpdateMessage) >= GNUNET_MAX_MESSAGE_SIZE) ||
@@ -755,7 +755,7 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar,
755 ar->address->transport_name, 755 ar->address->transport_name,
756 ar->session, 756 ar->session,
757 ar->slot); 757 ar->slot);
758 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 758 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
759 GNUNET_ATS_properties_hton (&ar->properties, 759 GNUNET_ATS_properties_hton (&ar->properties,
760 prop); 760 prop);
761 if (NULL == sh->mq) 761 if (NULL == sh->mq)
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 13119dea0..e1a01207d 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -1315,27 +1315,27 @@ load_op_add_address (struct GNUNET_ATS_TEST_Operation *o,
1315 GNUNET_STRINGS_utf8_toupper (op_network,op_network); 1315 GNUNET_STRINGS_utf8_toupper (op_network,op_network);
1316 if (0 == strcmp(op_network, "UNSPECIFIED")) 1316 if (0 == strcmp(op_network, "UNSPECIFIED"))
1317 { 1317 {
1318 o->address_network = GNUNET_ATS_NET_UNSPECIFIED; 1318 o->address_network = GNUNET_NT_UNSPECIFIED;
1319 } 1319 }
1320 else if (0 == strcmp(op_network, "LOOPBACK")) 1320 else if (0 == strcmp(op_network, "LOOPBACK"))
1321 { 1321 {
1322 o->address_network = GNUNET_ATS_NET_LOOPBACK; 1322 o->address_network = GNUNET_NT_LOOPBACK;
1323 } 1323 }
1324 else if (0 == strcmp(op_network, "LAN")) 1324 else if (0 == strcmp(op_network, "LAN"))
1325 { 1325 {
1326 o->address_network = GNUNET_ATS_NET_LAN; 1326 o->address_network = GNUNET_NT_LAN;
1327 } 1327 }
1328 else if (0 == strcmp(op_network, "WAN")) 1328 else if (0 == strcmp(op_network, "WAN"))
1329 { 1329 {
1330 o->address_network = GNUNET_ATS_NET_WAN; 1330 o->address_network = GNUNET_NT_WAN;
1331 } 1331 }
1332 else if (0 == strcmp(op_network, "WLAN")) 1332 else if (0 == strcmp(op_network, "WLAN"))
1333 { 1333 {
1334 o->address_network = GNUNET_ATS_NET_WLAN; 1334 o->address_network = GNUNET_NT_WLAN;
1335 } 1335 }
1336 else if (0 == strcmp(op_network, "BT")) 1336 else if (0 == strcmp(op_network, "BT"))
1337 { 1337 {
1338 o->address_network = GNUNET_ATS_NET_BT; 1338 o->address_network = GNUNET_NT_BT;
1339 } 1339 }
1340 else 1340 else
1341 { 1341 {
@@ -2214,7 +2214,7 @@ enforce_add_address (struct GNUNET_ATS_TEST_Operation *op)
2214 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 2214 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
2215 2215
2216 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Adding address %u for peer %u in network `%s'\n", 2216 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Adding address %u for peer %u in network `%s'\n",
2217 op->address_id, op->peer_id, GNUNET_ATS_print_network_type(a->network)); 2217 op->address_id, op->peer_id, GNUNET_NT_to_string(a->network));
2218 2218
2219 sh->sf->s_add (sh->sf->cls, a->ats_addr, op->address_network); 2219 sh->sf->s_add (sh->sf->cls, a->ats_addr, op->address_network);
2220 2220
@@ -2748,16 +2748,16 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2748 int c; 2748 int c;
2749 int res; 2749 int res;
2750 2750
2751 for (c = 0; (c < GNUNET_ATS_NetworkTypeCount) && (c < dest_length); c++) 2751 for (c = 0; (c < GNUNET_NT_COUNT) && (c < dest_length); c++)
2752 { 2752 {
2753 in_dest[c] = 0; 2753 in_dest[c] = 0;
2754 out_dest[c] = 0; 2754 out_dest[c] = 0;
2755 GNUNET_asprintf (&entry_out, 2755 GNUNET_asprintf (&entry_out,
2756 "%s_QUOTA_OUT", 2756 "%s_QUOTA_OUT",
2757 GNUNET_ATS_print_network_type (c)); 2757 GNUNET_NT_to_string (c));
2758 GNUNET_asprintf (&entry_in, 2758 GNUNET_asprintf (&entry_in,
2759 "%s_QUOTA_IN", 2759 "%s_QUOTA_IN",
2760 GNUNET_ATS_print_network_type (c)); 2760 GNUNET_NT_to_string (c));
2761 2761
2762 /* quota out */ 2762 /* quota out */
2763 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, &quota_out_str)) 2763 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, &quota_out_str))
@@ -2777,7 +2777,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2777 { 2777 {
2778 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2778 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2779 _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"), 2779 _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"),
2780 GNUNET_ATS_print_network_type (c), 2780 GNUNET_NT_to_string (c),
2781 quota_out_str, 2781 quota_out_str,
2782 GNUNET_ATS_DefaultBandwidth); 2782 GNUNET_ATS_DefaultBandwidth);
2783 out_dest[c] = GNUNET_ATS_DefaultBandwidth; 2783 out_dest[c] = GNUNET_ATS_DefaultBandwidth;
@@ -2786,7 +2786,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2786 { 2786 {
2787 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2787 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2788 "Outbound quota configure for network `%s' is %llu\n", 2788 "Outbound quota configure for network `%s' is %llu\n",
2789 GNUNET_ATS_print_network_type (c), 2789 GNUNET_NT_to_string (c),
2790 out_dest[c]); 2790 out_dest[c]);
2791 } 2791 }
2792 GNUNET_free (quota_out_str); 2792 GNUNET_free (quota_out_str);
@@ -2795,7 +2795,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2795 { 2795 {
2796 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2796 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2797 _("No outbound quota configured for network `%s', assigning default bandwidth %llu\n"), 2797 _("No outbound quota configured for network `%s', assigning default bandwidth %llu\n"),
2798 GNUNET_ATS_print_network_type (c), 2798 GNUNET_NT_to_string (c),
2799 GNUNET_ATS_DefaultBandwidth); 2799 GNUNET_ATS_DefaultBandwidth);
2800 out_dest[c] = GNUNET_ATS_DefaultBandwidth; 2800 out_dest[c] = GNUNET_ATS_DefaultBandwidth;
2801 } 2801 }
@@ -2818,7 +2818,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2818 { 2818 {
2819 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2819 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2820 _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"), 2820 _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"),
2821 GNUNET_ATS_print_network_type (c), 2821 GNUNET_NT_to_string (c),
2822 quota_in_str, 2822 quota_in_str,
2823 GNUNET_ATS_DefaultBandwidth); 2823 GNUNET_ATS_DefaultBandwidth);
2824 in_dest[c] = GNUNET_ATS_DefaultBandwidth; 2824 in_dest[c] = GNUNET_ATS_DefaultBandwidth;
@@ -2827,7 +2827,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2827 { 2827 {
2828 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2828 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2829 "Inbound quota configured for network `%s' is %llu\n", 2829 "Inbound quota configured for network `%s' is %llu\n",
2830 GNUNET_ATS_print_network_type (c), 2830 GNUNET_NT_to_string (c),
2831 in_dest[c]); 2831 in_dest[c]);
2832 } 2832 }
2833 GNUNET_free (quota_in_str); 2833 GNUNET_free (quota_in_str);
@@ -2836,19 +2836,19 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
2836 { 2836 {
2837 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2837 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2838 _("No outbound quota configure for network `%s', assigning default bandwidth %llu\n"), 2838 _("No outbound quota configure for network `%s', assigning default bandwidth %llu\n"),
2839 GNUNET_ATS_print_network_type (c), 2839 GNUNET_NT_to_string (c),
2840 GNUNET_ATS_DefaultBandwidth); 2840 GNUNET_ATS_DefaultBandwidth);
2841 out_dest[c] = GNUNET_ATS_DefaultBandwidth; 2841 out_dest[c] = GNUNET_ATS_DefaultBandwidth;
2842 } 2842 }
2843 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 2843 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
2844 "Loaded quota for network `%s' (in/out): %llu %llu\n", 2844 "Loaded quota for network `%s' (in/out): %llu %llu\n",
2845 GNUNET_ATS_print_network_type (c), 2845 GNUNET_NT_to_string (c),
2846 in_dest[c], 2846 in_dest[c],
2847 out_dest[c]); 2847 out_dest[c]);
2848 GNUNET_free (entry_out); 2848 GNUNET_free (entry_out);
2849 GNUNET_free (entry_in); 2849 GNUNET_free (entry_in);
2850 } 2850 }
2851 return GNUNET_ATS_NetworkTypeCount; 2851 return GNUNET_NT_COUNT;
2852} 2852}
2853 2853
2854 2854
@@ -3048,16 +3048,16 @@ GNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type)
3048 sh->env.addresses = sh->addresses; 3048 sh->env.addresses = sh->addresses;
3049 sh->env.bandwidth_changed_cb = &solver_bandwidth_changed_cb; 3049 sh->env.bandwidth_changed_cb = &solver_bandwidth_changed_cb;
3050 sh->env.get_preferences = &get_preferences_cb; 3050 sh->env.get_preferences = &get_preferences_cb;
3051 sh->env.network_count = GNUNET_ATS_NetworkTypeCount; 3051 sh->env.network_count = GNUNET_NT_COUNT;
3052 sh->env.info_cb = &solver_info_cb; 3052 sh->env.info_cb = &solver_info_cb;
3053 sh->env.network_count = GNUNET_ATS_NetworkTypeCount; 3053 sh->env.network_count = GNUNET_NT_COUNT;
3054 3054
3055 /* start normalization */ 3055 /* start normalization */
3056 GAS_normalization_start (); 3056 GAS_normalization_start ();
3057 3057
3058 /* load quotas */ 3058 /* load quotas */
3059 if (GNUNET_ATS_NetworkTypeCount != GNUNET_ATS_solvers_load_quotas (e->cfg, 3059 if (GNUNET_NT_COUNT != GNUNET_ATS_solvers_load_quotas (e->cfg,
3060 sh->env.out_quota, sh->env.in_quota, GNUNET_ATS_NetworkTypeCount)) 3060 sh->env.out_quota, sh->env.in_quota, GNUNET_NT_COUNT))
3061 { 3061 {
3062 GNUNET_break(0); 3062 GNUNET_break(0);
3063 GNUNET_free (sh->plugin); 3063 GNUNET_free (sh->plugin);
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 55fa22681..345409d54 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -223,7 +223,7 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
223 GNUNET_break (0); 223 GNUNET_break (0);
224 return; 224 return;
225 } 225 }
226 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 226 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
227 new_address = create_address (peer, 227 new_address = create_address (peer,
228 plugin_name, 228 plugin_name,
229 plugin_addr, 229 plugin_addr,
@@ -293,7 +293,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
293 "Received ADDRESS_UPDATE for peer `%s' slot %u\n", 293 "Received ADDRESS_UPDATE for peer `%s' slot %u\n",
294 GNUNET_i2s (peer), 294 GNUNET_i2s (peer),
295 (unsigned int) session_id); 295 (unsigned int) session_id);
296 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 296 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
297 /* Update address */ 297 /* Update address */
298 aa->t_last_activity = GNUNET_TIME_absolute_get(); 298 aa->t_last_activity = GNUNET_TIME_absolute_get();
299 aa->properties = *prop; 299 aa->properties = *prop;
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h
index d4dc483eb..7b9472a67 100644
--- a/src/ats/gnunet-service-ats_addresses.h
+++ b/src/ats/gnunet-service-ats_addresses.h
@@ -57,14 +57,14 @@
57 * network an inbound and outbound quota will be specified. The available 57 * network an inbound and outbound quota will be specified. The available
58 * networks and addtional helper varaibles are defined in 58 * networks and addtional helper varaibles are defined in
59 * gnunet_ats_service.h. At the moment 5 networks are defined: 59 * gnunet_ats_service.h. At the moment 5 networks are defined:
60 * * GNUNET_ATS_NET_UNSPECIFIED 60 * * GNUNET_NT_UNSPECIFIED
61 * * GNUNET_ATS_NET_LOOPBACK 61 * * GNUNET_NT_LOOPBACK
62 * * GNUNET_ATS_NET_LAN 62 * * GNUNET_NT_LAN
63 * * GNUNET_ATS_NET_WAN 63 * * GNUNET_NT_WAN
64 * * GNUNET_ATS_NET_WLAN 64 * * GNUNET_NT_WLAN
65 * 65 *
66 * The total number of networks defined is stored in 66 * The total number of networks defined is stored in
67 * GNUNET_ATS_NetworkTypeCount GNUNET_ATS_NetworkType can be used array 67 * GNUNET_NT_COUNT GNUNET_ATS_NetworkType can be used array
68 * initializer for an int array, while GNUNET_ATS_NetworkType is an 68 * initializer for an int array, while GNUNET_ATS_NetworkType is an
69 * initializer for a char array containing a string description of all 69 * initializer for a char array containing a string description of all
70 * networks 70 * networks
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index 92a9aca6d..e3a863f2a 100644
--- a/src/ats/gnunet-service-ats_performance.c
+++ b/src/ats/gnunet-service-ats_performance.c
@@ -82,7 +82,7 @@ notify_client (struct GNUNET_SERVICE_Client *client,
82 char *addrp; 82 char *addrp;
83 83
84 if (NULL != prop) 84 if (NULL != prop)
85 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 85 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
86 GNUNET_assert (msize < GNUNET_MAX_MESSAGE_SIZE); 86 GNUNET_assert (msize < GNUNET_MAX_MESSAGE_SIZE);
87 msg = (struct PeerInformationMessage *) buf; 87 msg = (struct PeerInformationMessage *) buf;
88 msg->header.size = htons (msize); 88 msg->header.size = htons (msize);
@@ -151,7 +151,7 @@ GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
151 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) 151 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
152{ 152{
153 GNUNET_break ( (NULL == prop) || 153 GNUNET_break ( (NULL == prop) ||
154 (GNUNET_ATS_NET_UNSPECIFIED != prop->scope) ); 154 (GNUNET_NT_UNSPECIFIED != prop->scope) );
155 notify_client (NULL, 155 notify_client (NULL,
156 peer, 156 peer,
157 plugin_name, 157 plugin_name,
@@ -205,7 +205,7 @@ peerinfo_it (void *cls,
205 plugin_name, 205 plugin_name,
206 (unsigned int) ntohl (bandwidth_out.value__), 206 (unsigned int) ntohl (bandwidth_out.value__),
207 (unsigned int) ntohl (bandwidth_in.value__)); 207 (unsigned int) ntohl (bandwidth_in.value__));
208 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 208 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
209 notify_client (client, 209 notify_client (client,
210 id, 210 id,
211 plugin_name, 211 plugin_name,
diff --git a/src/ats/gnunet-service-ats_plugins.c b/src/ats/gnunet-service-ats_plugins.c
index 4b998b982..1ca39ff15 100644
--- a/src/ats/gnunet-service-ats_plugins.c
+++ b/src/ats/gnunet-service-ats_plugins.c
@@ -274,7 +274,7 @@ bandwidth_changed_cb (void *cls,
274static unsigned long long 274static unsigned long long
275parse_quota (const char *quota_str, 275parse_quota (const char *quota_str,
276 const char *direction, 276 const char *direction,
277 enum GNUNET_ATS_Network_Type network) 277 enum GNUNET_NetworkType network)
278{ 278{
279 int res; 279 int res;
280 unsigned long long ret; 280 unsigned long long ret;
@@ -301,7 +301,7 @@ parse_quota (const char *quota_str,
301 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 301 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
302 _("Could not load %s quota for network `%s': `%s', assigning default bandwidth %llu\n"), 302 _("Could not load %s quota for network `%s': `%s', assigning default bandwidth %llu\n"),
303 direction, 303 direction,
304 GNUNET_ATS_print_network_type (network), 304 GNUNET_NT_to_string (network),
305 quota_str, 305 quota_str,
306 (unsigned long long) GNUNET_ATS_DefaultBandwidth); 306 (unsigned long long) GNUNET_ATS_DefaultBandwidth);
307 ret = GNUNET_ATS_DefaultBandwidth; 307 ret = GNUNET_ATS_DefaultBandwidth;
@@ -311,7 +311,7 @@ parse_quota (const char *quota_str,
311 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 311 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
312 _("%s quota configured for network `%s' is %llu\n"), 312 _("%s quota configured for network `%s' is %llu\n"),
313 direction, 313 direction,
314 GNUNET_ATS_print_network_type (network), 314 GNUNET_NT_to_string (network),
315 ret); 315 ret);
316 } 316 }
317 return ret; 317 return ret;
@@ -329,7 +329,7 @@ parse_quota (const char *quota_str,
329 */ 329 */
330static unsigned long long 330static unsigned long long
331load_quota (const struct GNUNET_CONFIGURATION_Handle *cfg, 331load_quota (const struct GNUNET_CONFIGURATION_Handle *cfg,
332 enum GNUNET_ATS_Network_Type type, 332 enum GNUNET_NetworkType type,
333 const char *direction) 333 const char *direction)
334{ 334{
335 char *entry; 335 char *entry;
@@ -338,7 +338,7 @@ load_quota (const struct GNUNET_CONFIGURATION_Handle *cfg,
338 338
339 GNUNET_asprintf (&entry, 339 GNUNET_asprintf (&entry,
340 "%s_QUOTA_%s", 340 "%s_QUOTA_%s",
341 GNUNET_ATS_print_network_type (type), 341 GNUNET_NT_to_string (type),
342 direction); 342 direction);
343 if (GNUNET_OK == 343 if (GNUNET_OK ==
344 GNUNET_CONFIGURATION_get_value_string (cfg, 344 GNUNET_CONFIGURATION_get_value_string (cfg,
@@ -356,7 +356,7 @@ load_quota (const struct GNUNET_CONFIGURATION_Handle *cfg,
356 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 356 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
357 _("No %s-quota configured for network `%s', assigning default bandwidth %llu\n"), 357 _("No %s-quota configured for network `%s', assigning default bandwidth %llu\n"),
358 direction, 358 direction,
359 GNUNET_ATS_print_network_type (type), 359 GNUNET_NT_to_string (type),
360 (unsigned long long) GNUNET_ATS_DefaultBandwidth); 360 (unsigned long long) GNUNET_ATS_DefaultBandwidth);
361 ret = GNUNET_ATS_DefaultBandwidth; 361 ret = GNUNET_ATS_DefaultBandwidth;
362 } 362 }
@@ -382,7 +382,7 @@ load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
382{ 382{
383 unsigned int c; 383 unsigned int c;
384 384
385 for (c = 0; (c < GNUNET_ATS_NetworkTypeCount) && (c < dest_length); c++) 385 for (c = 0; (c < GNUNET_NT_COUNT) && (c < dest_length); c++)
386 { 386 {
387 in_dest[c] = load_quota (cfg, 387 in_dest[c] = load_quota (cfg,
388 c, 388 c,
@@ -392,7 +392,7 @@ load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg,
392 "in"); 392 "in");
393 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 393 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
394 "Loaded quota for network `%s' (in/out): %llu %llu\n", 394 "Loaded quota for network `%s' (in/out): %llu %llu\n",
395 GNUNET_ATS_print_network_type (c), 395 GNUNET_NT_to_string (c),
396 in_dest[c], 396 in_dest[c],
397 out_dest[c]); 397 out_dest[c]);
398 } 398 }
@@ -431,11 +431,11 @@ GAS_plugin_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
431 env.cfg = cfg; 431 env.cfg = cfg;
432 env.stats = GSA_stats; 432 env.stats = GSA_stats;
433 env.addresses = GSA_addresses; 433 env.addresses = GSA_addresses;
434 env.network_count = GNUNET_ATS_NetworkTypeCount; 434 env.network_count = GNUNET_NT_COUNT;
435 load_quotas (cfg, 435 load_quotas (cfg,
436 env.out_quota, 436 env.out_quota,
437 env.in_quota, 437 env.in_quota,
438 GNUNET_ATS_NetworkTypeCount); 438 GNUNET_NT_COUNT);
439 GNUNET_asprintf (&plugin, 439 GNUNET_asprintf (&plugin,
440 "libgnunet_plugin_ats_%s", 440 "libgnunet_plugin_ats_%s",
441 mode_str); 441 mode_str);
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 0a1ad99cd..aeea162cc 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -139,7 +139,7 @@ GAS_handle_address_add (const struct AddressAddMessage *m)
139 GNUNET_NO); 139 GNUNET_NO);
140 GNUNET_ATS_properties_ntoh (&prop, 140 GNUNET_ATS_properties_ntoh (&prop,
141 &m->properties); 141 &m->properties);
142 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop.scope); 142 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop.scope);
143 GAS_addresses_add (&m->peer, 143 GAS_addresses_add (&m->peer,
144 plugin_name, 144 plugin_name,
145 address, 145 address,
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index c2885bbef..73871c053 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -1111,11 +1111,11 @@ perf_run_iteration (void)
1111 /* Add address */ 1111 /* Add address */
1112 1112
1113 /* Random network selection */ 1113 /* Random network selection */
1114 //net = 1 + GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ATS_NetworkTypeCount - 1); 1114 //net = 1 + GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_NT_COUNT - 1);
1115 /* Random equally distributed network selection */ 1115 /* Random equally distributed network selection */
1116 net = 1 + (ca % (GNUNET_ATS_NetworkTypeCount - 1)); 1116 net = 1 + (ca % (GNUNET_NT_COUNT - 1));
1117 /* fprintf (stderr, "Network: %u `%s'\n", 1117 /* fprintf (stderr, "Network: %u `%s'\n",
1118 * mod_net , GNUNET_ATS_print_network_type(mod_net)); */ 1118 * mod_net , GNUNET_NT_to_string(mod_net)); */
1119 1119
1120 cur_addr->atsi = GNUNET_new (struct GNUNET_ATS_Information); 1120 cur_addr->atsi = GNUNET_new (struct GNUNET_ATS_Information);
1121 cur_addr->atsi_count = 1; 1121 cur_addr->atsi_count = 1;
@@ -1127,7 +1127,7 @@ perf_run_iteration (void)
1127 perf_address_initial_update (NULL, ph.addresses, cur_addr); 1127 perf_address_initial_update (NULL, ph.addresses, cur_addr);
1128 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 1128 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
1129 "Adding address for peer %u address %u in network %s\n", cp, ca, 1129 "Adding address for peer %u address %u in network %s\n", cp, ca,
1130 GNUNET_ATS_print_network_type(net)); 1130 GNUNET_NT_to_string(net));
1131 } 1131 }
1132 /* Notify solver about request */ 1132 /* Notify solver about request */
1133 ph.sf->s_get (ph.sf->cls, &ph.peers[cp].id); 1133 ph.sf->s_get (ph.sf->cls, &ph.peers[cp].id);
@@ -1210,8 +1210,8 @@ run (void *cls, char * const *args, const char *cfgfile,
1210 char *solver; 1210 char *solver;
1211 char *plugin; 1211 char *plugin;
1212 struct GNUNET_CONFIGURATION_Handle *solver_cfg; 1212 struct GNUNET_CONFIGURATION_Handle *solver_cfg;
1213 unsigned long long quotas_in[GNUNET_ATS_NetworkTypeCount]; 1213 unsigned long long quotas_in[GNUNET_NT_COUNT];
1214 unsigned long long quotas_out[GNUNET_ATS_NetworkTypeCount]; 1214 unsigned long long quotas_out[GNUNET_NT_COUNT];
1215 int c; 1215 int c;
1216 int c2; 1216 int c2;
1217 1217
@@ -1286,8 +1286,8 @@ run (void *cls, char * const *args, const char *cfgfile,
1286 end_now (1); 1286 end_now (1);
1287 return; 1287 return;
1288 } 1288 }
1289 if (GNUNET_ATS_NetworkTypeCount != load_quotas (solver_cfg, 1289 if (GNUNET_NT_COUNT != load_quotas (solver_cfg,
1290 quotas_out, quotas_in, GNUNET_ATS_NetworkTypeCount)) 1290 quotas_out, quotas_in, GNUNET_NT_COUNT))
1291 { 1291 {
1292 GNUNET_break(0); 1292 GNUNET_break(0);
1293 end_now (1); 1293 end_now (1);
@@ -1306,16 +1306,16 @@ run (void *cls, char * const *args, const char *cfgfile,
1306 ph.env.bandwidth_changed_cb = bandwidth_changed_cb; 1306 ph.env.bandwidth_changed_cb = bandwidth_changed_cb;
1307 ph.env.get_connectivity = &get_connectivity_cb; 1307 ph.env.get_connectivity = &get_connectivity_cb;
1308 ph.env.get_preferences = &get_preferences_cb; 1308 ph.env.get_preferences = &get_preferences_cb;
1309 ph.env.network_count = GNUNET_ATS_NetworkTypeCount; 1309 ph.env.network_count = GNUNET_NT_COUNT;
1310 ph.env.info_cb = &solver_info_cb; 1310 ph.env.info_cb = &solver_info_cb;
1311 1311
1312 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) 1312 for (c = 0; c < GNUNET_NT_COUNT; c++)
1313 { 1313 {
1314 ph.env.out_quota[c] = quotas_out[c]; 1314 ph.env.out_quota[c] = quotas_out[c];
1315 ph.env.in_quota[c] = quotas_in[c]; 1315 ph.env.in_quota[c] = quotas_in[c];
1316 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1316 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1317 "Loading network quotas: `%s' %llu %llu \n", 1317 "Loading network quotas: `%s' %llu %llu \n",
1318 GNUNET_ATS_print_network_type (c), 1318 GNUNET_NT_to_string (c),
1319 ph.env.out_quota[c], 1319 ph.env.out_quota[c],
1320 ph.env.in_quota[c]); 1320 ph.env.in_quota[c]);
1321 } 1321 }
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index 544b8d97f..8d2a872ab 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -148,7 +148,7 @@ struct MLP_Problem
148 /* Row indices quality metrics */ 148 /* Row indices quality metrics */
149 int r_q[RQ_QUALITY_METRIC_COUNT]; 149 int r_q[RQ_QUALITY_METRIC_COUNT];
150 /* Row indices ATS network quotas */ 150 /* Row indices ATS network quotas */
151 int r_quota[GNUNET_ATS_NetworkTypeCount]; 151 int r_quota[GNUNET_NT_COUNT];
152 152
153 /* Column index Diversity (D) column */ 153 /* Column index Diversity (D) column */
154 int c_d; 154 int c_d;
@@ -211,12 +211,12 @@ struct MLP_Variables
211 211
212 /* Quotas */ 212 /* Quotas */
213 /* Array mapping array index to ATS network */ 213 /* Array mapping array index to ATS network */
214 int quota_index[GNUNET_ATS_NetworkTypeCount]; 214 int quota_index[GNUNET_NT_COUNT];
215 /* Outbound quotas */ 215 /* Outbound quotas */
216 unsigned long long quota_out[GNUNET_ATS_NetworkTypeCount]; 216 unsigned long long quota_out[GNUNET_NT_COUNT];
217 /* Inbound quotas */ 217 /* Inbound quotas */
218 218
219 unsigned long long quota_in[GNUNET_ATS_NetworkTypeCount]; 219 unsigned long long quota_in[GNUNET_NT_COUNT];
220 220
221 /* ATS ressource costs 221 /* ATS ressource costs
222 * array with GNUNET_ATS_QualityPropertiesCount elements 222 * array with GNUNET_ATS_QualityPropertiesCount elements
@@ -601,7 +601,7 @@ mlp_delete_problem (struct GAS_MLP_Handle *mlp)
601 mlp->p.r_c9 = MLP_UNDEFINED; 601 mlp->p.r_c9 = MLP_UNDEFINED;
602 for (c = 0; c < RQ_QUALITY_METRIC_COUNT ; c ++) 602 for (c = 0; c < RQ_QUALITY_METRIC_COUNT ; c ++)
603 mlp->p.r_q[c] = MLP_UNDEFINED; 603 mlp->p.r_q[c] = MLP_UNDEFINED;
604 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c ++) 604 for (c = 0; c < GNUNET_NT_COUNT; c ++)
605 mlp->p.r_quota[c] = MLP_UNDEFINED; 605 mlp->p.r_quota[c] = MLP_UNDEFINED;
606 mlp->p.ci = MLP_UNDEFINED; 606 mlp->p.ci = MLP_UNDEFINED;
607 607
@@ -969,20 +969,20 @@ mlp_create_problem_add_address_information (void *cls,
969 } 969 }
970 970
971 addr_net = address->properties.scope; 971 addr_net = address->properties.scope;
972 for (addr_net_index = 0; addr_net_index < GNUNET_ATS_NetworkTypeCount; addr_net_index++) 972 for (addr_net_index = 0; addr_net_index < GNUNET_NT_COUNT; addr_net_index++)
973 { 973 {
974 if (mlp->pv.quota_index[addr_net_index] == addr_net) 974 if (mlp->pv.quota_index[addr_net_index] == addr_net)
975 break; 975 break;
976 } 976 }
977 977
978 if (addr_net_index >= GNUNET_ATS_NetworkTypeCount) 978 if (addr_net_index >= GNUNET_NT_COUNT)
979 { 979 {
980 GNUNET_break (0); 980 GNUNET_break (0);
981 return GNUNET_OK; 981 return GNUNET_OK;
982 } 982 }
983 983
984 max_quota = 0; 984 max_quota = 0;
985 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) 985 for (c = 0; c < GNUNET_NT_COUNT; c++)
986 { 986 {
987 if (mlp->pv.quota_out[c] > max_quota) 987 if (mlp->pv.quota_out[c] > max_quota)
988 max_quota = mlp->pv.quota_out[c]; 988 max_quota = mlp->pv.quota_out[c];
@@ -1131,11 +1131,11 @@ mlp_create_problem_add_invariant_rows (struct GAS_MLP_Handle *mlp, struct MLP_Pr
1131 p->r_c4 = mlp_create_problem_create_constraint (p, "c4", GLP_LO, (mlp->pv.n_min > p->num_peers) ? p->num_peers : mlp->pv.n_min, 0.0); 1131 p->r_c4 = mlp_create_problem_create_constraint (p, "c4", GLP_LO, (mlp->pv.n_min > p->num_peers) ? p->num_peers : mlp->pv.n_min, 0.0);
1132 1132
1133 /* Rows for c 10) Enforce network quotas */ 1133 /* Rows for c 10) Enforce network quotas */
1134 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) 1134 for (c = 0; c < GNUNET_NT_COUNT; c++)
1135 { 1135 {
1136 char * text; 1136 char * text;
1137 GNUNET_asprintf(&text, "c10_quota_ats_%s", 1137 GNUNET_asprintf(&text, "c10_quota_ats_%s",
1138 GNUNET_ATS_print_network_type(mlp->pv.quota_index[c])); 1138 GNUNET_NT_to_string(mlp->pv.quota_index[c]));
1139 p->r_quota[c] = mlp_create_problem_create_constraint (p, text, GLP_DB, 0.0, mlp->pv.quota_out[c]); 1139 p->r_quota[c] = mlp_create_problem_create_constraint (p, text, GLP_DB, 0.0, mlp->pv.quota_out[c]);
1140 GNUNET_free (text); 1140 GNUNET_free (text);
1141 } 1141 }
@@ -1853,7 +1853,7 @@ GAS_mlp_address_add (void *solver,
1853{ 1853{
1854 struct GAS_MLP_Handle *mlp = solver; 1854 struct GAS_MLP_Handle *mlp = solver;
1855 1855
1856 if (GNUNET_ATS_NetworkTypeCount <= network) 1856 if (GNUNET_NT_COUNT <= network)
1857 { 1857 {
1858 GNUNET_break (0); 1858 GNUNET_break (0);
1859 return; 1859 return;
@@ -2651,7 +2651,7 @@ libgnunet_plugin_ats_mlp_init (void *cls)
2651 n_min = MLP_DEFAULT_MIN_CONNECTIONS; 2651 n_min = MLP_DEFAULT_MIN_CONNECTIONS;
2652 2652
2653 /* Init network quotas */ 2653 /* Init network quotas */
2654 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) 2654 for (c = 0; c < GNUNET_NT_COUNT; c++)
2655 { 2655 {
2656 mlp->pv.quota_index[c] = c; 2656 mlp->pv.quota_index[c] = c;
2657 mlp->pv.quota_out[c] = env->out_quota[c]; 2657 mlp->pv.quota_out[c] = env->out_quota[c];
@@ -2659,7 +2659,7 @@ libgnunet_plugin_ats_mlp_init (void *cls)
2659 2659
2660 LOG (GNUNET_ERROR_TYPE_INFO, 2660 LOG (GNUNET_ERROR_TYPE_INFO,
2661 "Quota for network `%s' (in/out) %llu/%llu\n", 2661 "Quota for network `%s' (in/out) %llu/%llu\n",
2662 GNUNET_ATS_print_network_type (c), 2662 GNUNET_NT_to_string (c),
2663 mlp->pv.quota_out[c], 2663 mlp->pv.quota_out[c],
2664 mlp->pv.quota_in[c]); 2664 mlp->pv.quota_in[c]);
2665 /* Check if defined quota could make problem unsolvable */ 2665 /* Check if defined quota could make problem unsolvable */
@@ -2667,7 +2667,7 @@ libgnunet_plugin_ats_mlp_init (void *cls)
2667 { 2667 {
2668 LOG (GNUNET_ERROR_TYPE_INFO, 2668 LOG (GNUNET_ERROR_TYPE_INFO,
2669 _("Adjusting inconsistent outbound quota configuration for network `%s', is %llu must be at least %llu\n"), 2669 _("Adjusting inconsistent outbound quota configuration for network `%s', is %llu must be at least %llu\n"),
2670 GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]), 2670 GNUNET_NT_to_string(mlp->pv.quota_index[c]),
2671 mlp->pv.quota_out[c], 2671 mlp->pv.quota_out[c],
2672 (n_min * b_min)); 2672 (n_min * b_min));
2673 mlp->pv.quota_out[c] = (n_min * b_min); 2673 mlp->pv.quota_out[c] = (n_min * b_min);
@@ -2676,7 +2676,7 @@ libgnunet_plugin_ats_mlp_init (void *cls)
2676 { 2676 {
2677 LOG (GNUNET_ERROR_TYPE_INFO, 2677 LOG (GNUNET_ERROR_TYPE_INFO,
2678 _("Adjusting inconsistent inbound quota configuration for network `%s', is %llu must be at least %llu\n"), 2678 _("Adjusting inconsistent inbound quota configuration for network `%s', is %llu must be at least %llu\n"),
2679 GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]), 2679 GNUNET_NT_to_string(mlp->pv.quota_index[c]),
2680 mlp->pv.quota_in[c], 2680 mlp->pv.quota_in[c],
2681 (n_min * b_min)); 2681 (n_min * b_min));
2682 mlp->pv.quota_in[c] = (n_min * b_min); 2682 mlp->pv.quota_in[c] = (n_min * b_min);
@@ -2686,7 +2686,7 @@ libgnunet_plugin_ats_mlp_init (void *cls)
2686 { 2686 {
2687 LOG (GNUNET_ERROR_TYPE_INFO, 2687 LOG (GNUNET_ERROR_TYPE_INFO,
2688 _("Adjusting outbound quota configuration for network `%s'from %llu to %.0f\n"), 2688 _("Adjusting outbound quota configuration for network `%s'from %llu to %.0f\n"),
2689 GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]), 2689 GNUNET_NT_to_string(mlp->pv.quota_index[c]),
2690 mlp->pv.quota_out[c], 2690 mlp->pv.quota_out[c],
2691 mlp->pv.BIG_M); 2691 mlp->pv.BIG_M);
2692 mlp->pv.quota_out[c] = mlp->pv.BIG_M ; 2692 mlp->pv.quota_out[c] = mlp->pv.BIG_M ;
@@ -2695,7 +2695,7 @@ libgnunet_plugin_ats_mlp_init (void *cls)
2695 { 2695 {
2696 LOG (GNUNET_ERROR_TYPE_INFO, 2696 LOG (GNUNET_ERROR_TYPE_INFO,
2697 _("Adjusting inbound quota configuration for network `%s' from %llu to %.0f\n"), 2697 _("Adjusting inbound quota configuration for network `%s' from %llu to %.0f\n"),
2698 GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]), 2698 GNUNET_NT_to_string(mlp->pv.quota_index[c]),
2699 mlp->pv.quota_in[c], 2699 mlp->pv.quota_in[c],
2700 mlp->pv.BIG_M); 2700 mlp->pv.BIG_M);
2701 mlp->pv.quota_in[c] = mlp->pv.BIG_M ; 2701 mlp->pv.quota_in[c] = mlp->pv.BIG_M ;
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c
index 08fb7a9a7..b3299b9f0 100644
--- a/src/ats/plugin_ats_proportional.c
+++ b/src/ats/plugin_ats_proportional.c
@@ -139,7 +139,7 @@ struct Network
139 /** 139 /**
140 * ATS network type 140 * ATS network type
141 */ 141 */
142 enum GNUNET_ATS_Network_Type type; 142 enum GNUNET_NetworkType type;
143 143
144 /** 144 /**
145 * Number of active addresses for this network 145 * Number of active addresses for this network
@@ -429,7 +429,7 @@ distribute_bandwidth_in_network (struct GAS_PROPORTIONAL_Handle *s,
429 { 429 {
430 LOG (GNUNET_ERROR_TYPE_DEBUG, 430 LOG (GNUNET_ERROR_TYPE_DEBUG,
431 "Redistributing bandwidth in network %s with %u active and %u total addresses\n", 431 "Redistributing bandwidth in network %s with %u active and %u total addresses\n",
432 GNUNET_ATS_print_network_type(n->type), 432 GNUNET_NT_to_string(n->type),
433 n->active_addresses, 433 n->active_addresses,
434 n->total_addresses); 434 n->total_addresses);
435 s->env->info_cb (s->env->cls, 435 s->env->info_cb (s->env->cls,
@@ -1181,7 +1181,7 @@ libgnunet_plugin_ats_proportional_init (void *cls)
1181 cur->type = c; 1181 cur->type = c;
1182 cur->total_quota_in = env->in_quota[c]; 1182 cur->total_quota_in = env->in_quota[c];
1183 cur->total_quota_out = env->out_quota[c]; 1183 cur->total_quota_out = env->out_quota[c];
1184 cur->desc = GNUNET_ATS_print_network_type (c); 1184 cur->desc = GNUNET_NT_to_string (c);
1185 GNUNET_asprintf (&cur->stat_total, 1185 GNUNET_asprintf (&cur->stat_total,
1186 "# ATS addresses %s total", 1186 "# ATS addresses %s total",
1187 cur->desc); 1187 cur->desc);
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index 204852085..44c60d1dd 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -340,7 +340,7 @@ struct RIL_Scope
340 /** 340 /**
341 * ATS network type 341 * ATS network type
342 */ 342 */
343 enum GNUNET_ATS_Network_Type type; 343 enum GNUNET_NetworkType type;
344 344
345 /** 345 /**
346 * Total available inbound bandwidth 346 * Total available inbound bandwidth
@@ -1593,7 +1593,7 @@ ril_get_network (struct GAS_RIL_Handle *s, uint32_t type)
1593 * @return GNUNET_YES if there are theoretically enough resources left 1593 * @return GNUNET_YES if there are theoretically enough resources left
1594 */ 1594 */
1595static int 1595static int
1596ril_network_is_not_full (struct GAS_RIL_Handle *solver, enum GNUNET_ATS_Network_Type network) 1596ril_network_is_not_full (struct GAS_RIL_Handle *solver, enum GNUNET_NetworkType network)
1597{ 1597{
1598 struct RIL_Scope *net; 1598 struct RIL_Scope *net;
1599 struct RIL_Peer_Agent *agent; 1599 struct RIL_Peer_Agent *agent;
@@ -1720,7 +1720,7 @@ ril_network_count_active_agents (struct GAS_RIL_Handle *solver, struct RIL_Scope
1720 * @return the sum of the assigned bandwidths 1720 * @return the sum of the assigned bandwidths
1721 */ 1721 */
1722static unsigned long long 1722static unsigned long long
1723ril_network_get_assigned (struct GAS_RIL_Handle *solver, enum GNUNET_ATS_Network_Type type, int direction_in) 1723ril_network_get_assigned (struct GAS_RIL_Handle *solver, enum GNUNET_NetworkType type, int direction_in)
1724{ 1724{
1725 struct RIL_Peer_Agent *cur; 1725 struct RIL_Peer_Agent *cur;
1726 struct RIL_Scope *net; 1726 struct RIL_Scope *net;
@@ -1755,7 +1755,7 @@ ril_network_get_assigned (struct GAS_RIL_Handle *solver, enum GNUNET_ATS_Network
1755 * @return the sum of the utilized bandwidths (in bytes/second) 1755 * @return the sum of the utilized bandwidths (in bytes/second)
1756 */ 1756 */
1757static unsigned long long 1757static unsigned long long
1758ril_network_get_utilized (struct GAS_RIL_Handle *solver, enum GNUNET_ATS_Network_Type type, int direction_in) 1758ril_network_get_utilized (struct GAS_RIL_Handle *solver, enum GNUNET_NetworkType type, int direction_in)
1759{ 1759{
1760 struct RIL_Peer_Agent *cur; 1760 struct RIL_Peer_Agent *cur;
1761 struct RIL_Scope *net; 1761 struct RIL_Scope *net;
@@ -2038,7 +2038,7 @@ ril_get_agent (struct GAS_RIL_Handle *solver, const struct GNUNET_PeerIdentity *
2038 * @return whether or not the network is considered active 2038 * @return whether or not the network is considered active
2039 */ 2039 */
2040static int 2040static int
2041ril_network_is_active (struct GAS_RIL_Handle *solver, enum GNUNET_ATS_Network_Type network) 2041ril_network_is_active (struct GAS_RIL_Handle *solver, enum GNUNET_NetworkType network)
2042{ 2042{
2043 struct RIL_Scope *net; 2043 struct RIL_Scope *net;
2044 2044
@@ -2786,7 +2786,7 @@ libgnunet_plugin_ats_ril_init (void *cls)
2786 cur->bw_out_available = env->out_quota[c]; 2786 cur->bw_out_available = env->out_quota[c];
2787 LOG (GNUNET_ERROR_TYPE_DEBUG, 2787 LOG (GNUNET_ERROR_TYPE_DEBUG,
2788 "init() Quotas for %s network: IN %llu - OUT %llu\n", 2788 "init() Quotas for %s network: IN %llu - OUT %llu\n",
2789 GNUNET_ATS_print_network_type(cur->type), 2789 GNUNET_NT_to_string(cur->type),
2790 cur->bw_in_available/1024, 2790 cur->bw_in_available/1024,
2791 cur->bw_out_available/1024); 2791 cur->bw_out_available/1024);
2792 } 2792 }
diff --git a/src/ats/test_ats_api.c b/src/ats/test_ats_api.c
index b449e5066..e049ebe16 100644
--- a/src/ats/test_ats_api.c
+++ b/src/ats/test_ats_api.c
@@ -41,7 +41,7 @@ static struct Command test_commands[] = {
41 .addr_flags = GNUNET_HELLO_ADDRESS_INFO_NONE, 41 .addr_flags = GNUNET_HELLO_ADDRESS_INFO_NONE,
42 .session = 0, 42 .session = 0,
43 .properties = { 43 .properties = {
44 .scope = GNUNET_ATS_NET_LAN 44 .scope = GNUNET_NT_LAN
45 } 45 }
46 } 46 }
47 }, 47 },
@@ -55,7 +55,7 @@ static struct Command test_commands[] = {
55 .addr_flags = GNUNET_HELLO_ADDRESS_INFO_NONE, 55 .addr_flags = GNUNET_HELLO_ADDRESS_INFO_NONE,
56 .session = 0, 56 .session = 0,
57 .properties = { 57 .properties = {
58 .scope = GNUNET_ATS_NET_LAN 58 .scope = GNUNET_NT_LAN
59 }, 59 },
60 .expect_fail = 1 60 .expect_fail = 1
61 } 61 }
@@ -155,7 +155,7 @@ static struct Command test_commands[] = {
155 .addr_num = 0, 155 .addr_num = 0,
156 .session = 0, 156 .session = 0,
157 .properties = { 157 .properties = {
158 .scope = GNUNET_ATS_NET_LAN 158 .scope = GNUNET_NT_LAN
159 } 159 }
160 } 160 }
161 }, 161 },
@@ -184,7 +184,7 @@ static struct Command test_commands[] = {
184 .addr_flags = GNUNET_HELLO_ADDRESS_INFO_NONE, 184 .addr_flags = GNUNET_HELLO_ADDRESS_INFO_NONE,
185 .session = 0, 185 .session = 0,
186 .properties = { 186 .properties = {
187 .scope = GNUNET_ATS_NET_LAN 187 .scope = GNUNET_NT_LAN
188 } 188 }
189 } 189 }
190 }, 190 },
diff --git a/src/ats/test_ats_reservation_api.c b/src/ats/test_ats_reservation_api.c
index 19028cb3c..d175aff48 100644
--- a/src/ats/test_ats_reservation_api.c
+++ b/src/ats/test_ats_reservation_api.c
@@ -42,7 +42,7 @@ static struct Command test_commands[] = {
42 .session = 0, 42 .session = 0,
43 .properties = { 43 .properties = {
44 /* use network with 65k quota! */ 44 /* use network with 65k quota! */
45 .scope = GNUNET_ATS_NET_WAN 45 .scope = GNUNET_NT_WAN
46 } 46 }
47 } 47 }
48 }, 48 },
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c
index 9d73a40c1..17ee2f783 100644
--- a/src/dv/dv_api.c
+++ b/src/dv/dv_api.c
@@ -165,7 +165,7 @@ handle_connect (void *cls,
165 sh->connect_cb (sh->cls, 165 sh->connect_cb (sh->cls,
166 &cm->peer, 166 &cm->peer,
167 ntohl (cm->distance), 167 ntohl (cm->distance),
168 (enum GNUNET_ATS_Network_Type) ntohl (cm->network)); 168 (enum GNUNET_NetworkType) ntohl (cm->network));
169} 169}
170 170
171 171
@@ -222,7 +222,7 @@ handle_distance_update (void *cls,
222 sh->distance_cb (sh->cls, 222 sh->distance_cb (sh->cls,
223 &dum->peer, 223 &dum->peer,
224 ntohl (dum->distance), 224 ntohl (dum->distance),
225 (enum GNUNET_ATS_Network_Type) ntohl (dum->network)); 225 (enum GNUNET_NetworkType) ntohl (dum->network));
226} 226}
227 227
228 228
diff --git a/src/dv/gnunet-dv.c b/src/dv/gnunet-dv.c
index ee60d592f..6f5323c65 100644
--- a/src/dv/gnunet-dv.c
+++ b/src/dv/gnunet-dv.c
@@ -47,7 +47,7 @@ static void
47connect_cb (void *cls, 47connect_cb (void *cls,
48 const struct GNUNET_PeerIdentity *peer, 48 const struct GNUNET_PeerIdentity *peer,
49 uint32_t distance, 49 uint32_t distance,
50 enum GNUNET_ATS_Network_Type network) 50 enum GNUNET_NetworkType network)
51{ 51{
52 fprintf (stderr, "Connect: %s at %u\n", 52 fprintf (stderr, "Connect: %s at %u\n",
53 GNUNET_i2s (peer), 53 GNUNET_i2s (peer),
@@ -67,7 +67,7 @@ static void
67change_cb (void *cls, 67change_cb (void *cls,
68 const struct GNUNET_PeerIdentity *peer, 68 const struct GNUNET_PeerIdentity *peer,
69 uint32_t distance, 69 uint32_t distance,
70 enum GNUNET_ATS_Network_Type network) 70 enum GNUNET_NetworkType network)
71{ 71{
72 fprintf (stderr, "Change: %s at %u\n", 72 fprintf (stderr, "Change: %s at %u\n",
73 GNUNET_i2s (peer), 73 GNUNET_i2s (peer),
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 907963252..f183c77fd 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -222,7 +222,7 @@ struct DirectNeighbor
222 /** 222 /**
223 * The network this peer is in 223 * The network this peer is in
224 */ 224 */
225 enum GNUNET_ATS_Network_Type network; 225 enum GNUNET_NetworkType network;
226 226
227 /** 227 /**
228 * Is this neighbor connected at the core level? 228 * Is this neighbor connected at the core level?
@@ -439,11 +439,11 @@ send_control_to_plugin (const struct GNUNET_MessageHeader *message)
439static void 439static void
440send_distance_change_to_plugin (const struct GNUNET_PeerIdentity *peer, 440send_distance_change_to_plugin (const struct GNUNET_PeerIdentity *peer,
441 uint32_t distance, 441 uint32_t distance,
442 enum GNUNET_ATS_Network_Type network) 442 enum GNUNET_NetworkType network)
443{ 443{
444 struct GNUNET_DV_DistanceUpdateMessage du_msg; 444 struct GNUNET_DV_DistanceUpdateMessage du_msg;
445 445
446 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); 446 GNUNET_break (GNUNET_NT_UNSPECIFIED != network);
447 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 447 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
448 "Delivering DISTANCE_CHANGED for message about peer `%s'\n", 448 "Delivering DISTANCE_CHANGED for message about peer `%s'\n",
449 GNUNET_i2s (peer)); 449 GNUNET_i2s (peer));
@@ -466,7 +466,7 @@ send_distance_change_to_plugin (const struct GNUNET_PeerIdentity *peer,
466static void 466static void
467send_connect_to_plugin (const struct GNUNET_PeerIdentity *target, 467send_connect_to_plugin (const struct GNUNET_PeerIdentity *target,
468 uint32_t distance, 468 uint32_t distance,
469 enum GNUNET_ATS_Network_Type network) 469 enum GNUNET_NetworkType network)
470{ 470{
471 struct GNUNET_DV_ConnectMessage cm; 471 struct GNUNET_DV_ConnectMessage cm;
472 472
@@ -833,7 +833,7 @@ handle_core_connect (void *cls,
833 peer); 833 peer);
834 if (NULL != neighbor) 834 if (NULL != neighbor)
835 { 835 {
836 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != neighbor->network); 836 GNUNET_break (GNUNET_NT_UNSPECIFIED != neighbor->network);
837 GNUNET_break (GNUNET_YES != neighbor->connected); 837 GNUNET_break (GNUNET_YES != neighbor->connected);
838 neighbor->connected = GNUNET_YES; 838 neighbor->connected = GNUNET_YES;
839 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 839 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -857,7 +857,7 @@ handle_core_connect (void *cls,
857 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 857 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
858 neighbor->connected = GNUNET_YES; 858 neighbor->connected = GNUNET_YES;
859 neighbor->distance = 0; /* unknown */ 859 neighbor->distance = 0; /* unknown */
860 neighbor->network = GNUNET_ATS_NET_UNSPECIFIED; 860 neighbor->network = GNUNET_NT_UNSPECIFIED;
861 return neighbor; 861 return neighbor;
862} 862}
863 863
@@ -1123,7 +1123,7 @@ handle_ats_update (void *cls,
1123{ 1123{
1124 struct DirectNeighbor *neighbor; 1124 struct DirectNeighbor *neighbor;
1125 uint32_t distance; 1125 uint32_t distance;
1126 enum GNUNET_ATS_Network_Type network; 1126 enum GNUNET_NetworkType network;
1127 1127
1128 if (NULL == address) 1128 if (NULL == address)
1129 { 1129 {
@@ -1138,7 +1138,7 @@ handle_ats_update (void *cls,
1138 } 1138 }
1139 distance = prop->distance; 1139 distance = prop->distance;
1140 network = prop->scope; 1140 network = prop->scope;
1141 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); 1141 GNUNET_break (GNUNET_NT_UNSPECIFIED != network);
1142 /* check if entry exists */ 1142 /* check if entry exists */
1143 neighbor = GNUNET_CONTAINER_multipeermap_get (direct_neighbors, 1143 neighbor = GNUNET_CONTAINER_multipeermap_get (direct_neighbors,
1144 &address->peer); 1144 &address->peer);
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index 6c815735e..ca4908e95 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -82,7 +82,7 @@ struct GNUNET_ATS_Session
82 /** 82 /**
83 * Current network the next hop peer is located in 83 * Current network the next hop peer is located in
84 */ 84 */
85 enum GNUNET_ATS_Network_Type network; 85 enum GNUNET_NetworkType network;
86 86
87 /** 87 /**
88 * Does the transport service know about this session (and we thus 88 * Does the transport service know about this session (and we thus
@@ -288,12 +288,12 @@ static void
288handle_dv_connect (void *cls, 288handle_dv_connect (void *cls,
289 const struct GNUNET_PeerIdentity *peer, 289 const struct GNUNET_PeerIdentity *peer,
290 uint32_t distance, 290 uint32_t distance,
291 enum GNUNET_ATS_Network_Type network) 291 enum GNUNET_NetworkType network)
292{ 292{
293 struct Plugin *plugin = cls; 293 struct Plugin *plugin = cls;
294 struct GNUNET_ATS_Session *session; 294 struct GNUNET_ATS_Session *session;
295 295
296 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); 296 GNUNET_break (GNUNET_NT_UNSPECIFIED != network);
297 /** 297 /**
298 * This requires transport plugin to be linked to libgnunetats. 298 * This requires transport plugin to be linked to libgnunetats.
299 * If you remove it, also remove libgnunetats linkage from Makefile.am 299 * If you remove it, also remove libgnunetats linkage from Makefile.am
@@ -301,7 +301,7 @@ handle_dv_connect (void *cls,
301 LOG (GNUNET_ERROR_TYPE_DEBUG, 301 LOG (GNUNET_ERROR_TYPE_DEBUG,
302 "Received DV_CONNECT message for peer `%s' with next hop in network %s\n", 302 "Received DV_CONNECT message for peer `%s' with next hop in network %s\n",
303 GNUNET_i2s (peer), 303 GNUNET_i2s (peer),
304 GNUNET_ATS_print_network_type (network)); 304 GNUNET_NT_to_string (network));
305 305
306 session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, 306 session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions,
307 peer); 307 peer);
@@ -359,12 +359,12 @@ static void
359handle_dv_distance_changed (void *cls, 359handle_dv_distance_changed (void *cls,
360 const struct GNUNET_PeerIdentity *peer, 360 const struct GNUNET_PeerIdentity *peer,
361 uint32_t distance, 361 uint32_t distance,
362 enum GNUNET_ATS_Network_Type network) 362 enum GNUNET_NetworkType network)
363{ 363{
364 struct Plugin *plugin = cls; 364 struct Plugin *plugin = cls;
365 struct GNUNET_ATS_Session *session; 365 struct GNUNET_ATS_Session *session;
366 366
367 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); 367 GNUNET_break (GNUNET_NT_UNSPECIFIED != network);
368 LOG (GNUNET_ERROR_TYPE_DEBUG, 368 LOG (GNUNET_ERROR_TYPE_DEBUG,
369 "Received `%s' message for peer `%s': new distance %u\n", 369 "Received `%s' message for peer `%s': new distance %u\n",
370 "DV_DISTANCE_CHANGED", 370 "DV_DISTANCE_CHANGED",
@@ -715,7 +715,7 @@ dv_plugin_update_session_timeout (void *cls,
715 * @param session the session 715 * @param session the session
716 * @return the network type 716 * @return the network type
717 */ 717 */
718static enum GNUNET_ATS_Network_Type 718static enum GNUNET_NetworkType
719dv_get_network (void *cls, 719dv_get_network (void *cls,
720 struct GNUNET_ATS_Session *session) 720 struct GNUNET_ATS_Session *session)
721{ 721{
@@ -731,11 +731,11 @@ dv_get_network (void *cls,
731 * @param address the address 731 * @param address the address
732 * @return the network type 732 * @return the network type
733 */ 733 */
734static enum GNUNET_ATS_Network_Type 734static enum GNUNET_NetworkType
735dv_plugin_get_network_for_address (void *cls, 735dv_plugin_get_network_for_address (void *cls,
736 const struct GNUNET_HELLO_Address *address) 736 const struct GNUNET_HELLO_Address *address)
737{ 737{
738 return GNUNET_ATS_NET_WAN; /* FOR NOW */ 738 return GNUNET_NT_WAN; /* FOR NOW */
739} 739}
740 740
741 741
diff --git a/src/hello/hello-ng.c b/src/hello/hello-ng.c
index fcd1808f4..a16ceb944 100644
--- a/src/hello/hello-ng.c
+++ b/src/hello/hello-ng.c
@@ -62,7 +62,7 @@ struct SignedAddress
62 */ 62 */
63void 63void
64GNUNET_HELLO_sign_address (const char *address, 64GNUNET_HELLO_sign_address (const char *address,
65 enum GNUNET_ATS_Network_Type nt, 65 enum GNUNET_NetworkType nt,
66 struct GNUNET_TIME_Absolute expiration, 66 struct GNUNET_TIME_Absolute expiration,
67 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key, 67 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
68 void **result, 68 void **result,
@@ -110,7 +110,7 @@ char *
110GNUNET_HELLO_extract_address (const void *raw, 110GNUNET_HELLO_extract_address (const void *raw,
111 size_t raw_size, 111 size_t raw_size,
112 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, 112 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
113 enum GNUNET_ATS_Network_Type *nt, 113 enum GNUNET_NetworkType *nt,
114 struct GNUNET_TIME_Absolute *expiration) 114 struct GNUNET_TIME_Absolute *expiration)
115{ 115{
116 const char *raws = raw; 116 const char *raws = raw;
@@ -188,6 +188,6 @@ GNUNET_HELLO_extract_address (const void *raw,
188 } 188 }
189 GNUNET_free (sig); 189 GNUNET_free (sig);
190 *expiration = raw_expiration; 190 *expiration = raw_expiration;
191 *nt = (enum GNUNET_ATS_Network_Type) raw_nt; 191 *nt = (enum GNUNET_NetworkType) raw_nt;
192 return GNUNET_strdup (raw_addr); 192 return GNUNET_strdup (raw_addr);
193} 193}
diff --git a/src/include/gnunet_ats_plugin.h b/src/include/gnunet_ats_plugin.h
index d414d5f4c..16711c852 100644
--- a/src/include/gnunet_ats_plugin.h
+++ b/src/include/gnunet_ats_plugin.h
@@ -467,13 +467,13 @@ struct GNUNET_ATS_PluginEnvironment
467 * Array of configured outbound quotas 467 * Array of configured outbound quotas
468 * Order according to networks in network array 468 * Order according to networks in network array
469 */ 469 */
470 unsigned long long out_quota[GNUNET_ATS_NetworkTypeCount]; 470 unsigned long long out_quota[GNUNET_NT_COUNT];
471 471
472 /** 472 /**
473 * Array of configured inbound quotas 473 * Array of configured inbound quotas
474 * Order according to networks in network array 474 * Order according to networks in network array
475 */ 475 */
476 unsigned long long in_quota[GNUNET_ATS_NetworkTypeCount]; 476 unsigned long long in_quota[GNUNET_NT_COUNT];
477}; 477};
478 478
479#endif 479#endif
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index a9fd519d4..b25cf3ec0 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -36,48 +36,6 @@
36#include "gnunet_util_lib.h" 36#include "gnunet_util_lib.h"
37#include "gnunet_hello_lib.h" 37#include "gnunet_hello_lib.h"
38 38
39/**
40 * Types of networks (with separate quotas) we support.
41 */
42enum GNUNET_ATS_Network_Type
43{
44 /**
45 * Category of last resort.
46 */
47 GNUNET_ATS_NET_UNSPECIFIED = 0,
48
49 /**
50 * Loopback (same host).
51 */
52 GNUNET_ATS_NET_LOOPBACK = 1,
53
54 /**
55 * Local area network.
56 */
57 GNUNET_ATS_NET_LAN = 2,
58
59 /**
60 * Wide area network (i.e. Internet)
61 */
62 GNUNET_ATS_NET_WAN = 3,
63
64 /**
65 * Wireless LAN (i.e. 802.11abgn)
66 */
67 GNUNET_ATS_NET_WLAN = 4,
68
69 /**
70 * Bluetooth LAN
71 */
72 GNUNET_ATS_NET_BT = 5,
73
74/**
75 * Number of network types supported by ATS
76 */
77#define GNUNET_ATS_NetworkTypeCount 6
78
79};
80
81 39
82/** 40/**
83 * Default bandwidth assigned to a network : 64 KB/s 41 * Default bandwidth assigned to a network : 64 KB/s
@@ -143,7 +101,7 @@ struct GNUNET_ATS_Properties
143 * Which network scope does the respective address belong to? 101 * Which network scope does the respective address belong to?
144 * This property does not change. 102 * This property does not change.
145 */ 103 */
146 enum GNUNET_ATS_Network_Type scope; 104 enum GNUNET_NetworkType scope;
147 105
148}; 106};
149 107
@@ -220,55 +178,6 @@ GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo,
220 178
221 179
222 180
223/**
224 * Convert a `enum GNUNET_ATS_Network_Type` to a string
225 *
226 * @param net the network type
227 * @return a string or NULL if invalid
228 */
229const char *
230GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net);
231
232
233/**
234 * Handle for the LAN Characterization library.
235 */
236struct GNUNET_ATS_InterfaceScanner;
237
238
239/**
240 * Returns where the address is located: loopback, LAN or WAN.
241 *
242 * @param is handle from #GNUNET_ATS_interface_scanner_init()
243 * @param addr address
244 * @param addrlen address length
245 * @return type of the network the address belongs to
246 */
247enum GNUNET_ATS_Network_Type
248GNUNET_ATS_scanner_address_get_type (struct GNUNET_ATS_InterfaceScanner *is,
249 const struct sockaddr *addr,
250 socklen_t addrlen);
251
252
253/**
254 * Initialize the ATS address characterization client handle.
255 *
256 * @return scanner handle, NULL on error
257 */
258struct GNUNET_ATS_InterfaceScanner *
259GNUNET_ATS_scanner_init (void);
260
261
262/**
263 * Terminate interface scanner.
264 *
265 * @param is scanner we are done with
266 */
267void
268GNUNET_ATS_scanner_done (struct GNUNET_ATS_InterfaceScanner *is);
269
270
271
272/* ********************Connection Suggestion API ***************************** */ 181/* ********************Connection Suggestion API ***************************** */
273 182
274/** 183/**
diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h
index aa8d6af61..b97a2629f 100644
--- a/src/include/gnunet_dv_service.h
+++ b/src/include/gnunet_dv_service.h
@@ -47,7 +47,7 @@ typedef void
47(*GNUNET_DV_ConnectCallback)(void *cls, 47(*GNUNET_DV_ConnectCallback)(void *cls,
48 const struct GNUNET_PeerIdentity *peer, 48 const struct GNUNET_PeerIdentity *peer,
49 uint32_t distance, 49 uint32_t distance,
50 enum GNUNET_ATS_Network_Type network); 50 enum GNUNET_NetworkType network);
51 51
52 52
53/** 53/**
@@ -63,7 +63,7 @@ typedef void
63(*GNUNET_DV_DistanceChangedCallback)(void *cls, 63(*GNUNET_DV_DistanceChangedCallback)(void *cls,
64 const struct GNUNET_PeerIdentity *peer, 64 const struct GNUNET_PeerIdentity *peer,
65 uint32_t distance, 65 uint32_t distance,
66 enum GNUNET_ATS_Network_Type network); 66 enum GNUNET_NetworkType network);
67 67
68 68
69/** 69/**
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index ceaa60466..8a405a25e 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -474,11 +474,7 @@ GNUNET_HELLO_parse_uri (const char *uri,
474 474
475 475
476/* NG API */ 476/* NG API */
477/** 477#include "gnunet_nt_lib.h"
478 * Defined in gnunet_ats_service.h, but here we do not care about
479 * the details so are just giving the declaration.
480 */
481enum GNUNET_ATS_Network_Type;
482 478
483 479
484/** 480/**
@@ -493,7 +489,7 @@ enum GNUNET_ATS_Network_Type;
493 */ 489 */
494void 490void
495GNUNET_HELLO_sign_address (const char *address, 491GNUNET_HELLO_sign_address (const char *address,
496 enum GNUNET_ATS_Network_Type nt, 492 enum GNUNET_NetworkType nt,
497 struct GNUNET_TIME_Absolute expiration, 493 struct GNUNET_TIME_Absolute expiration,
498 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key, 494 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
499 void **result, 495 void **result,
@@ -514,7 +510,7 @@ char *
514GNUNET_HELLO_extract_address (const void *raw, 510GNUNET_HELLO_extract_address (const void *raw,
515 size_t raw_size, 511 size_t raw_size,
516 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, 512 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
517 enum GNUNET_ATS_Network_Type *nt, 513 enum GNUNET_NetworkType *nt,
518 struct GNUNET_TIME_Absolute *expiration); 514 struct GNUNET_TIME_Absolute *expiration);
519 515
520 516
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index e80ba85cf..1d0add99f 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -226,7 +226,7 @@ GNUNET_TRANSPORT_communicator_mq_add (struct GNUNET_TRANSPORT_CommunicatorHandle
226 const struct GNUNET_PeerIdentity *peer, 226 const struct GNUNET_PeerIdentity *peer,
227 const char *address, 227 const char *address,
228 uint32_t mtu, 228 uint32_t mtu,
229 enum GNUNET_ATS_Network_Type nt, 229 enum GNUNET_NetworkType nt,
230 uint32_t distance, 230 uint32_t distance,
231 enum GNUNET_TRANSPORT_ConnectionStatus cs, 231 enum GNUNET_TRANSPORT_ConnectionStatus cs,
232 struct GNUNET_MQ_Handle *mq); 232 struct GNUNET_MQ_Handle *mq);
@@ -261,7 +261,7 @@ struct GNUNET_TRANSPORT_AddressIdentifier;
261struct GNUNET_TRANSPORT_AddressIdentifier * 261struct GNUNET_TRANSPORT_AddressIdentifier *
262GNUNET_TRANSPORT_communicator_address_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 262GNUNET_TRANSPORT_communicator_address_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
263 const char *address, 263 const char *address,
264 enum GNUNET_ATS_Network_Type nt, 264 enum GNUNET_NetworkType nt,
265 struct GNUNET_TIME_Relative expiration); 265 struct GNUNET_TIME_Relative expiration);
266 266
267 267
diff --git a/src/include/gnunet_transport_hello_service.h b/src/include/gnunet_transport_hello_service.h
index a21358a9c..50734f957 100644
--- a/src/include/gnunet_transport_hello_service.h
+++ b/src/include/gnunet_transport_hello_service.h
@@ -166,7 +166,7 @@ typedef void
166(*GNUNET_TRANSPORT_AddressCallback) (void *cls, 166(*GNUNET_TRANSPORT_AddressCallback) (void *cls,
167 const struct GNUNET_PeerIdentity *peer, 167 const struct GNUNET_PeerIdentity *peer,
168 const char *address, 168 const char *address,
169 enum GNUNET_ATS_Network_Type nt, 169 enum GNUNET_NetworkType nt,
170 struct GNUNET_TIME_Absolute expiration); 170 struct GNUNET_TIME_Absolute expiration);
171 171
172 172
diff --git a/src/include/gnunet_transport_monitor_service.h b/src/include/gnunet_transport_monitor_service.h
index 799434016..ef599f902 100644
--- a/src/include/gnunet_transport_monitor_service.h
+++ b/src/include/gnunet_transport_monitor_service.h
@@ -65,7 +65,7 @@ struct GNUNET_TRANSPORT_MonitorInformation
65 /** 65 /**
66 * Network type of the address. 66 * Network type of the address.
67 */ 67 */
68 enum GNUNET_ATS_Network_Type nt; 68 enum GNUNET_NetworkType nt;
69 69
70 /** 70 /**
71 * Connection status. 71 * Connection status.
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h
index 1f7b46baa..d1f8db445 100644
--- a/src/include/gnunet_transport_plugin.h
+++ b/src/include/gnunet_transport_plugin.h
@@ -89,7 +89,7 @@ typedef void
89(*GNUNET_TRANSPORT_SessionStart) (void *cls, 89(*GNUNET_TRANSPORT_SessionStart) (void *cls,
90 const struct GNUNET_HELLO_Address *address, 90 const struct GNUNET_HELLO_Address *address,
91 struct GNUNET_ATS_Session *session, 91 struct GNUNET_ATS_Session *session,
92 enum GNUNET_ATS_Network_Type net); 92 enum GNUNET_NetworkType net);
93 93
94 94
95/** 95/**
@@ -131,7 +131,7 @@ typedef struct GNUNET_TIME_Relative
131 * @param addrlen length of the @a addr 131 * @param addrlen length of the @a addr
132 * @return type of the network the address belongs to 132 * @return type of the network the address belongs to
133 */ 133 */
134typedef enum GNUNET_ATS_Network_Type 134typedef enum GNUNET_NetworkType
135(*GNUNET_TRANSPORT_AddressToType) (void *cls, 135(*GNUNET_TRANSPORT_AddressToType) (void *cls,
136 const struct sockaddr *addr, 136 const struct sockaddr *addr,
137 size_t addrlen); 137 size_t addrlen);
@@ -547,7 +547,7 @@ typedef int
547 * @param session the session 547 * @param session the session
548 * @return the network type 548 * @return the network type
549 */ 549 */
550typedef enum GNUNET_ATS_Network_Type 550typedef enum GNUNET_NetworkType
551(*GNUNET_TRANSPORT_GetNetworkType) (void *cls, 551(*GNUNET_TRANSPORT_GetNetworkType) (void *cls,
552 struct GNUNET_ATS_Session *session); 552 struct GNUNET_ATS_Session *session);
553 553
@@ -559,7 +559,7 @@ typedef enum GNUNET_ATS_Network_Type
559 * @param address the address 559 * @param address the address
560 * @return the network type 560 * @return the network type
561 */ 561 */
562typedef enum GNUNET_ATS_Network_Type 562typedef enum GNUNET_NetworkType
563(*GNUNET_TRANSPORT_GetNetworkTypeForAddress) (void *cls, 563(*GNUNET_TRANSPORT_GetNetworkTypeForAddress) (void *cls,
564 const struct GNUNET_HELLO_Address *address); 564 const struct GNUNET_HELLO_Address *address);
565 565
diff --git a/src/nt/nt.c b/src/nt/nt.c
index 5764f8f4a..ae0fef119 100644
--- a/src/nt/nt.c
+++ b/src/nt/nt.c
@@ -165,6 +165,9 @@ interface_proc (void *cls,
165 struct GNUNET_NT_InterfaceScanner *is = cls; 165 struct GNUNET_NT_InterfaceScanner *is = cls;
166 /* Calculate network */ 166 /* Calculate network */
167 struct NT_Network *net = NULL; 167 struct NT_Network *net = NULL;
168 (void) name;
169 (void) isDefault;
170 (void) broadcast_addr;
168 171
169 /* Skipping IPv4 loopback addresses since we have special check */ 172 /* Skipping IPv4 loopback addresses since we have special check */
170 if (addr->sa_family == AF_INET) 173 if (addr->sa_family == AF_INET)
@@ -285,9 +288,9 @@ get_addresses (void *cls)
285 * @return type of the network the address belongs to 288 * @return type of the network the address belongs to
286 */ 289 */
287enum GNUNET_NetworkType 290enum GNUNET_NetworkType
288GNUNET_NT_scanner_address_get_type (struct GNUNET_NT_InterfaceScanner *is, 291GNUNET_NT_scanner_get_type (struct GNUNET_NT_InterfaceScanner *is,
289 const struct sockaddr *addr, 292 const struct sockaddr *addr,
290 socklen_t addrlen) 293 socklen_t addrlen)
291{ 294{
292 struct NT_Network *cur = is->net_head; 295 struct NT_Network *cur = is->net_head;
293 enum GNUNET_NetworkType type = GNUNET_NT_UNSPECIFIED; 296 enum GNUNET_NetworkType type = GNUNET_NT_UNSPECIFIED;
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 0693a0b9f..73296abf9 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -314,6 +314,7 @@ gnunet_service_transport_LDADD = \
314 libgnunettransport.la \ 314 libgnunettransport.la \
315 $(top_builddir)/src/ats/libgnunetats.la \ 315 $(top_builddir)/src/ats/libgnunetats.la \
316 $(top_builddir)/src/hello/libgnunethello.la \ 316 $(top_builddir)/src/hello/libgnunethello.la \
317 $(top_builddir)/src/nt/libgnunetnt.la \
317 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ 318 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
318 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 319 $(top_builddir)/src/statistics/libgnunetstatistics.la \
319 $(top_builddir)/src/util/libgnunetutil.la \ 320 $(top_builddir)/src/util/libgnunetutil.la \
diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c
index a97560ad4..0df3fd45d 100644
--- a/src/transport/gnunet-communicator-unix.c
+++ b/src/transport/gnunet-communicator-unix.c
@@ -680,7 +680,7 @@ setup_queue (const struct GNUNET_PeerIdentity *target,
680 &queue->target, 680 &queue->target,
681 foreign_addr, 681 foreign_addr,
682 UNIX_MTU, 682 UNIX_MTU,
683 GNUNET_ATS_NET_LOOPBACK, 683 GNUNET_NT_LOOPBACK,
684 0 /* distance */, 684 0 /* distance */,
685 cs, 685 cs,
686 queue->mq); 686 queue->mq);
@@ -1100,7 +1100,7 @@ run (void *cls,
1100 GNUNET_free (unix_socket_path); 1100 GNUNET_free (unix_socket_path);
1101 ai = GNUNET_TRANSPORT_communicator_address_add (ch, 1101 ai = GNUNET_TRANSPORT_communicator_address_add (ch,
1102 my_addr, 1102 my_addr,
1103 GNUNET_ATS_NET_LOOPBACK, 1103 GNUNET_NT_LOOPBACK,
1104 GNUNET_TIME_UNIT_FOREVER_REL); 1104 GNUNET_TIME_UNIT_FOREVER_REL);
1105 GNUNET_free (my_addr); 1105 GNUNET_free (my_addr);
1106} 1106}
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 3e08900bb..b184a0600 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -162,7 +162,7 @@ struct Queue
162 /** 162 /**
163 * Network type offered by this queue. 163 * Network type offered by this queue.
164 */ 164 */
165 enum GNUNET_ATS_Network_Type nt; 165 enum GNUNET_NetworkType nt;
166 166
167 /** 167 /**
168 * Connection status for this queue. 168 * Connection status for this queue.
@@ -322,7 +322,7 @@ struct AddressListEntry
322 /** 322 /**
323 * Network type offered by this address. 323 * Network type offered by this address.
324 */ 324 */
325 enum GNUNET_ATS_Network_Type nt; 325 enum GNUNET_NetworkType nt;
326 326
327}; 327};
328 328
@@ -549,7 +549,7 @@ static void
549notify_monitor (struct TransportClient *tc, 549notify_monitor (struct TransportClient *tc,
550 const struct GNUNET_PeerIdentity *peer, 550 const struct GNUNET_PeerIdentity *peer,
551 const char *address, 551 const char *address,
552 enum GNUNET_ATS_Network_Type nt, 552 enum GNUNET_NetworkType nt,
553 const struct MonitorEvent *me) 553 const struct MonitorEvent *me)
554{ 554{
555 struct GNUNET_MQ_Envelope *env; 555 struct GNUNET_MQ_Envelope *env;
@@ -588,7 +588,7 @@ notify_monitor (struct TransportClient *tc,
588static void 588static void
589notify_monitors (const struct GNUNET_PeerIdentity *peer, 589notify_monitors (const struct GNUNET_PeerIdentity *peer,
590 const char *address, 590 const char *address,
591 enum GNUNET_ATS_Network_Type nt, 591 enum GNUNET_NetworkType nt,
592 const struct MonitorEvent *me) 592 const struct MonitorEvent *me)
593{ 593{
594 static struct GNUNET_PeerIdentity zero; 594 static struct GNUNET_PeerIdentity zero;
@@ -1255,7 +1255,7 @@ handle_add_address (void *cls,
1255 ale->address = (const char *) &ale[1]; 1255 ale->address = (const char *) &ale[1];
1256 ale->expiration = GNUNET_TIME_relative_ntoh (aam->expiration); 1256 ale->expiration = GNUNET_TIME_relative_ntoh (aam->expiration);
1257 ale->aid = aam->aid; 1257 ale->aid = aam->aid;
1258 ale->nt = (enum GNUNET_ATS_Network_Type) ntohl (aam->nt); 1258 ale->nt = (enum GNUNET_NetworkType) ntohl (aam->nt);
1259 memcpy (&ale[1], 1259 memcpy (&ale[1],
1260 &aam[1], 1260 &aam[1],
1261 slen); 1261 slen);
@@ -1427,7 +1427,7 @@ handle_add_queue_message (void *cls,
1427 queue->qid = aqm->qid; 1427 queue->qid = aqm->qid;
1428 queue->mtu = ntohl (aqm->mtu); 1428 queue->mtu = ntohl (aqm->mtu);
1429 queue->distance = ntohl (aqm->distance); 1429 queue->distance = ntohl (aqm->distance);
1430 queue->nt = (enum GNUNET_ATS_Network_Type) ntohl (aqm->nt); 1430 queue->nt = (enum GNUNET_NetworkType) ntohl (aqm->nt);
1431 queue->cs = (enum GNUNET_TRANSPORT_ConnectionStatus) ntohl (aqm->cs); 1431 queue->cs = (enum GNUNET_TRANSPORT_ConnectionStatus) ntohl (aqm->cs);
1432 queue->neighbour = neighbour; 1432 queue->neighbour = neighbour;
1433 memcpy (&queue[1], 1433 memcpy (&queue[1],
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 2d9803651..2c1ee12fe 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -415,7 +415,7 @@ static struct GNUNET_ATS_SessionKiller *sk_tail;
415/** 415/**
416 * Interface scanner determines our LAN address range(s). 416 * Interface scanner determines our LAN address range(s).
417 */ 417 */
418struct GNUNET_ATS_InterfaceScanner *GST_is; 418struct GNUNET_NT_InterfaceScanner *GST_is;
419 419
420 420
421/** 421/**
@@ -1975,7 +1975,7 @@ static void
1975plugin_env_session_start (void *cls, 1975plugin_env_session_start (void *cls,
1976 const struct GNUNET_HELLO_Address *address, 1976 const struct GNUNET_HELLO_Address *address,
1977 struct GNUNET_ATS_Session *session, 1977 struct GNUNET_ATS_Session *session,
1978 enum GNUNET_ATS_Network_Type scope) 1978 enum GNUNET_NetworkType scope)
1979{ 1979{
1980 struct GNUNET_ATS_Properties prop; 1980 struct GNUNET_ATS_Properties prop;
1981 1981
@@ -2005,7 +2005,7 @@ plugin_env_session_start (void *cls,
2005 memset (&prop, 2005 memset (&prop,
2006 0, 2006 0,
2007 sizeof (prop)); 2007 sizeof (prop));
2008 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != scope); 2008 GNUNET_break (GNUNET_NT_UNSPECIFIED != scope);
2009 prop.scope = scope; 2009 prop.scope = scope;
2010 GST_ats_add_inbound_address (address, 2010 GST_ats_add_inbound_address (address,
2011 session, 2011 session,
@@ -2261,7 +2261,7 @@ shutdown_task (void *cls)
2261 GST_ats = NULL; 2261 GST_ats = NULL;
2262 GNUNET_ATS_connectivity_done (GST_ats_connect); 2262 GNUNET_ATS_connectivity_done (GST_ats_connect);
2263 GST_ats_connect = NULL; 2263 GST_ats_connect = NULL;
2264 GNUNET_ATS_scanner_done (GST_is); 2264 GNUNET_NT_scanner_done (GST_is);
2265 GST_is = NULL; 2265 GST_is = NULL;
2266 while (NULL != (cur = a2s_head)) 2266 while (NULL != (cur = a2s_head))
2267 { 2267 {
@@ -2859,7 +2859,7 @@ run (void *cls,
2859 /* start subsystems */ 2859 /* start subsystems */
2860 read_blacklist_configuration (GST_cfg, 2860 read_blacklist_configuration (GST_cfg,
2861 &GST_my_identity); 2861 &GST_my_identity);
2862 GST_is = GNUNET_ATS_scanner_init (); 2862 GST_is = GNUNET_NT_scanner_init ();
2863 GST_ats_connect = GNUNET_ATS_connectivity_init (GST_cfg); 2863 GST_ats_connect = GNUNET_ATS_connectivity_init (GST_cfg);
2864 GST_ats = GNUNET_ATS_scheduling_init (GST_cfg, 2864 GST_ats = GNUNET_ATS_scheduling_init (GST_cfg,
2865 &ats_request_address_change, 2865 &ats_request_address_change,
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h
index fd852f027..253b785e3 100644
--- a/src/transport/gnunet-service-transport.h
+++ b/src/transport/gnunet-service-transport.h
@@ -69,7 +69,7 @@ extern struct GNUNET_ATS_ConnectivityHandle *GST_ats_connect;
69/** 69/**
70 * Interface scanner determines our LAN address range(s). 70 * Interface scanner determines our LAN address range(s).
71 */ 71 */
72extern struct GNUNET_ATS_InterfaceScanner *GST_is; 72extern struct GNUNET_NT_InterfaceScanner *GST_is;
73 73
74 74
75/** 75/**
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index 8b3b998c8..358ed95c3 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -442,7 +442,7 @@ GST_ats_add_inbound_address (const struct GNUNET_HELLO_Address *address,
442 GNUNET_break(0); 442 GNUNET_break(0);
443 return; 443 return;
444 } 444 }
445 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 445 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
446 GNUNET_assert (GNUNET_YES == 446 GNUNET_assert (GNUNET_YES ==
447 GNUNET_HELLO_address_check_option (address, 447 GNUNET_HELLO_address_check_option (address,
448 GNUNET_HELLO_ADDRESS_INFO_INBOUND)); 448 GNUNET_HELLO_ADDRESS_INFO_INBOUND));
@@ -461,7 +461,7 @@ GST_ats_add_inbound_address (const struct GNUNET_HELLO_Address *address,
461 GNUNET_i2s (&address->peer), 461 GNUNET_i2s (&address->peer),
462 GST_plugins_a2s (address), 462 GST_plugins_a2s (address),
463 session, 463 session,
464 GNUNET_ATS_print_network_type (prop->scope)); 464 GNUNET_NT_to_string (prop->scope));
465 ar = GNUNET_ATS_address_add (GST_ats, 465 ar = GNUNET_ATS_address_add (GST_ats,
466 address, 466 address,
467 session, 467 session,
@@ -510,7 +510,7 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
510 GNUNET_HELLO_ADDRESS_INFO_INBOUND)); 510 GNUNET_HELLO_ADDRESS_INFO_INBOUND));
511 ai = find_ai_no_session (address); 511 ai = find_ai_no_session (address);
512 GNUNET_assert (NULL == ai); 512 GNUNET_assert (NULL == ai);
513 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); 513 GNUNET_break (GNUNET_NT_UNSPECIFIED != prop->scope);
514 514
515 /* address seems sane, let's tell ATS */ 515 /* address seems sane, let's tell ATS */
516 LOG (GNUNET_ERROR_TYPE_INFO, 516 LOG (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c
index 9c3044450..6ea59e29c 100644
--- a/src/transport/gnunet-service-transport_plugins.c
+++ b/src/transport/gnunet-service-transport_plugins.c
@@ -104,7 +104,7 @@ plugin_env_update_distance (void *cls,
104 * @param addrlen length of the @a addr 104 * @param addrlen length of the @a addr
105 * @return type of the network @a addr belongs to 105 * @return type of the network @a addr belongs to
106 */ 106 */
107static enum GNUNET_ATS_Network_Type 107static enum GNUNET_NetworkType
108plugin_env_address_to_type (void *cls, 108plugin_env_address_to_type (void *cls,
109 const struct sockaddr *addr, 109 const struct sockaddr *addr,
110 size_t addrlen) 110 size_t addrlen)
@@ -112,9 +112,9 @@ plugin_env_address_to_type (void *cls,
112 if (NULL == GST_is) 112 if (NULL == GST_is)
113 { 113 {
114 GNUNET_break(0); 114 GNUNET_break(0);
115 return GNUNET_ATS_NET_UNSPECIFIED; 115 return GNUNET_NT_UNSPECIFIED;
116 } 116 }
117 return GNUNET_ATS_scanner_address_get_type (GST_is, 117 return GNUNET_NT_scanner_get_type (GST_is,
118 addr, 118 addr,
119 addrlen); 119 addrlen);
120} 120}
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index eecc54efa..fc02da5b4 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -317,7 +317,7 @@ struct ValidationEntry
317 /** 317 /**
318 * Which network type does our address belong to? 318 * Which network type does our address belong to?
319 */ 319 */
320 enum GNUNET_ATS_Network_Type network; 320 enum GNUNET_NetworkType network;
321}; 321};
322 322
323 323
@@ -654,7 +654,7 @@ transmit_ping_if_allowed (void *cls,
654 ve->address->transport_name); 654 ve->address->transport_name);
655 ve->network = papi->get_network (papi->cls, 655 ve->network = papi->get_network (papi->cls,
656 session); 656 session);
657 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ve->network); 657 GNUNET_break (GNUNET_NT_UNSPECIFIED != ve->network);
658 GST_neighbours_notify_data_sent (ve->address, 658 GST_neighbours_notify_data_sent (ve->address,
659 session, 659 session,
660 tsize); 660 tsize);
@@ -905,7 +905,7 @@ add_valid_address (void *cls,
905 ve = find_validation_entry (address); 905 ve = find_validation_entry (address);
906 ve->network = papi->get_network_for_address (papi->cls, 906 ve->network = papi->get_network_for_address (papi->cls,
907 address); 907 address);
908 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ve->network); 908 GNUNET_break (GNUNET_NT_UNSPECIFIED != ve->network);
909 ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, 909 ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until,
910 expiration); 910 expiration);
911 if (NULL == ve->revalidation_task) 911 if (NULL == ve->revalidation_task)
@@ -1589,7 +1589,7 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
1589 struct GNUNET_ATS_Properties prop; 1589 struct GNUNET_ATS_Properties prop;
1590 1590
1591 memset (&prop, 0, sizeof (prop)); 1591 memset (&prop, 0, sizeof (prop));
1592 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ve->network); 1592 GNUNET_break (GNUNET_NT_UNSPECIFIED != ve->network);
1593 prop.scope = ve->network; 1593 prop.scope = ve->network;
1594 prop.delay = GNUNET_TIME_relative_divide (ve->latency, 2); 1594 prop.delay = GNUNET_TIME_relative_divide (ve->latency, 2);
1595 GNUNET_assert (GNUNET_NO == 1595 GNUNET_assert (GNUNET_NO ==
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 0afb54943..e88e2c69f 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -266,7 +266,7 @@ struct GNUNET_ATS_Session
266 /** 266 /**
267 * ATS network type. 267 * ATS network type.
268 */ 268 */
269 enum GNUNET_ATS_Network_Type scope; 269 enum GNUNET_NetworkType scope;
270}; 270};
271 271
272 272
@@ -1920,7 +1920,7 @@ client_connect (struct GNUNET_ATS_Session *s)
1920 * @param session the session 1920 * @param session the session
1921 * @return the network type 1921 * @return the network type
1922 */ 1922 */
1923static enum GNUNET_ATS_Network_Type 1923static enum GNUNET_NetworkType
1924http_client_plugin_get_network (void *cls, 1924http_client_plugin_get_network (void *cls,
1925 struct GNUNET_ATS_Session *session) 1925 struct GNUNET_ATS_Session *session)
1926{ 1926{
@@ -1935,7 +1935,7 @@ http_client_plugin_get_network (void *cls,
1935 * @param address the address 1935 * @param address the address
1936 * @return the network type 1936 * @return the network type
1937 */ 1937 */
1938static enum GNUNET_ATS_Network_Type 1938static enum GNUNET_NetworkType
1939http_client_plugin_get_network_for_address (void *cls, 1939http_client_plugin_get_network_for_address (void *cls,
1940 const struct GNUNET_HELLO_Address *address) 1940 const struct GNUNET_HELLO_Address *address)
1941{ 1941{
@@ -1997,7 +1997,7 @@ http_client_plugin_get_session (void *cls,
1997 struct HTTP_Client_Plugin *plugin = cls; 1997 struct HTTP_Client_Plugin *plugin = cls;
1998 struct GNUNET_ATS_Session *s; 1998 struct GNUNET_ATS_Session *s;
1999 struct sockaddr *sa; 1999 struct sockaddr *sa;
2000 enum GNUNET_ATS_Network_Type net_type; 2000 enum GNUNET_NetworkType net_type;
2001 size_t salen = 0; 2001 size_t salen = 0;
2002 int res; 2002 int res;
2003 2003
@@ -2020,7 +2020,7 @@ http_client_plugin_get_session (void *cls,
2020 } 2020 }
2021 2021
2022 /* Determine network location */ 2022 /* Determine network location */
2023 net_type = GNUNET_ATS_NET_UNSPECIFIED; 2023 net_type = GNUNET_NT_UNSPECIFIED;
2024 sa = http_common_socket_from_address (address->address, 2024 sa = http_common_socket_from_address (address->address,
2025 address->address_length, 2025 address->address_length,
2026 &res); 2026 &res);
@@ -2043,9 +2043,9 @@ http_client_plugin_get_session (void *cls,
2043 else if (GNUNET_NO == res) 2043 else if (GNUNET_NO == res)
2044 { 2044 {
2045 /* Cannot convert to sockaddr -> is external hostname */ 2045 /* Cannot convert to sockaddr -> is external hostname */
2046 net_type = GNUNET_ATS_NET_WAN; 2046 net_type = GNUNET_NT_WAN;
2047 } 2047 }
2048 if (GNUNET_ATS_NET_UNSPECIFIED == net_type) 2048 if (GNUNET_NT_UNSPECIFIED == net_type)
2049 { 2049 {
2050 GNUNET_break (0); 2050 GNUNET_break (0);
2051 return NULL; 2051 return NULL;
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c
index e9576d72b..3f0452d0b 100644
--- a/src/transport/plugin_transport_http_common.c
+++ b/src/transport/plugin_transport_http_common.c
@@ -896,17 +896,17 @@ http_common_cmp_addresses (const void *addr1,
896 * @param address the address 896 * @param address the address
897 * @return the network type 897 * @return the network type
898 */ 898 */
899enum GNUNET_ATS_Network_Type 899enum GNUNET_NetworkType
900http_common_get_network_for_address (struct GNUNET_TRANSPORT_PluginEnvironment *env, 900http_common_get_network_for_address (struct GNUNET_TRANSPORT_PluginEnvironment *env,
901 const struct GNUNET_HELLO_Address *address) 901 const struct GNUNET_HELLO_Address *address)
902{ 902{
903 903
904 struct sockaddr *sa; 904 struct sockaddr *sa;
905 enum GNUNET_ATS_Network_Type net_type; 905 enum GNUNET_NetworkType net_type;
906 size_t salen = 0; 906 size_t salen = 0;
907 int res; 907 int res;
908 908
909 net_type = GNUNET_ATS_NET_UNSPECIFIED; 909 net_type = GNUNET_NT_UNSPECIFIED;
910 sa = http_common_socket_from_address (address->address, 910 sa = http_common_socket_from_address (address->address,
911 address->address_length, 911 address->address_length,
912 &res); 912 &res);
diff --git a/src/transport/plugin_transport_http_common.h b/src/transport/plugin_transport_http_common.h
index ac62f6ee4..f758015e1 100644
--- a/src/transport/plugin_transport_http_common.h
+++ b/src/transport/plugin_transport_http_common.h
@@ -253,7 +253,7 @@ http_common_cmp_addresses (const void *addr1,
253 * @param address the address 253 * @param address the address
254 * @return the network type 254 * @return the network type
255 */ 255 */
256enum GNUNET_ATS_Network_Type 256enum GNUNET_NetworkType
257http_common_get_network_for_address (struct GNUNET_TRANSPORT_PluginEnvironment *env, 257http_common_get_network_for_address (struct GNUNET_TRANSPORT_PluginEnvironment *env,
258 const struct GNUNET_HELLO_Address *address); 258 const struct GNUNET_HELLO_Address *address);
259 259
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index abf60280a..8c657503a 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -260,7 +260,7 @@ struct GNUNET_ATS_Session
260 /** 260 /**
261 * ATS network type. 261 * ATS network type.
262 */ 262 */
263 enum GNUNET_ATS_Network_Type scope; 263 enum GNUNET_NetworkType scope;
264 264
265 /** 265 /**
266 * #GNUNET_YES if this session is known to the service. 266 * #GNUNET_YES if this session is known to the service.
@@ -1382,7 +1382,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin,
1382 uint32_t options; 1382 uint32_t options;
1383 int direction = GNUNET_SYSERR; 1383 int direction = GNUNET_SYSERR;
1384 unsigned int to; 1384 unsigned int to;
1385 enum GNUNET_ATS_Network_Type scope; 1385 enum GNUNET_NetworkType scope;
1386 1386
1387 conn_info = MHD_get_connection_info (mhd_connection, 1387 conn_info = MHD_get_connection_info (mhd_connection,
1388 MHD_CONNECTION_INFO_CLIENT_ADDRESS); 1388 MHD_CONNECTION_INFO_CLIENT_ADDRESS);
@@ -3344,7 +3344,7 @@ http_server_plugin_address_to_string (void *cls,
3344 * @param session the session 3344 * @param session the session
3345 * @return the network type in HBO or #GNUNET_SYSERR 3345 * @return the network type in HBO or #GNUNET_SYSERR
3346 */ 3346 */
3347static enum GNUNET_ATS_Network_Type 3347static enum GNUNET_NetworkType
3348http_server_plugin_get_network (void *cls, 3348http_server_plugin_get_network (void *cls,
3349 struct GNUNET_ATS_Session *session) 3349 struct GNUNET_ATS_Session *session)
3350{ 3350{
@@ -3359,7 +3359,7 @@ http_server_plugin_get_network (void *cls,
3359 * @param address the address 3359 * @param address the address
3360 * @return the network type 3360 * @return the network type
3361 */ 3361 */
3362static enum GNUNET_ATS_Network_Type 3362static enum GNUNET_NetworkType
3363http_server_plugin_get_network_for_address (void *cls, 3363http_server_plugin_get_network_for_address (void *cls,
3364 const struct GNUNET_HELLO_Address *address) 3364 const struct GNUNET_HELLO_Address *address)
3365{ 3365{
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 75a885535..c056946b6 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -859,7 +859,7 @@ struct GNUNET_ATS_Session
859 /** 859 /**
860 * Network type of the address. 860 * Network type of the address.
861 */ 861 */
862 enum GNUNET_ATS_Network_Type scope; 862 enum GNUNET_NetworkType scope;
863 863
864 /** 864 /**
865 * Are we still expecting the welcome message? (#GNUNET_YES/#GNUNET_NO) 865 * Are we still expecting the welcome message? (#GNUNET_YES/#GNUNET_NO)
@@ -1890,7 +1890,7 @@ reschedule_session_timeout (struct GNUNET_ATS_Session *s)
1890static struct GNUNET_ATS_Session * 1890static struct GNUNET_ATS_Session *
1891create_session (struct Plugin *plugin, 1891create_session (struct Plugin *plugin,
1892 const struct GNUNET_HELLO_Address *address, 1892 const struct GNUNET_HELLO_Address *address,
1893 enum GNUNET_ATS_Network_Type scope, 1893 enum GNUNET_NetworkType scope,
1894 struct GNUNET_SERVER_Client *client, 1894 struct GNUNET_SERVER_Client *client,
1895 int is_nat) 1895 int is_nat)
1896{ 1896{
@@ -2436,7 +2436,7 @@ tcp_plugin_get_session (void *cls,
2436 const struct IPv4TcpAddress *t4; 2436 const struct IPv4TcpAddress *t4;
2437 const struct IPv6TcpAddress *t6; 2437 const struct IPv6TcpAddress *t6;
2438 unsigned int options; 2438 unsigned int options;
2439 enum GNUNET_ATS_Network_Type net_type; 2439 enum GNUNET_NetworkType net_type;
2440 unsigned int is_natd = GNUNET_NO; 2440 unsigned int is_natd = GNUNET_NO;
2441 size_t addrlen; 2441 size_t addrlen;
2442#ifdef TCP_STEALTH 2442#ifdef TCP_STEALTH
@@ -2539,7 +2539,7 @@ tcp_plugin_get_session (void *cls,
2539 net_type = plugin->env->get_address_type (plugin->env->cls, 2539 net_type = plugin->env->get_address_type (plugin->env->cls,
2540 sb, 2540 sb,
2541 sbs); 2541 sbs);
2542 GNUNET_break (net_type != GNUNET_ATS_NET_UNSPECIFIED); 2542 GNUNET_break (net_type != GNUNET_NT_UNSPECIFIED);
2543 2543
2544 if ( (is_natd == GNUNET_YES) && 2544 if ( (is_natd == GNUNET_YES) &&
2545 (addrlen == sizeof(struct IPv6TcpAddress)) ) 2545 (addrlen == sizeof(struct IPv6TcpAddress)) )
@@ -3263,7 +3263,7 @@ handle_tcp_welcome (void *cls,
3263 alen), 3263 alen),
3264 client, 3264 client,
3265 GNUNET_NO); 3265 GNUNET_NO);
3266 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != session->scope); 3266 GNUNET_break (GNUNET_NT_UNSPECIFIED != session->scope);
3267 GNUNET_HELLO_address_free (address); 3267 GNUNET_HELLO_address_free (address);
3268 LOG (GNUNET_ERROR_TYPE_DEBUG, 3268 LOG (GNUNET_ERROR_TYPE_DEBUG,
3269 "Creating new%s session %p for peer `%s' client %p\n", 3269 "Creating new%s session %p for peer `%s' client %p\n",
@@ -3623,7 +3623,7 @@ try_connection_reversal (void *cls,
3623 * @param session the session 3623 * @param session the session
3624 * @return the network type in HBO or #GNUNET_SYSERR 3624 * @return the network type in HBO or #GNUNET_SYSERR
3625 */ 3625 */
3626static enum GNUNET_ATS_Network_Type 3626static enum GNUNET_NetworkType
3627tcp_plugin_get_network (void *cls, 3627tcp_plugin_get_network (void *cls,
3628 struct GNUNET_ATS_Session *session) 3628 struct GNUNET_ATS_Session *session)
3629{ 3629{
@@ -3638,7 +3638,7 @@ tcp_plugin_get_network (void *cls,
3638 * @param address the address 3638 * @param address the address
3639 * @return the network type 3639 * @return the network type
3640 */ 3640 */
3641static enum GNUNET_ATS_Network_Type 3641static enum GNUNET_NetworkType
3642tcp_plugin_get_network_for_address (void *cls, 3642tcp_plugin_get_network_for_address (void *cls,
3643 const struct GNUNET_HELLO_Address *address) 3643 const struct GNUNET_HELLO_Address *address)
3644{ 3644{
@@ -3683,7 +3683,7 @@ tcp_plugin_get_network_for_address (void *cls,
3683 else 3683 else
3684 { 3684 {
3685 GNUNET_break (0); 3685 GNUNET_break (0);
3686 return GNUNET_ATS_NET_UNSPECIFIED; 3686 return GNUNET_NT_UNSPECIFIED;
3687 } 3687 }
3688 return plugin->env->get_address_type (plugin->env->cls, 3688 return plugin->env->get_address_type (plugin->env->cls,
3689 sb, 3689 sb,
diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c
index 679d83daa..be2dfb1c8 100644
--- a/src/transport/plugin_transport_template.c
+++ b/src/transport/plugin_transport_template.c
@@ -284,12 +284,12 @@ template_plugin_query_keepalive_factor (void *cls)
284 * @param session the session 284 * @param session the session
285 * @return the network type in HBO or #GNUNET_SYSERR 285 * @return the network type in HBO or #GNUNET_SYSERR
286 */ 286 */
287static enum GNUNET_ATS_Network_Type 287static enum GNUNET_NetworkType
288template_plugin_get_network (void *cls, 288template_plugin_get_network (void *cls,
289 struct GNUNET_ATS_Session *session) 289 struct GNUNET_ATS_Session *session)
290{ 290{
291 GNUNET_assert (NULL != session); 291 GNUNET_assert (NULL != session);
292 return GNUNET_ATS_NET_UNSPECIFIED; /* Change to correct network type */ 292 return GNUNET_NT_UNSPECIFIED; /* Change to correct network type */
293} 293}
294 294
295 295
@@ -300,11 +300,11 @@ template_plugin_get_network (void *cls,
300 * @param address the address 300 * @param address the address
301 * @return the network type 301 * @return the network type
302 */ 302 */
303static enum GNUNET_ATS_Network_Type 303static enum GNUNET_NetworkType
304template_plugin_get_network_for_address (void *cls, 304template_plugin_get_network_for_address (void *cls,
305 const struct GNUNET_HELLO_Address *address) 305 const struct GNUNET_HELLO_Address *address)
306{ 306{
307 return GNUNET_ATS_NET_WAN; /* FOR NOW */ 307 return GNUNET_NT_WAN; /* FOR NOW */
308} 308}
309 309
310 310
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index abbcca2ae..9fed9b429 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -234,7 +234,7 @@ struct GNUNET_ATS_Session
234 /** 234 /**
235 * Network type of the address. 235 * Network type of the address.
236 */ 236 */
237 enum GNUNET_ATS_Network_Type scope; 237 enum GNUNET_NetworkType scope;
238 238
239 /** 239 /**
240 * Is this session about to be destroyed (sometimes we cannot 240 * Is this session about to be destroyed (sometimes we cannot
@@ -290,7 +290,7 @@ struct DefragContext
290 /** 290 /**
291 * Network type the address belongs to. 291 * Network type the address belongs to.
292 */ 292 */
293 enum GNUNET_ATS_Network_Type network_type; 293 enum GNUNET_NetworkType network_type;
294 294
295 /** 295 /**
296 * Has the @e sender field been initialized yet? 296 * Has the @e sender field been initialized yet?
@@ -660,7 +660,7 @@ udp_query_keepalive_factor (void *cls)
660 * @param session the session 660 * @param session the session
661 * @return the network type 661 * @return the network type
662 */ 662 */
663static enum GNUNET_ATS_Network_Type 663static enum GNUNET_NetworkType
664udp_plugin_get_network (void *cls, 664udp_plugin_get_network (void *cls,
665 struct GNUNET_ATS_Session *session) 665 struct GNUNET_ATS_Session *session)
666{ 666{
@@ -675,7 +675,7 @@ udp_plugin_get_network (void *cls,
675 * @param address the address 675 * @param address the address
676 * @return the network type 676 * @return the network type
677 */ 677 */
678static enum GNUNET_ATS_Network_Type 678static enum GNUNET_NetworkType
679udp_plugin_get_network_for_address (void *cls, 679udp_plugin_get_network_for_address (void *cls,
680 const struct GNUNET_HELLO_Address *address) 680 const struct GNUNET_HELLO_Address *address)
681{ 681{
@@ -720,7 +720,7 @@ udp_plugin_get_network_for_address (void *cls,
720 else 720 else
721 { 721 {
722 GNUNET_break (0); 722 GNUNET_break (0);
723 return GNUNET_ATS_NET_UNSPECIFIED; 723 return GNUNET_NT_UNSPECIFIED;
724 } 724 }
725 return plugin->env->get_address_type (plugin->env->cls, 725 return plugin->env->get_address_type (plugin->env->cls,
726 sb, 726 sb,
@@ -2627,7 +2627,7 @@ session_timeout (void *cls)
2627static struct GNUNET_ATS_Session * 2627static struct GNUNET_ATS_Session *
2628udp_plugin_create_session (void *cls, 2628udp_plugin_create_session (void *cls,
2629 const struct GNUNET_HELLO_Address *address, 2629 const struct GNUNET_HELLO_Address *address,
2630 enum GNUNET_ATS_Network_Type network_type) 2630 enum GNUNET_NetworkType network_type)
2631{ 2631{
2632 struct Plugin *plugin = cls; 2632 struct Plugin *plugin = cls;
2633 struct GNUNET_ATS_Session *s; 2633 struct GNUNET_ATS_Session *s;
@@ -2687,7 +2687,7 @@ udp_plugin_get_session (void *cls,
2687{ 2687{
2688 struct Plugin *plugin = cls; 2688 struct Plugin *plugin = cls;
2689 struct GNUNET_ATS_Session *s; 2689 struct GNUNET_ATS_Session *s;
2690 enum GNUNET_ATS_Network_Type network_type = GNUNET_ATS_NET_UNSPECIFIED; 2690 enum GNUNET_NetworkType network_type = GNUNET_NT_UNSPECIFIED;
2691 const struct IPv4UdpAddress *udp_v4; 2691 const struct IPv4UdpAddress *udp_v4;
2692 const struct IPv6UdpAddress *udp_v6; 2692 const struct IPv6UdpAddress *udp_v6;
2693 2693
@@ -2739,7 +2739,7 @@ udp_plugin_get_session (void *cls,
2739 (const struct sockaddr *) &v6, 2739 (const struct sockaddr *) &v6,
2740 sizeof (v6)); 2740 sizeof (v6));
2741 } 2741 }
2742 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); 2742 GNUNET_break (GNUNET_NT_UNSPECIFIED != network_type);
2743 return udp_plugin_create_session (cls, 2743 return udp_plugin_create_session (cls,
2744 address, 2744 address,
2745 network_type); 2745 network_type);
@@ -2760,12 +2760,12 @@ process_udp_message (struct Plugin *plugin,
2760 const struct UDPMessage *msg, 2760 const struct UDPMessage *msg,
2761 const union UdpAddress *udp_addr, 2761 const union UdpAddress *udp_addr,
2762 size_t udp_addr_len, 2762 size_t udp_addr_len,
2763 enum GNUNET_ATS_Network_Type network_type) 2763 enum GNUNET_NetworkType network_type)
2764{ 2764{
2765 struct GNUNET_ATS_Session *s; 2765 struct GNUNET_ATS_Session *s;
2766 struct GNUNET_HELLO_Address *address; 2766 struct GNUNET_HELLO_Address *address;
2767 2767
2768 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); 2768 GNUNET_break (GNUNET_NT_UNSPECIFIED != network_type);
2769 if (0 != ntohl (msg->reserved)) 2769 if (0 != ntohl (msg->reserved))
2770 { 2770 {
2771 GNUNET_break_op(0); 2771 GNUNET_break_op(0);
@@ -2992,7 +2992,7 @@ read_process_fragment (struct Plugin *plugin,
2992 const struct GNUNET_MessageHeader *msg, 2992 const struct GNUNET_MessageHeader *msg,
2993 const union UdpAddress *udp_addr, 2993 const union UdpAddress *udp_addr,
2994 size_t udp_addr_len, 2994 size_t udp_addr_len,
2995 enum GNUNET_ATS_Network_Type network_type) 2995 enum GNUNET_NetworkType network_type)
2996{ 2996{
2997 struct DefragContext *d_ctx; 2997 struct DefragContext *d_ctx;
2998 struct GNUNET_TIME_Absolute now; 2998 struct GNUNET_TIME_Absolute now;
@@ -3092,7 +3092,7 @@ udp_select_read (struct Plugin *plugin,
3092 const struct sockaddr_in6 *sa6; 3092 const struct sockaddr_in6 *sa6;
3093 const union UdpAddress *int_addr; 3093 const union UdpAddress *int_addr;
3094 size_t int_addr_len; 3094 size_t int_addr_len;
3095 enum GNUNET_ATS_Network_Type network_type; 3095 enum GNUNET_NetworkType network_type;
3096 3096
3097 fromlen = sizeof (addr); 3097 fromlen = sizeof (addr);
3098 memset (&addr, 3098 memset (&addr,
@@ -3345,13 +3345,13 @@ analyze_send_error (struct Plugin *plugin,
3345 socklen_t slen, 3345 socklen_t slen,
3346 int error) 3346 int error)
3347{ 3347{
3348 enum GNUNET_ATS_Network_Type type; 3348 enum GNUNET_NetworkType type;
3349 3349
3350 type = plugin->env->get_address_type (plugin->env->cls, 3350 type = plugin->env->get_address_type (plugin->env->cls,
3351 sa, 3351 sa,
3352 slen); 3352 slen);
3353 if ( ( (GNUNET_ATS_NET_LAN == type) || 3353 if ( ( (GNUNET_NT_LAN == type) ||
3354 (GNUNET_ATS_NET_WAN == type) ) && 3354 (GNUNET_NT_WAN == type) ) &&
3355 ( (ENETUNREACH == errno) || 3355 ( (ENETUNREACH == errno) ||
3356 (ENETDOWN == errno) ) ) 3356 (ENETDOWN == errno) ) )
3357 { 3357 {
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h
index 5a2fa6f05..7a6e09329 100644
--- a/src/transport/plugin_transport_udp.h
+++ b/src/transport/plugin_transport_udp.h
@@ -338,7 +338,7 @@ udp_broadcast_receive (struct Plugin *plugin,
338 ssize_t size, 338 ssize_t size,
339 const union UdpAddress *udp_addr, 339 const union UdpAddress *udp_addr,
340 size_t udp_addr_len, 340 size_t udp_addr_len,
341 enum GNUNET_ATS_Network_Type network_type); 341 enum GNUNET_NetworkType network_type);
342 342
343 343
344void 344void
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index bcb622a46..c802304aa 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -117,7 +117,7 @@ struct MstContext
117 /** 117 /**
118 * ATS network type. 118 * ATS network type.
119 */ 119 */
120 enum GNUNET_ATS_Network_Type ats_address_network_type; 120 enum GNUNET_NetworkType ats_address_network_type;
121}; 121};
122 122
123 123
@@ -186,7 +186,7 @@ udp_broadcast_receive (struct Plugin *plugin,
186 ssize_t size, 186 ssize_t size,
187 const union UdpAddress *udp_addr, 187 const union UdpAddress *udp_addr,
188 size_t udp_addr_len, 188 size_t udp_addr_len,
189 enum GNUNET_ATS_Network_Type network_type) 189 enum GNUNET_NetworkType network_type)
190{ 190{
191 struct GNUNET_MessageStreamTokenizer *broadcast_mst; 191 struct GNUNET_MessageStreamTokenizer *broadcast_mst;
192 struct MstContext mc; 192 struct MstContext mc;
@@ -410,7 +410,7 @@ iface_proc (void *cls,
410{ 410{
411 struct Plugin *plugin = cls; 411 struct Plugin *plugin = cls;
412 struct BroadcastAddress *ba; 412 struct BroadcastAddress *ba;
413 enum GNUNET_ATS_Network_Type network; 413 enum GNUNET_NetworkType network;
414 414
415 if (NULL == addr) 415 if (NULL == addr)
416 return GNUNET_OK; 416 return GNUNET_OK;
@@ -426,7 +426,7 @@ iface_proc (void *cls,
426 GNUNET_a2s (netmask, addrlen), name, netmask); 426 GNUNET_a2s (netmask, addrlen), name, netmask);
427 427
428 network = plugin->env->get_address_type (plugin->env->cls, broadcast_addr, addrlen); 428 network = plugin->env->get_address_type (plugin->env->cls, broadcast_addr, addrlen);
429 if (GNUNET_ATS_NET_LOOPBACK == network) 429 if (GNUNET_NT_LOOPBACK == network)
430 { 430 {
431 /* Broadcasting on loopback does not make sense */ 431 /* Broadcasting on loopback does not make sense */
432 return GNUNET_YES; 432 return GNUNET_YES;
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 3d177e703..19961d792 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -791,12 +791,12 @@ resend:
791 * @param session the session 791 * @param session the session
792 * @return the network type in HBO or #GNUNET_SYSERR 792 * @return the network type in HBO or #GNUNET_SYSERR
793 */ 793 */
794static enum GNUNET_ATS_Network_Type 794static enum GNUNET_NetworkType
795unix_plugin_get_network (void *cls, 795unix_plugin_get_network (void *cls,
796 struct GNUNET_ATS_Session *session) 796 struct GNUNET_ATS_Session *session)
797{ 797{
798 GNUNET_assert (NULL != session); 798 GNUNET_assert (NULL != session);
799 return GNUNET_ATS_NET_LOOPBACK; 799 return GNUNET_NT_LOOPBACK;
800} 800}
801 801
802 802
@@ -807,12 +807,12 @@ unix_plugin_get_network (void *cls,
807 * @param address the address 807 * @param address the address
808 * @return the network type 808 * @return the network type
809 */ 809 */
810static enum GNUNET_ATS_Network_Type 810static enum GNUNET_NetworkType
811unix_plugin_get_network_for_address (void *cls, 811unix_plugin_get_network_for_address (void *cls,
812 const struct GNUNET_HELLO_Address *address) 812 const struct GNUNET_HELLO_Address *address)
813 813
814{ 814{
815 return GNUNET_ATS_NET_LOOPBACK; 815 return GNUNET_NT_LOOPBACK;
816} 816}
817 817
818 818
@@ -982,7 +982,7 @@ unix_demultiplexer (struct Plugin *plugin,
982 plugin->env->session_start (NULL, 982 plugin->env->session_start (NULL,
983 session->address, 983 session->address,
984 session, 984 session,
985 GNUNET_ATS_NET_LOOPBACK); 985 GNUNET_NT_LOOPBACK);
986 } 986 }
987 else 987 else
988 { 988 {
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 13d2ca466..e34143c59 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -126,9 +126,9 @@ typedef int
126 * Which network scope do we belong to? 126 * Which network scope do we belong to?
127 */ 127 */
128#if BUILD_WLAN 128#if BUILD_WLAN
129static const enum GNUNET_ATS_Network_Type scope = GNUNET_ATS_NET_WLAN; 129static const enum GNUNET_NetworkType scope = GNUNET_NT_WLAN;
130#else 130#else
131static const enum GNUNET_ATS_Network_Type scope = GNUNET_ATS_NET_BT; 131static const enum GNUNET_NetworkType scope = GNUNET_NT_BT;
132#endif 132#endif
133 133
134 134
@@ -1297,14 +1297,14 @@ create_macendpoint (struct Plugin *plugin,
1297 * @param session the session 1297 * @param session the session
1298 * @return the network type in HBO or #GNUNET_SYSERR 1298 * @return the network type in HBO or #GNUNET_SYSERR
1299 */ 1299 */
1300static enum GNUNET_ATS_Network_Type 1300static enum GNUNET_NetworkType
1301wlan_plugin_get_network (void *cls, 1301wlan_plugin_get_network (void *cls,
1302 struct GNUNET_ATS_Session *session) 1302 struct GNUNET_ATS_Session *session)
1303{ 1303{
1304#if BUILD_WLAN 1304#if BUILD_WLAN
1305 return GNUNET_ATS_NET_WLAN; 1305 return GNUNET_NT_WLAN;
1306#else 1306#else
1307 return GNUNET_ATS_NET_BT; 1307 return GNUNET_NT_BT;
1308#endif 1308#endif
1309} 1309}
1310 1310
@@ -1316,14 +1316,14 @@ wlan_plugin_get_network (void *cls,
1316 * @param address the address 1316 * @param address the address
1317 * @return the network type 1317 * @return the network type
1318 */ 1318 */
1319static enum GNUNET_ATS_Network_Type 1319static enum GNUNET_NetworkType
1320wlan_plugin_get_network_for_address (void *cls, 1320wlan_plugin_get_network_for_address (void *cls,
1321 const struct GNUNET_HELLO_Address *address) 1321 const struct GNUNET_HELLO_Address *address)
1322{ 1322{
1323#if BUILD_WLAN 1323#if BUILD_WLAN
1324 return GNUNET_ATS_NET_WLAN; 1324 return GNUNET_NT_WLAN;
1325#else 1325#else
1326 return GNUNET_ATS_NET_BT; 1326 return GNUNET_NT_BT;
1327#endif 1327#endif
1328} 1328}
1329 1329
diff --git a/src/transport/plugin_transport_xt.c b/src/transport/plugin_transport_xt.c
index 0f517dd0c..08f59bd70 100644
--- a/src/transport/plugin_transport_xt.c
+++ b/src/transport/plugin_transport_xt.c
@@ -859,7 +859,7 @@ struct GNUNET_ATS_Session
859 /** 859 /**
860 * Network type of the address. 860 * Network type of the address.
861 */ 861 */
862 enum GNUNET_ATS_Network_Type scope; 862 enum GNUNET_NetworkType scope;
863 863
864 /** 864 /**
865 * Are we still expecting the welcome message? (#GNUNET_YES/#GNUNET_NO) 865 * Are we still expecting the welcome message? (#GNUNET_YES/#GNUNET_NO)
@@ -1896,7 +1896,7 @@ reschedule_session_timeout (struct GNUNET_ATS_Session *s)
1896static struct GNUNET_ATS_Session * 1896static struct GNUNET_ATS_Session *
1897create_session (struct Plugin *plugin, 1897create_session (struct Plugin *plugin,
1898 const struct GNUNET_HELLO_Address *address, 1898 const struct GNUNET_HELLO_Address *address,
1899 enum GNUNET_ATS_Network_Type scope, 1899 enum GNUNET_NetworkType scope,
1900 struct GNUNET_SERVER_Client *client, 1900 struct GNUNET_SERVER_Client *client,
1901 int is_nat) 1901 int is_nat)
1902{ 1902{
@@ -2442,7 +2442,7 @@ tcp_plugin_get_session (void *cls,
2442 const struct IPv4TcpAddress *t4; 2442 const struct IPv4TcpAddress *t4;
2443 const struct IPv6TcpAddress *t6; 2443 const struct IPv6TcpAddress *t6;
2444 unsigned int options; 2444 unsigned int options;
2445 enum GNUNET_ATS_Network_Type net_type; 2445 enum GNUNET_NetworkType net_type;
2446 unsigned int is_natd = GNUNET_NO; 2446 unsigned int is_natd = GNUNET_NO;
2447 size_t addrlen; 2447 size_t addrlen;
2448#ifdef TCP_STEALTH 2448#ifdef TCP_STEALTH
@@ -2545,7 +2545,7 @@ tcp_plugin_get_session (void *cls,
2545 net_type = plugin->env->get_address_type (plugin->env->cls, 2545 net_type = plugin->env->get_address_type (plugin->env->cls,
2546 sb, 2546 sb,
2547 sbs); 2547 sbs);
2548 GNUNET_break (net_type != GNUNET_ATS_NET_UNSPECIFIED); 2548 GNUNET_break (net_type != GNUNET_NT_UNSPECIFIED);
2549 2549
2550 if ( (is_natd == GNUNET_YES) && 2550 if ( (is_natd == GNUNET_YES) &&
2551 (addrlen == sizeof(struct IPv6TcpAddress)) ) 2551 (addrlen == sizeof(struct IPv6TcpAddress)) )
@@ -3269,7 +3269,7 @@ handle_tcp_welcome (void *cls,
3269 alen), 3269 alen),
3270 client, 3270 client,
3271 GNUNET_NO); 3271 GNUNET_NO);
3272 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != session->scope); 3272 GNUNET_break (GNUNET_NT_UNSPECIFIED != session->scope);
3273 GNUNET_HELLO_address_free (address); 3273 GNUNET_HELLO_address_free (address);
3274 LOG (GNUNET_ERROR_TYPE_DEBUG, 3274 LOG (GNUNET_ERROR_TYPE_DEBUG,
3275 "Creating new%s session %p for peer `%s' client %p\n", 3275 "Creating new%s session %p for peer `%s' client %p\n",
@@ -3629,7 +3629,7 @@ try_connection_reversal (void *cls,
3629 * @param session the session 3629 * @param session the session
3630 * @return the network type in HBO or #GNUNET_SYSERR 3630 * @return the network type in HBO or #GNUNET_SYSERR
3631 */ 3631 */
3632static enum GNUNET_ATS_Network_Type 3632static enum GNUNET_NetworkType
3633tcp_plugin_get_network (void *cls, 3633tcp_plugin_get_network (void *cls,
3634 struct GNUNET_ATS_Session *session) 3634 struct GNUNET_ATS_Session *session)
3635{ 3635{
@@ -3644,7 +3644,7 @@ tcp_plugin_get_network (void *cls,
3644 * @param address the address 3644 * @param address the address
3645 * @return the network type 3645 * @return the network type
3646 */ 3646 */
3647static enum GNUNET_ATS_Network_Type 3647static enum GNUNET_NetworkType
3648tcp_plugin_get_network_for_address (void *cls, 3648tcp_plugin_get_network_for_address (void *cls,
3649 const struct GNUNET_HELLO_Address *address) 3649 const struct GNUNET_HELLO_Address *address)
3650{ 3650{
@@ -3689,7 +3689,7 @@ tcp_plugin_get_network_for_address (void *cls,
3689 else 3689 else
3690 { 3690 {
3691 GNUNET_break (0); 3691 GNUNET_break (0);
3692 return GNUNET_ATS_NET_UNSPECIFIED; 3692 return GNUNET_NT_UNSPECIFIED;
3693 } 3693 }
3694 return plugin->env->get_address_type (plugin->env->cls, 3694 return plugin->env->get_address_type (plugin->env->cls,
3695 sb, 3695 sb,
diff --git a/src/transport/plugin_transport_xu.c b/src/transport/plugin_transport_xu.c
index 59e00f80e..639b38671 100644
--- a/src/transport/plugin_transport_xu.c
+++ b/src/transport/plugin_transport_xu.c
@@ -203,7 +203,7 @@ struct GNUNET_ATS_Session
203 /** 203 /**
204 * Network type of the address. 204 * Network type of the address.
205 */ 205 */
206 enum GNUNET_ATS_Network_Type scope; 206 enum GNUNET_NetworkType scope;
207 207
208 /** 208 /**
209 * Is this session about to be destroyed (sometimes we cannot 209 * Is this session about to be destroyed (sometimes we cannot
@@ -362,7 +362,7 @@ xu_query_keepalive_factor (void *cls)
362 * @param session the session 362 * @param session the session
363 * @return the network type 363 * @return the network type
364 */ 364 */
365static enum GNUNET_ATS_Network_Type 365static enum GNUNET_NetworkType
366xu_plugin_get_network (void *cls, 366xu_plugin_get_network (void *cls,
367 struct GNUNET_ATS_Session *session) 367 struct GNUNET_ATS_Session *session)
368{ 368{
@@ -378,7 +378,7 @@ xu_plugin_get_network (void *cls,
378 * @param address the address 378 * @param address the address
379 * @return the network type 379 * @return the network type
380 */ 380 */
381static enum GNUNET_ATS_Network_Type 381static enum GNUNET_NetworkType
382xu_plugin_get_network_for_address (void *cls, 382xu_plugin_get_network_for_address (void *cls,
383 const struct GNUNET_HELLO_Address *address) 383 const struct GNUNET_HELLO_Address *address)
384{ 384{
@@ -423,7 +423,7 @@ xu_plugin_get_network_for_address (void *cls,
423 else 423 else
424 { 424 {
425 GNUNET_break (0); 425 GNUNET_break (0);
426 return GNUNET_ATS_NET_UNSPECIFIED; 426 return GNUNET_NT_UNSPECIFIED;
427 } 427 }
428 return plugin->env->get_address_type (plugin->env->cls, 428 return plugin->env->get_address_type (plugin->env->cls,
429 sb, 429 sb,
@@ -1215,13 +1215,13 @@ analyze_send_error (struct Plugin *plugin,
1215 socklen_t slen, 1215 socklen_t slen,
1216 int error) 1216 int error)
1217{ 1217{
1218 enum GNUNET_ATS_Network_Type type; 1218 enum GNUNET_NetworkType type;
1219 1219
1220 type = plugin->env->get_address_type (plugin->env->cls, 1220 type = plugin->env->get_address_type (plugin->env->cls,
1221 sa, 1221 sa,
1222 slen); 1222 slen);
1223 if ( ( (GNUNET_ATS_NET_LAN == type) || 1223 if ( ( (GNUNET_NT_LAN == type) ||
1224 (GNUNET_ATS_NET_WAN == type) ) && 1224 (GNUNET_NT_WAN == type) ) &&
1225 ( (ENETUNREACH == errno) || 1225 ( (ENETUNREACH == errno) ||
1226 (ENETDOWN == errno) ) ) 1226 (ENETDOWN == errno) ) )
1227 { 1227 {
@@ -1619,7 +1619,7 @@ session_timeout (void *cls)
1619static struct GNUNET_ATS_Session * 1619static struct GNUNET_ATS_Session *
1620xu_plugin_create_session (void *cls, 1620xu_plugin_create_session (void *cls,
1621 const struct GNUNET_HELLO_Address *address, 1621 const struct GNUNET_HELLO_Address *address,
1622 enum GNUNET_ATS_Network_Type network_type) 1622 enum GNUNET_NetworkType network_type)
1623{ 1623{
1624 struct Plugin *plugin = cls; 1624 struct Plugin *plugin = cls;
1625 struct GNUNET_ATS_Session *s; 1625 struct GNUNET_ATS_Session *s;
@@ -1679,7 +1679,7 @@ xu_plugin_get_session (void *cls,
1679{ 1679{
1680 struct Plugin *plugin = cls; 1680 struct Plugin *plugin = cls;
1681 struct GNUNET_ATS_Session *s; 1681 struct GNUNET_ATS_Session *s;
1682 enum GNUNET_ATS_Network_Type network_type = GNUNET_ATS_NET_UNSPECIFIED; 1682 enum GNUNET_NetworkType network_type = GNUNET_NT_UNSPECIFIED;
1683 const struct IPv4XuAddress *xu_v4; 1683 const struct IPv4XuAddress *xu_v4;
1684 const struct IPv6XuAddress *xu_v6; 1684 const struct IPv6XuAddress *xu_v6;
1685 1685
@@ -1731,7 +1731,7 @@ xu_plugin_get_session (void *cls,
1731 (const struct sockaddr *) &v6, 1731 (const struct sockaddr *) &v6,
1732 sizeof (v6)); 1732 sizeof (v6));
1733 } 1733 }
1734 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); 1734 GNUNET_break (GNUNET_NT_UNSPECIFIED != network_type);
1735 return xu_plugin_create_session (cls, 1735 return xu_plugin_create_session (cls,
1736 address, 1736 address,
1737 network_type); 1737 network_type);
@@ -1752,12 +1752,12 @@ process_xu_message (struct Plugin *plugin,
1752 const struct XUMessage *msg, 1752 const struct XUMessage *msg,
1753 const union XuAddress *xu_addr, 1753 const union XuAddress *xu_addr,
1754 size_t xu_addr_len, 1754 size_t xu_addr_len,
1755 enum GNUNET_ATS_Network_Type network_type) 1755 enum GNUNET_NetworkType network_type)
1756{ 1756{
1757 struct GNUNET_ATS_Session *s; 1757 struct GNUNET_ATS_Session *s;
1758 struct GNUNET_HELLO_Address *address; 1758 struct GNUNET_HELLO_Address *address;
1759 1759
1760 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); 1760 GNUNET_break (GNUNET_NT_UNSPECIFIED != network_type);
1761 if (0 != ntohl (msg->reserved)) 1761 if (0 != ntohl (msg->reserved))
1762 { 1762 {
1763 GNUNET_break_op(0); 1763 GNUNET_break_op(0);
@@ -1827,7 +1827,7 @@ xu_select_read (struct Plugin *plugin,
1827 const struct sockaddr_in6 *sa6; 1827 const struct sockaddr_in6 *sa6;
1828 const union XuAddress *int_addr; 1828 const union XuAddress *int_addr;
1829 size_t int_addr_len; 1829 size_t int_addr_len;
1830 enum GNUNET_ATS_Network_Type network_type; 1830 enum GNUNET_NetworkType network_type;
1831 1831
1832 fromlen = sizeof (addr); 1832 fromlen = sizeof (addr);
1833 memset (&addr, 1833 memset (&addr,
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index 85ab9659d..47ba7aed4 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -499,12 +499,12 @@ env_notify_address (void *cls,
499} 499}
500 500
501 501
502static enum GNUNET_ATS_Network_Type 502static enum GNUNET_NetworkType
503env_get_address_type (void *cls, 503env_get_address_type (void *cls,
504 const struct sockaddr *addr, 504 const struct sockaddr *addr,
505 size_t addrlen) 505 size_t addrlen)
506{ 506{
507 return GNUNET_ATS_NET_LOOPBACK; 507 return GNUNET_NT_LOOPBACK;
508} 508}
509 509
510 510
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index cd93ff855..6309c3278 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -209,14 +209,14 @@ generate_config (const char *cfg_file,
209 "PATHS", 209 "PATHS",
210 "DEFAULTCONFIG", 210 "DEFAULTCONFIG",
211 fname); 211 fname);
212 for (int c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) 212 for (int c = 0; c < GNUNET_NT_COUNT; c++)
213 { 213 {
214 GNUNET_asprintf (&in_name, 214 GNUNET_asprintf (&in_name,
215 "%s_QUOTA_IN", 215 "%s_QUOTA_IN",
216 GNUNET_ATS_print_network_type (c)); 216 GNUNET_NT_to_string (c));
217 GNUNET_asprintf (&out_name, 217 GNUNET_asprintf (&out_name,
218 "%s_QUOTA_OUT", 218 "%s_QUOTA_OUT",
219 GNUNET_ATS_print_network_type (c)); 219 GNUNET_NT_to_string (c));
220 GNUNET_CONFIGURATION_set_value_number (cfg, 220 GNUNET_CONFIGURATION_set_value_number (cfg,
221 "ats", 221 "ats",
222 in_name, 222 in_name,
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 515c178f4..df1321d1a 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -692,7 +692,7 @@ struct GNUNET_TRANSPORT_AddAddressMessage
692 struct GNUNET_TIME_RelativeNBO expiration; 692 struct GNUNET_TIME_RelativeNBO expiration;
693 693
694 /** 694 /**
695 * An `enum GNUNET_ATS_Network_Type` in NBO. 695 * An `enum GNUNET_NetworkType` in NBO.
696 */ 696 */
697 uint32_t nt; 697 uint32_t nt;
698 698
@@ -801,7 +801,7 @@ struct GNUNET_TRANSPORT_AddQueueMessage
801 struct GNUNET_PeerIdentity receiver; 801 struct GNUNET_PeerIdentity receiver;
802 802
803 /** 803 /**
804 * An `enum GNUNET_ATS_Network_Type` in NBO. 804 * An `enum GNUNET_NetworkType` in NBO.
805 */ 805 */
806 uint32_t nt; 806 uint32_t nt;
807 807
@@ -988,7 +988,7 @@ struct GNUNET_TRANSPORT_MonitorData
988 struct GNUNET_MessageHeader header; 988 struct GNUNET_MessageHeader header;
989 989
990 /** 990 /**
991 * Network type (an `enum GNUNET_ATS_Network_Type` in NBO). 991 * Network type (an `enum GNUNET_NetworkType` in NBO).
992 */ 992 */
993 uint32_t nt GNUNET_PACKED; 993 uint32_t nt GNUNET_PACKED;
994 994
diff --git a/src/transport/transport_api2_communication.c b/src/transport/transport_api2_communication.c
index a89802ddd..ffd7f208e 100644
--- a/src/transport/transport_api2_communication.c
+++ b/src/transport/transport_api2_communication.c
@@ -251,7 +251,7 @@ struct GNUNET_TRANSPORT_QueueHandle
251 /** 251 /**
252 * Network type of the communciation queue. 252 * Network type of the communciation queue.
253 */ 253 */
254 enum GNUNET_ATS_Network_Type nt; 254 enum GNUNET_NetworkType nt;
255 255
256 /** 256 /**
257 * Communication status of the queue. 257 * Communication status of the queue.
@@ -318,7 +318,7 @@ struct GNUNET_TRANSPORT_AddressIdentifier
318 /** 318 /**
319 * Network type for the address. 319 * Network type for the address.
320 */ 320 */
321 enum GNUNET_ATS_Network_Type nt; 321 enum GNUNET_NetworkType nt;
322 322
323}; 323};
324 324
@@ -944,7 +944,7 @@ GNUNET_TRANSPORT_communicator_mq_add (struct GNUNET_TRANSPORT_CommunicatorHandle
944 const struct GNUNET_PeerIdentity *peer, 944 const struct GNUNET_PeerIdentity *peer,
945 const char *address, 945 const char *address,
946 uint32_t mtu, 946 uint32_t mtu,
947 enum GNUNET_ATS_Network_Type nt, 947 enum GNUNET_NetworkType nt,
948 uint32_t distance, 948 uint32_t distance,
949 enum GNUNET_TRANSPORT_ConnectionStatus cs, 949 enum GNUNET_TRANSPORT_ConnectionStatus cs,
950 struct GNUNET_MQ_Handle *mq) 950 struct GNUNET_MQ_Handle *mq)
@@ -1002,7 +1002,7 @@ GNUNET_TRANSPORT_communicator_mq_del (struct GNUNET_TRANSPORT_QueueHandle *qh)
1002struct GNUNET_TRANSPORT_AddressIdentifier * 1002struct GNUNET_TRANSPORT_AddressIdentifier *
1003GNUNET_TRANSPORT_communicator_address_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 1003GNUNET_TRANSPORT_communicator_address_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
1004 const char *address, 1004 const char *address,
1005 enum GNUNET_ATS_Network_Type nt, 1005 enum GNUNET_NetworkType nt,
1006 struct GNUNET_TIME_Relative expiration) 1006 struct GNUNET_TIME_Relative expiration)
1007{ 1007{
1008 struct GNUNET_TRANSPORT_AddressIdentifier *ai; 1008 struct GNUNET_TRANSPORT_AddressIdentifier *ai;
diff --git a/src/transport/transport_api2_monitor.c b/src/transport/transport_api2_monitor.c
index 3798296c1..ca9832e45 100644
--- a/src/transport/transport_api2_monitor.c
+++ b/src/transport/transport_api2_monitor.c
@@ -174,7 +174,7 @@ handle_monitor_data (void *cls,
174 struct GNUNET_TRANSPORT_MonitorInformation mi; 174 struct GNUNET_TRANSPORT_MonitorInformation mi;
175 175
176 mi.address = (const char *) &md[1]; 176 mi.address = (const char *) &md[1];
177 mi.nt = (enum GNUNET_ATS_Network_Type) ntohl (md->nt); 177 mi.nt = (enum GNUNET_NetworkType) ntohl (md->nt);
178 mi.cs = (enum GNUNET_TRANSPORT_ConnectionStatus) ntohl (md->cs); 178 mi.cs = (enum GNUNET_TRANSPORT_ConnectionStatus) ntohl (md->cs);
179 mi.num_msg_pending = ntohl (md->num_msg_pending); 179 mi.num_msg_pending = ntohl (md->num_msg_pending);
180 mi.num_bytes_pending = ntohl (md->num_bytes_pending); 180 mi.num_bytes_pending = ntohl (md->num_bytes_pending);