diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_ats_plugin.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_ats_service.h | 93 | ||||
-rw-r--r-- | src/include/gnunet_dv_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_hello_lib.h | 10 | ||||
-rw-r--r-- | src/include/gnunet_transport_communication_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_transport_hello_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_transport_monitor_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_transport_plugin.h | 8 |
8 files changed, 16 insertions, 111 deletions
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 | */ | ||
42 | enum 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 | */ | ||
229 | const char * | ||
230 | GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net); | ||
231 | |||
232 | |||
233 | /** | ||
234 | * Handle for the LAN Characterization library. | ||
235 | */ | ||
236 | struct 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 | */ | ||
247 | enum GNUNET_ATS_Network_Type | ||
248 | GNUNET_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 | */ | ||
258 | struct GNUNET_ATS_InterfaceScanner * | ||
259 | GNUNET_ATS_scanner_init (void); | ||
260 | |||
261 | |||
262 | /** | ||
263 | * Terminate interface scanner. | ||
264 | * | ||
265 | * @param is scanner we are done with | ||
266 | */ | ||
267 | void | ||
268 | GNUNET_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 | */ | ||
481 | enum GNUNET_ATS_Network_Type; | ||
482 | 478 | ||
483 | 479 | ||
484 | /** | 480 | /** |
@@ -493,7 +489,7 @@ enum GNUNET_ATS_Network_Type; | |||
493 | */ | 489 | */ |
494 | void | 490 | void |
495 | GNUNET_HELLO_sign_address (const char *address, | 491 | GNUNET_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 * | |||
514 | GNUNET_HELLO_extract_address (const void *raw, | 510 | GNUNET_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; | |||
261 | struct GNUNET_TRANSPORT_AddressIdentifier * | 261 | struct GNUNET_TRANSPORT_AddressIdentifier * |
262 | GNUNET_TRANSPORT_communicator_address_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch, | 262 | GNUNET_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 | */ |
134 | typedef enum GNUNET_ATS_Network_Type | 134 | typedef 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 | */ |
550 | typedef enum GNUNET_ATS_Network_Type | 550 | typedef 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 | */ |
562 | typedef enum GNUNET_ATS_Network_Type | 562 | typedef 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 | ||