diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-17 22:20:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-17 22:20:18 +0000 |
commit | 81b92caa24a83620032438df9c5ee3ea51663a02 (patch) | |
tree | 2b2df659c94e1ead5bbdb5082e50018c39e68796 /src/include | |
parent | 4756cb0779daf3e4c33b6e876dce956de7ee6dd8 (diff) | |
download | gnunet-81b92caa24a83620032438df9c5ee3ea51663a02.tar.gz gnunet-81b92caa24a83620032438df9c5ee3ea51663a02.zip |
simplify ATS API and plugin API by returning the network type, instead of an ATS_Information struct
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_ats_service.h | 16 | ||||
-rw-r--r-- | src/include/gnunet_transport_plugin.h | 8 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index 7be2e4758..e09dc5d75 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -35,11 +35,6 @@ | |||
35 | */ | 35 | */ |
36 | #define GNUNET_ATS_NetworkTypeCount 6 | 36 | #define GNUNET_ATS_NetworkTypeCount 6 |
37 | 37 | ||
38 | /** | ||
39 | * ATS network types as array initializer | ||
40 | */ | ||
41 | #define GNUNET_ATS_NetworkType { GNUNET_ATS_NET_UNSPECIFIED, GNUNET_ATS_NET_LOOPBACK, GNUNET_ATS_NET_LAN, GNUNET_ATS_NET_WAN, GNUNET_ATS_NET_WLAN, GNUNET_ATS_NET_BT } | ||
42 | |||
43 | 38 | ||
44 | /** | 39 | /** |
45 | * Types of networks (with separate quotas) we support. | 40 | * Types of networks (with separate quotas) we support. |
@@ -79,6 +74,13 @@ enum GNUNET_ATS_Network_Type | |||
79 | 74 | ||
80 | 75 | ||
81 | /** | 76 | /** |
77 | * ATS network types as array initializer | ||
78 | */ | ||
79 | #define GNUNET_ATS_NetworkType { GNUNET_ATS_NET_UNSPECIFIED, GNUNET_ATS_NET_LOOPBACK, GNUNET_ATS_NET_LAN, GNUNET_ATS_NET_WAN, GNUNET_ATS_NET_WLAN, GNUNET_ATS_NET_BT } | ||
80 | |||
81 | |||
82 | |||
83 | /** | ||
82 | * Default bandwidth assigned to a network : 64 KB/s | 84 | * Default bandwidth assigned to a network : 64 KB/s |
83 | */ | 85 | */ |
84 | #define GNUNET_ATS_DefaultBandwidth 65536 | 86 | #define GNUNET_ATS_DefaultBandwidth 65536 |
@@ -430,9 +432,9 @@ GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net); | |||
430 | * @param sh the `struct GNUNET_ATS_SchedulingHandle` handle | 432 | * @param sh the `struct GNUNET_ATS_SchedulingHandle` handle |
431 | * @param addr address | 433 | * @param addr address |
432 | * @param addrlen address length | 434 | * @param addrlen address length |
433 | * @return location as `struct GNUNET_ATS_Information` | 435 | * @return type of the network the address belongs to |
434 | */ | 436 | */ |
435 | struct GNUNET_ATS_Information | 437 | enum GNUNET_ATS_Network_Type |
436 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, | 438 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, |
437 | const struct sockaddr *addr, | 439 | const struct sockaddr *addr, |
438 | socklen_t addrlen); | 440 | socklen_t addrlen); |
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index 17333551c..90d6ed2c6 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h | |||
@@ -120,15 +120,15 @@ typedef struct GNUNET_TIME_Relative | |||
120 | 120 | ||
121 | 121 | ||
122 | /** | 122 | /** |
123 | * Function that will be called to figure if an address is an loopback, | 123 | * Function that will be called to figure if an address is an |
124 | * LAN, WAN etc. address | 124 | * loopback, LAN, WAN etc. address |
125 | * | 125 | * |
126 | * @param cls closure | 126 | * @param cls closure |
127 | * @param addr binary address | 127 | * @param addr binary address |
128 | * @param addrlen length of the @a addr | 128 | * @param addrlen length of the @a addr |
129 | * @return ATS Information containing the network type | 129 | * @return type of the network the address belongs to |
130 | */ | 130 | */ |
131 | typedef struct GNUNET_ATS_Information | 131 | typedef enum GNUNET_ATS_Network_Type |
132 | (*GNUNET_TRANSPORT_AddressToType) (void *cls, | 132 | (*GNUNET_TRANSPORT_AddressToType) (void *cls, |
133 | const struct sockaddr *addr, | 133 | const struct sockaddr *addr, |
134 | size_t addrlen); | 134 | size_t addrlen); |