determine network scope for ATS even if we do not yet have a session and only have...
[oweals/gnunet.git] / src / transport / gnunet-service-transport_ats.c
index 55b5e20a17e3575bde71494ad65f5254778054c8..5124cd57852d22cde8e108bb70883f5aa99468d6 100644 (file)
@@ -249,11 +249,11 @@ find_ai_no_session (const struct GNUNET_HELLO_Address *address)
 
 
 /**
- * Test if ATS knows about this address.
+ * Test if ATS knows about this @a address and @a session.
  *
  * @param address the address
  * @param session the session
- * @return #GNUNET_YES if address is known, #GNUNET_NO if not.
+ * @return #GNUNET_YES if @a address is known, #GNUNET_NO if not.
  */
 int
 GST_ats_is_known (const struct GNUNET_HELLO_Address *address,
@@ -263,6 +263,19 @@ GST_ats_is_known (const struct GNUNET_HELLO_Address *address,
 }
 
 
+/**
+ * Test if ATS knows about this @a address.
+ *
+ * @param address the address
+ * @return #GNUNET_YES if @a address is known, #GNUNET_NO if not.
+ */
+int
+GST_ats_is_known_no_session (const struct GNUNET_HELLO_Address *address)
+{
+  return (NULL != find_ai_no_session (address)) ? GNUNET_YES : GNUNET_NO;
+}
+
+
 /**
  * The blocking time for an address has expired, allow ATS to
  * suggest it again.
@@ -465,6 +478,7 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
                                                     GNUNET_HELLO_ADDRESS_INFO_INBOUND));
   ai = find_ai_no_session (address);
   GNUNET_assert (NULL == ai);
+  GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
   LOG (GNUNET_ERROR_TYPE_INFO,
        "Notifying ATS about peer `%s''s new address `%s'\n",
        GNUNET_i2s (&address->peer),