From 81b92caa24a83620032438df9c5ee3ea51663a02 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 17 Jan 2015 22:20:18 +0000 Subject: simplify ATS API and plugin API by returning the network type, instead of an ATS_Information struct --- src/include/gnunet_ats_service.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/include/gnunet_ats_service.h') 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 @@ */ #define GNUNET_ATS_NetworkTypeCount 6 -/** - * ATS network types as array initializer - */ -#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 } - /** * Types of networks (with separate quotas) we support. @@ -78,6 +73,13 @@ enum GNUNET_ATS_Network_Type }; +/** + * ATS network types as array initializer + */ +#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 } + + + /** * Default bandwidth assigned to a network : 64 KB/s */ @@ -430,9 +432,9 @@ GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net); * @param sh the `struct GNUNET_ATS_SchedulingHandle` handle * @param addr address * @param addrlen address length - * @return location as `struct GNUNET_ATS_Information` + * @return type of the network the address belongs to */ -struct GNUNET_ATS_Information +enum GNUNET_ATS_Network_Type GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, const struct sockaddr *addr, socklen_t addrlen); -- cgit v1.2.3