GNUnet  0.11.x
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 
32 #ifndef GNUNET_HELLO_URI_LIB_H
33 #define GNUNET_HELLO_URI_LIB_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #if 0 /* keep Emacsens' auto-indent happy */
38 }
39 #endif
40 #endif
41 
42 #include "gnunet_util_lib.h"
43 
44 
49 
50 
54 #define GNUNET_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply ( \
55  GNUNET_TIME_UNIT_DAYS, 2)
56 
57 
64 struct GNUNET_HELLO_Builder *
66 
67 
73 void
75 
76 
83 struct GNUNET_HELLO_Builder *
85 
86 
94 struct GNUNET_HELLO_Builder *
95 GNUNET_HELLO_builder_from_block (const void *block,
96  size_t block_size);
97 
98 
105 struct GNUNET_HELLO_Builder *
106 GNUNET_HELLO_builder_from_url (const char *url);
107 
108 
117 struct GNUNET_MQ_Envelope *
119  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
120 
121 
129 struct GNUNET_MessageHeader *
131  const struct GNUNET_HELLO_Builder *builder,
132  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
133 
134 
142 char *
144  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
145 
159  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
160  void *block,
161  size_t *block_size);
162 
163 
174  const char *address);
175 
176 
187  const char *address);
188 
189 
196 typedef void
197 (*GNUNET_HELLO_UriCallback) (void *cls,
198  const char *uri);
199 
200 
209 void
211  struct GNUNET_PeerIdentity *pid,
213  void *uc_cls);
214 
215 
230  const struct GNUNET_PeerIdentity *pid,
231  void **block,
232  size_t *block_size,
233  struct GNUNET_TIME_Absolute *block_expiration);
234 
235 
236 #if 0 /* keep Emacsens' auto-indent happy */
237 {
238 #endif
239 #ifdef __cplusplus
240 }
241 #endif
242 
243 /* ifndef GNUNET_HELLO_URI_LIB_H */
244 #endif
245  /* end of group */
247 
248 /* 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
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:92
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_block(const void *block, size_t block_size)
Parse block into builder.
Definition: hello-uri.c:353
void GNUNET_HELLO_builder_free(struct GNUNET_HELLO_Builder *builder)
Release resources of a builder.
Definition: hello-uri.c:312
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:837
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:579
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:815
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:791
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_msg(const struct GNUNET_MessageHeader *msg)
Parse msg into builder.
Definition: hello-uri.c:330
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:741
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:692
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_new(const struct GNUNET_PeerIdentity *pid)
Allocate builder.
Definition: hello-uri.c:301
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_url(const char *url)
Parse GNUnet HELLO url into builder.
Definition: hello-uri.c:409
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:627
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:547
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.