GNUnet  0.17.6
gnunet_hello_uri_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2022 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
35 #ifndef GNUNET_HELLO_URI_LIB_H
36 #define GNUNET_HELLO_URI_LIB_H
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #if 0 /* keep Emacsens' auto-indent happy */
41 }
42 #endif
43 #endif
44 
45 #include "gnunet_util_lib.h"
46 
47 
52 
53 
57 #define GNUNET_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply ( \
58  GNUNET_TIME_UNIT_DAYS, 2)
59 
60 
67 struct GNUNET_HELLO_Builder *
69 
70 
76 void
78 
79 
86 struct GNUNET_HELLO_Builder *
88 
89 
97 struct GNUNET_HELLO_Builder *
98 GNUNET_HELLO_builder_from_block (const void *block,
99  size_t block_size);
100 
101 
108 struct GNUNET_HELLO_Builder *
109 GNUNET_HELLO_builder_from_url (const char *url);
110 
111 
120 struct GNUNET_MQ_Envelope *
122  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
123 
124 
132 struct GNUNET_MessageHeader *
134  const struct GNUNET_HELLO_Builder *builder,
135  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
136 
137 
145 char *
147  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
148 
162  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
163  void *block,
164  size_t *block_size);
165 
166 
177  const char *address);
178 
179 
190  const char *address);
191 
192 
199 typedef void
200 (*GNUNET_HELLO_UriCallback) (void *cls,
201  const char *uri);
202 
203 
212 void
214  struct GNUNET_PeerIdentity *pid,
216  void *uc_cls);
217 
218 
233  const struct GNUNET_PeerIdentity *pid,
234  void **block,
235  size_t *block_size,
236  struct GNUNET_TIME_Absolute *block_expiration);
237 
238 
239 #if 0 /* keep Emacsens' auto-indent happy */
240 {
241 #endif
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 /* ifndef GNUNET_HELLO_URI_LIB_H */
247 #endif
248  /* end of group */
250  /* end of group addition */
252 
253 /* end of gnunet_hello_uri_lib.h */
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static char * address
GNS address for this phone.
static struct HostSet * builder
NULL if we are not currently iterating over peer information.
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static struct GNUNET_FS_UnindexContext * uc
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_block(const void *block, size_t block_size)
Parse block into builder.
Definition: hello-uri.c:360
void GNUNET_HELLO_builder_free(struct GNUNET_HELLO_Builder *builder)
Release resources of a builder.
Definition: hello-uri.c:319
enum GNUNET_GenericReturnValue GNUNET_HELLO_dht_msg_to_block(const struct GNUNET_MessageHeader *hello, const struct GNUNET_PeerIdentity *pid, void **block, size_t *block_size, struct GNUNET_TIME_Absolute *block_expiration)
Convert a DHT hello message to a HELLO block.
Definition: hello-uri.c:844
struct GNUNET_MessageHeader * GNUNET_HELLO_builder_to_dht_hello_msg(const struct GNUNET_HELLO_Builder *builder, const struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
Generate DHT HELLO message (without peer ID) from a builder.
Definition: hello-uri.c:586
void GNUNET_HELLO_builder_iterate(const struct GNUNET_HELLO_Builder *builder, struct GNUNET_PeerIdentity *pid, GNUNET_HELLO_UriCallback uc, void *uc_cls)
Iterate over URIs in a builder.
Definition: hello-uri.c:822
enum GNUNET_GenericReturnValue GNUNET_HELLO_builder_del_address(struct GNUNET_HELLO_Builder *builder, const char *address)
Remove individual address from the builder.
Definition: hello-uri.c:798
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_msg(const struct GNUNET_MessageHeader *msg)
Parse msg into builder.
Definition: hello-uri.c:337
enum GNUNET_GenericReturnValue GNUNET_HELLO_builder_add_address(struct GNUNET_HELLO_Builder *builder, const char *address)
Add individual address to the builder.
Definition: hello-uri.c:748
enum GNUNET_GenericReturnValue GNUNET_HELLO_builder_to_block(const struct GNUNET_HELLO_Builder *builder, const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, void *block, size_t *block_size)
Generate DHT block from a builder.
Definition: hello-uri.c:699
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_new(const struct GNUNET_PeerIdentity *pid)
Allocate builder.
Definition: hello-uri.c:308
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_url(const char *url)
Parse GNUnet HELLO url into builder.
Definition: hello-uri.c:416
void(* GNUNET_HELLO_UriCallback)(void *cls, const char *uri)
Callback function used to extract URIs from a builder.
char * GNUNET_HELLO_builder_to_url(const struct GNUNET_HELLO_Builder *builder, const struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
Generate GNUnet HELLO URI from a builder.
Definition: hello-uri.c:634
struct GNUNET_MQ_Envelope * GNUNET_HELLO_builder_to_env(const struct GNUNET_HELLO_Builder *builder, const struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
Generate envelope with GNUnet HELLO message (including peer ID) from a builder.
Definition: hello-uri.c:554
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:96
Private ECC key encoded for transmission.
Context for building (or parsing) HELLO URIs.
Definition: hello-uri.c:184
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.