+ GNUNET_ATS_address_destroyed (GST_ats, &address, session);
+}
+
+
+/**
+ * Function that will be called to figure if an address is an loopback,
+ * LAN, WAN etc. address
+ *
+ * @param cls closure
+ * @param addr binary address
+ * @param addrlen length of the address
+ * @return ATS Information containing the network type
+ */
+static const struct GNUNET_ATS_Information
+plugin_env_address_to_type (void *cls,
+ const struct sockaddr *addr,
+ size_t addrlen)
+{
+ struct GNUNET_ATS_Information ats;
+ ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
+ ats.value = htonl (GNUNET_ATS_NET_UNSPECIFIED);
+ if (GST_ats == NULL)
+ {
+ GNUNET_break (0);
+ return ats;
+ }
+ if (((addr->sa_family != AF_INET) && (addrlen != sizeof (struct sockaddr_in))) &&
+ ((addr->sa_family != AF_INET6) && (addrlen != sizeof (struct sockaddr_in6))) &&
+ (addr->sa_family != AF_UNIX))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Malformed address with length %u `%s'\n",
+ addrlen,
+ GNUNET_a2s(addr, addrlen));
+ GNUNET_break (0);
+ return (const struct GNUNET_ATS_Information) ats;
+ }
+ return GNUNET_ATS_address_get_type(GST_ats, addr, addrlen);