summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_wlan.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-07 14:15:38 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-07 14:15:38 +0000
commite5bd8fb4aa72717b8707a4652f14c0735acb52c4 (patch)
tree08398e22b9408cc24b6b9e6cb360fe04b9eeae05 /src/transport/plugin_transport_wlan.c
parent572bab1ace57fb9d7acbd218d6940cb1e9a0797b (diff)
determine network scope for ATS even if we do not yet have a session and only have an address
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r--src/transport/plugin_transport_wlan.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 52f454560..d5932bb30 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -1292,6 +1292,25 @@ wlan_plugin_get_network (void *cls,
/**
+ * Function obtain the network type for an address.
+ *
+ * @param cls closure (`struct Plugin *`)
+ * @param address the address
+ * @return the network type
+ */
+static enum GNUNET_ATS_Network_Type
+wlan_plugin_get_network_for_address (void *cls,
+ const struct GNUNET_HELLO_Address *address)
+{
+#if BUILD_WLAN
+ return GNUNET_ATS_NET_WLAN;
+#else
+ return GNUNET_ATS_NET_BT;
+#endif
+}
+
+
+/**
* Creates a new outbound session the transport service will use to
* send data to the peer
*
@@ -2332,6 +2351,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
api->address_to_string = &wlan_plugin_address_to_string;
api->string_to_address = &wlan_plugin_string_to_address;
api->get_network = &wlan_plugin_get_network;
+ api->get_network_for_address = &wlan_plugin_get_network_for_address;
api->update_session_timeout = &wlan_plugin_update_session_timeout;
api->update_inbound_delay = &wlan_plugin_update_inbound_delay;
api->setup_monitor = &wlan_plugin_setup_monitor;