RECLAIM/OIDC: code cleanup
[oweals/gnunet.git] / src / include / gnunet_hello_lib.h
index ceaa60466fc052677d5f14449e60b296108cfbf0..c46e847f16bbd39d09456cc271b0415dd32a8ab6 100644 (file)
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 
 /**
@@ -474,11 +476,7 @@ GNUNET_HELLO_parse_uri (const char *uri,
 
 
 /* NG API */
-/**
- * Defined in gnunet_ats_service.h, but here we do not care about
- * the details so are just giving the declaration.
- */
-enum GNUNET_ATS_Network_Type;
+#include "gnunet_nt_lib.h"
 
 
 /**
@@ -493,11 +491,11 @@ enum GNUNET_ATS_Network_Type;
  */
 void
 GNUNET_HELLO_sign_address (const char *address,
-                          enum GNUNET_ATS_Network_Type nt,
-                          struct GNUNET_TIME_Absolute expiration,
-                          const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
-                          void **result,
-                          size_t *result_size);
+                           enum GNUNET_NetworkType nt,
+                           struct GNUNET_TIME_Absolute expiration,
+                           const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
+                           void **result,
+                           size_t *result_size);
 
 
 /**
@@ -505,18 +503,28 @@ GNUNET_HELLO_sign_address (const char *address,
  *
  * @param raw raw signed address
  * @param raw_size size of @a raw
- * @param public_key public key to use for signature verification
+ * @param pid public key to use for signature verification
  * @param nt[out] set to network type
  * @param expiration[out] how long is the address valid
  * @return NULL on error, otherwise the address
  */
 char *
 GNUNET_HELLO_extract_address (const void *raw,
-                             size_t raw_size,
-                             const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
-                             enum GNUNET_ATS_Network_Type *nt,
-                             struct GNUNET_TIME_Absolute *expiration);
+                              size_t raw_size,
+                              const struct GNUNET_PeerIdentity *pid,
+                              enum GNUNET_NetworkType *nt,
+                              struct GNUNET_TIME_Absolute *expiration);
+
 
+/**
+ * Given an address as a string, extract the prefix that identifies
+ * the communicator offering transmissions to that address.
+ *
+ * @param address a peer's address
+ * @return NULL if the address is mal-formed, otherwise the prefix
+ */
+char *
+GNUNET_HELLO_address_to_prefix (const char *address);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */