GNUnet  0.11.x
plugin_dhtu_gnunet.c
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2021 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 
27 #include "platform.h"
28 #include "gnunet_dhtu_plugin.h"
29 #include "gnunet_ats_service.h"
30 #include "gnunet_core_service.h"
32 #include "gnunet_hello_lib.h"
34 #include "gnunet_nse_service.h"
35 
36 
41 {
46 
47 };
48 
50 
54 struct PublicKey
55 {
56 
61 
66 
67 };
68 
69 
71 
72 
77 {
81  struct HelloHandle *next;
82 
86  struct HelloHandle *prev;
87 
91  struct Plugin *plugin;
92 
97 
98 };
99 
100 
106 {
107 
111  void *app_ctx;
112 
116  struct GNUNET_DHTU_Hash my_id;
117 
121  struct GNUNET_DHTU_PrivateKey pk;
122 
123 };
124 
125 
131 {
132 
136  void *app_ctx;
137 
141  struct Plugin *plugin;
142 
147 
151  struct PublicKey pk;
152 
157  struct GNUNET_DHTU_Hash peer_id;
158 
163 
168 
173 
177  unsigned int ph_count;
178 
179 };
180 
181 
187 {
192 
197 
202 };
203 
204 
208 struct Plugin
209 {
210 
215  struct GNUNET_DHTU_Source src;
216 
221 
226 
231 
236 
241 
246 
251 
256 };
257 
258 
268 static ssize_t
269 ip_sign (void *cls,
270  const struct GNUNET_DHTU_PrivateKey *pk,
271  const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
272  void **sig)
273 {
274  struct GNUNET_CRYPTO_EddsaSignature *es;
275 
277  GNUNET_CRYPTO_eddsa_sign_ (&pk->eddsa_priv,
278  purpose,
279  es);
280  *sig = es;
281  return sizeof (*es);
282 }
283 
284 
297 static enum GNUNET_GenericReturnValue
298 ip_verify (void *cls,
299  const struct GNUNET_DHTU_PublicKey *pk,
300  const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
301  const void *sig,
302  size_t sig_size)
303 {
304  const struct GNUNET_CRYPTO_EddsaSignature *es = sig;
305  const struct PublicKey *pub;
306 
307  GNUNET_assert (sizeof (struct PublicKey) ==
308  ntohs (pk->size));
309  pub = (const struct PublicKey *) pk;
310  if (sizeof (*es) != sig_size)
311  {
312  GNUNET_break_op (0);
313  return GNUNET_SYSERR;
314  }
315  if (GNUNET_OK !=
316  GNUNET_CRYPTO_eddsa_verify_ (ntohl (purpose->purpose),
317  purpose,
318  es,
319  &pub->peer_pub.public_key))
320  {
321  GNUNET_break_op (0);
322  return GNUNET_SYSERR;
323  }
324  return GNUNET_OK;
325 }
326 
327 
333 static void
334 hello_offered_cb (void *cls)
335 {
336  struct HelloHandle *hh = cls;
337  struct Plugin *plugin = hh->plugin;
338 
340  plugin->hh_tail,
341  hh);
342  GNUNET_free (hh);
343 }
344 
345 
346 #include "../peerinfo-tool/gnunet-peerinfo_plugins.c"
347 
348 
355 static void
356 ip_try_connect (void *cls,
357  const char *address)
358 {
359  struct Plugin *plugin = cls;
360  struct GNUNET_HELLO_Message *hello = NULL;
361  struct HelloHandle *hh;
363 
364  if (GNUNET_OK !=
366  &pubkey,
367  &hello,
369  {
370  GNUNET_break (0);
371  return;
372  }
373 
374  hh = GNUNET_new (struct HelloHandle);
375  hh->plugin = plugin;
377  plugin->hh_tail,
378  hh);
380  &hello->header,
382  hh);
383  GNUNET_free (hello);
384 }
385 
386 
395 static struct GNUNET_DHTU_PreferenceHandle *
396 ip_hold (void *cls,
397  struct GNUNET_DHTU_Target *target)
398 {
399  struct Plugin *plugin = cls;
401 
403  ph->target = target;
405  target->ph_tail,
406  ph);
407  target->ph_count++;
408  if (NULL != target->csh)
410  target->csh
412  &target->pk.peer_pub,
413  target->ph_count);
414  return ph;
415 }
416 
417 
424 static void
426 {
427  struct GNUNET_DHTU_Target *target = ph->target;
428  struct Plugin *plugin = target->plugin;
429 
431  target->ph_tail,
432  ph);
433  target->ph_count--;
434  GNUNET_free (ph);
435  if (NULL != target->csh)
437  if (0 == target->ph_count)
438  target->csh = NULL;
439  else
440  target->csh
442  &target->pk.peer_pub,
443  target->ph_count);
444 }
445 
446 
462 static void
463 ip_send (void *cls,
464  struct GNUNET_DHTU_Target *target,
465  const void *msg,
466  size_t msg_size,
467  GNUNET_SCHEDULER_TaskCallback finished_cb,
468  void *finished_cb_cls)
469 {
470  struct GNUNET_MQ_Envelope *env;
471  struct GNUNET_MessageHeader *cmsg;
472 
473  env = GNUNET_MQ_msg_extra (cmsg,
474  msg_size,
477  finished_cb,
478  finished_cb_cls);
479  memcpy (&cmsg[1],
480  msg,
481  msg_size);
482  GNUNET_MQ_send (target->mq,
483  env);
484 }
485 
486 
495 static void *
496 core_connect_cb (void *cls,
497  const struct GNUNET_PeerIdentity *peer,
498  struct GNUNET_MQ_Handle *mq)
499 {
500  struct Plugin *plugin = cls;
501  struct GNUNET_DHTU_Target *target;
502 
503  target = GNUNET_new (struct GNUNET_DHTU_Target);
504  target->plugin = plugin;
505  target->mq = mq;
506  target->pk.header.size = htons (sizeof (struct PublicKey));
507  target->pk.peer_pub = *peer;
509  sizeof (struct GNUNET_PeerIdentity),
510  &target->peer_id.hc);
511  plugin->env->connect_cb (plugin->env->cls,
512  &target->pk.header,
513  &target->peer_id,
514  target,
515  &target->app_ctx);
516  return target;
517 }
518 
519 
528 static void
530  const struct GNUNET_PeerIdentity *peer,
531  void *peer_cls)
532 {
533  struct Plugin *plugin = cls;
534  struct GNUNET_DHTU_Target *target = peer_cls;
535 
536  plugin->env->disconnect_cb (target->app_ctx);
537  if (NULL != target->csh)
539  GNUNET_free (target);
540 }
541 
542 
555 static void
556 peerinfo_cb (void *cls,
557  const struct GNUNET_PeerIdentity *peer,
558  const struct GNUNET_HELLO_Message *hello,
559  const char *err_msg)
560 {
561  struct Plugin *plugin = cls;
562  char *addr;
563 
564  if (NULL == hello)
565  return;
566  if (NULL == peer)
567  return;
568  if (0 !=
570  &plugin->my_identity))
571  return;
572  addr = GNUNET_HELLO_compose_uri (hello,
574  if (NULL == addr)
575  return;
577  sizeof (struct GNUNET_PeerIdentity),
578  &plugin->src.my_id.hc);
579  plugin->env->address_add_cb (plugin->env->cls,
580  &plugin->src.my_id,
581  &plugin->src.pk,
582  addr,
583  &plugin->src,
584  &plugin->src.app_ctx);
585  GNUNET_free (addr);
586 }
587 
588 
601 static void
602 core_init_cb (void *cls,
603  const struct GNUNET_PeerIdentity *my_identity)
604 {
605  struct Plugin *plugin = cls;
606 
609  GNUNET_NO,
610  &peerinfo_cb,
611  plugin);
612 }
613 
614 
622 static int
624  const struct GNUNET_MessageHeader *msg)
625 {
626  (void) cls;
627  (void) msg;
628  return GNUNET_OK;
629 }
630 
631 
639 static void
641  const struct GNUNET_MessageHeader *msg)
642 {
643  struct GNUNET_DHTU_Target *origin = cls;
644  struct Plugin *plugin = origin->plugin;
645 
646  plugin->env->receive_cb (plugin->env->cls,
647  &origin->app_ctx,
648  &plugin->src.app_ctx,
649  &msg[1],
650  ntohs (msg->size) - sizeof (*msg));
651 }
652 
653 
662 static void
663 nse_cb (void *cls,
664  struct GNUNET_TIME_Absolute timestamp,
665  double logestimate,
666  double std_dev)
667 {
668  struct Plugin *plugin = cls;
669 
670  plugin->env->network_size_cb (plugin->env->cls,
671  timestamp,
672  logestimate,
673  std_dev);
674 }
675 
676 
683 void *
685 {
686  struct GNUNET_DHTU_PluginFunctions *api = cls;
687  struct Plugin *plugin = api->cls;
688  struct HelloHandle *hh;
689 
690  while (NULL != (hh = plugin->hh_head))
691  {
693  plugin->hh_tail,
694  hh);
696  GNUNET_free (hh);
697  }
698  if (NULL != plugin->nse)
700  if (NULL != plugin->core)
702  if (NULL != plugin->ats)
704  if (NULL != plugin->nc)
708  GNUNET_free (api);
709  return NULL;
710 }
711 
712 
719 void *
721 {
723  struct GNUNET_DHTU_PluginFunctions *api;
724  struct Plugin *plugin;
726  GNUNET_MQ_hd_var_size (core_message,
728  struct GNUNET_MessageHeader,
729  NULL),
731  };
733 
735  if (NULL == pk)
736  {
737  GNUNET_break (0);
738  return NULL;
739  }
740  plugin = GNUNET_new (struct Plugin);
741  plugin->env = env;
742  plugin->src.pk.eddsa_priv = *pk;
743  GNUNET_free (pk);
745  api->cls = plugin;
746  api->sign = &ip_sign;
747  api->verify = &ip_verify;
748  api->try_connect = &ip_try_connect;
749  api->hold = &ip_hold;
750  api->drop = &ip_drop;
751  api->send = &ip_send;
754  plugin,
755  &core_init_cb,
758  handlers);
759  plugin->nse = GNUNET_NSE_connect (env->cfg,
760  &nse_cb,
761  plugin);
762  if ( (NULL == plugin->ats) ||
763  (NULL == plugin->core) ||
764  (NULL == plugin->nse) )
765  {
766  GNUNET_break (0);
768  return NULL;
769  }
770  GPI_plugins_load (env->cfg);
771  return api;
772 }
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static struct GNUNET_ATS_PerformanceHandle * ph
ATS performance handle used.
Definition: gnunet-ats.c:116
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
struct Plugin * plugin
The process handle to the testbed service.
static char * address
GNS address for this phone.
struct GNUNET_IDENTITY_PrivateKey pk
Private key from command line option, or NULL.
static struct GNUNET_IDENTITY_PublicKey pubkey
Public key of the zone to look in.
struct GNUNET_TRANSPORT_PluginFunctions * GPI_plugins_find(const char *name)
Obtain the plugin API based on a plugin name.
void GPI_plugins_load(const struct GNUNET_CONFIGURATION_Handle *cfg)
Load and initialize all plugins.
void GPI_plugins_unload()
Unload all plugins.
static struct GNUNET_CRYPTO_EddsaPublicKey pub
Definition: gnunet-scrypt.c:46
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
Automatic transport selection and outbound bandwidth determination.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:92
@ GNUNET_OK
Definition: gnunet_common.h:95
@ GNUNET_NO
Definition: gnunet_common.h:94
@ GNUNET_SYSERR
Definition: gnunet_common.h:93
struct GNUNET_ATS_ConnectivityHandle * GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the ATS connectivity suggestion client handle.
struct GNUNET_ATS_ConnectivitySuggestHandle * GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, const struct GNUNET_PeerIdentity *peer, uint32_t strength)
We would like to receive address suggestions for a peer.
void GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch)
Client is done with ATS connectivity management, release resources.
void GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh)
We no longer care about being connected to a peer.
struct GNUNET_CORE_Handle * GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_CORE_StartupCallback init, GNUNET_CORE_ConnectEventHandler connects, GNUNET_CORE_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Connect to the core service.
Definition: core_api.c:692
void GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle)
Disconnect from the core service.
Definition: core_api.c:730
int GNUNET_CRYPTO_eddsa_verify_(uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Verify EdDSA signature.
Definition: crypto_ecc.c:682
struct GNUNET_CRYPTO_EddsaPrivateKey * GNUNET_CRYPTO_eddsa_key_create_from_configuration(const struct GNUNET_CONFIGURATION_Handle *cfg)
Create a new private key by reading our peer's key from the file specified in the configuration.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
EdDSA sign a given block.
Definition: crypto_ecc.c:599
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
int GNUNET_HELLO_parse_uri(const char *uri, struct GNUNET_CRYPTO_EddsaPublicKey *pubkey, struct GNUNET_HELLO_Message **hello, GNUNET_HELLO_TransportPluginsFind plugins_find)
Parse a hello URI string to a hello message.
Definition: hello.c:1217
char * GNUNET_HELLO_compose_uri(const struct GNUNET_HELLO_Message *hello, GNUNET_HELLO_TransportPluginsFind plugins_find)
Compose a hello URI string from a hello message.
Definition: hello.c:1029
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:355
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
Definition: gnunet_mq_lib.h:52
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Call a callback once the envelope has been sent, that is, sending it can not be canceled anymore.
Definition: mq.c:787
void GNUNET_NSE_disconnect(struct GNUNET_NSE_Handle *h)
Disconnect from network size estimation service.
Definition: nse_api.c:193
struct GNUNET_NSE_Handle * GNUNET_NSE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_NSE_Callback func, void *func_cls)
Connect to the network size estimation service.
Definition: nse_api.c:165
struct GNUNET_PEERINFO_NotifyContext * GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg, int include_friend_only, GNUNET_PEERINFO_Processor callback, void *callback_cls)
Call a method whenever our known information about peers changes.
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.
#define GNUNET_MESSAGE_TYPE_DHT_CORE
DHT wants to use CORE to transmit data.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
void GNUNET_TRANSPORT_offer_hello_cancel(struct GNUNET_TRANSPORT_OfferHelloHandle *ohh)
Cancel the request to transport to offer the HELLO message.
struct GNUNET_TRANSPORT_OfferHelloHandle * GNUNET_TRANSPORT_offer_hello(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_MessageHeader *hello, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Offer the transport service the HELLO of another peer.
static ssize_t ip_sign(void *cls, const struct GNUNET_DHTU_PrivateKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, void **sig)
Use our private key to sign a message.
static void ip_send(void *cls, struct GNUNET_DHTU_Target *target, const void *msg, size_t msg_size, GNUNET_SCHEDULER_TaskCallback finished_cb, void *finished_cb_cls)
Send message to some other participant over the network.
static void handle_core_message(void *cls, const struct GNUNET_MessageHeader *msg)
Handle message from CORE for the DHT.
static void ip_try_connect(void *cls, const char *address)
Request creation of a session with a peer at the given address.
void * libgnunet_plugin_dhtu_gnunet_done(void *cls)
Exit point from the plugin.
static int check_core_message(void *cls, const struct GNUNET_MessageHeader *msg)
Anything goes, always return GNUNET_OK.
static void * core_connect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Method called whenever a given peer connects.
static enum GNUNET_GenericReturnValue ip_verify(void *cls, const struct GNUNET_DHTU_PublicKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, const void *sig, size_t sig_size)
Verify signature in sig over purpose.
static void peerinfo_cb(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Message *hello, const char *err_msg)
Find the hello for our identity and then pass it to the DHT as a URL.
static void core_disconnect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, void *peer_cls)
Method called whenever a peer disconnects.
void * libgnunet_plugin_dhtu_ip_init(void *cls)
Entry point for the plugin.
static void hello_offered_cb(void *cls)
Function called once a hello offer is completed.
static void ip_drop(struct GNUNET_DHTU_PreferenceHandle *ph)
Do no long request underlay to keep the connection alive.
static struct GNUNET_DHTU_PreferenceHandle * ip_hold(void *cls, struct GNUNET_DHTU_Target *target)
Request underlay to keep the connection to target alive if possible.
static void nse_cb(void *cls, struct GNUNET_TIME_Absolute timestamp, double logestimate, double std_dev)
Callback to call when network size estimate is updated.
static void core_init_cb(void *cls, const struct GNUNET_PeerIdentity *my_identity)
Function called after GNUNET_CORE_connect has succeeded (or failed for good).
Handle to the ATS subsystem for connectivity management.
Handle for ATS address suggestion requests.
void * cls
Closure for all of the callbacks.
Context for the core service connection.
Definition: core_api.c:78
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
Private ECC key encoded for transmission.
Public ECC key (always for curve Ed25519) encoded in a format suitable for network transmission and E...
an ECC signature using EdDSA.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
void * cls
Closure to use for callbacks.
Hash used by the DHT for keys and peers.
struct GNUNET_HashCode hc
For now, use a 512 bit hash.
The datastore service will pass a pointer to a struct of this type as the first and only argument to ...
void * cls
Closure to use for callbacks.
struct returned by the initialization function of the plugin
void(* try_connect)(void *cls, const char *address)
Request creation of a session with a peer at the given address.
struct GNUNET_DHTU_PreferenceHandle *(* hold)(void *cls, struct GNUNET_DHTU_Target *target)
Request underlay to keep the connection to target alive if possible.
enum GNUNET_GenericReturnValue(* verify)(void *cls, const struct GNUNET_DHTU_PublicKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, const void *sig, size_t sig_size)
Verify signature in sig over purpose.
void * cls
Closure to pass to all plugin functions.
ssize_t(* sign)(void *cls, const struct GNUNET_DHTU_PrivateKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, void **sig)
Use our private key to sign a message.
void(* drop)(struct GNUNET_DHTU_PreferenceHandle *ph)
Do no long request underlay to keep the connection alive.
void(* send)(void *cls, struct GNUNET_DHTU_Target *target, const void *msg, size_t msg_size, GNUNET_SCHEDULER_TaskCallback finished_cb, void *finished_cb_cls)
Send message to some other participant over the network.
Opaque handle expressing a preference of the DHT to keep a particular target connected.
struct GNUNET_DHTU_PreferenceHandle * prev
Kept in a DLL.
struct GNUNET_DHTU_Target * target
Target a preference was expressed for.
struct GNUNET_DHTU_PreferenceHandle * next
Kept in a DLL.
Handle for a private key used by this underlay.
struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv
GNUnet uses eddsa for peers.
Handle for a public key used by another peer.
uint16_t size
How long is the public key, in network byte order.
Opaque handle that the underlay offers for our address to be used when sending messages to another pe...
struct GNUNET_DHTU_PrivateKey pk
Private key of this peer.
void * app_ctx
Application context for this source.
struct GNUNET_DHTU_Hash my_id
Hash position of this peer in the DHT.
Opaque handle that the underlay offers for the target peer when sending messages to another peer.
struct GNUNET_ATS_ConnectivitySuggestHandle * csh
ATS preference handle for this peer, or NULL.
struct GNUNET_DHTU_PreferenceHandle * ph_head
Head of preferences expressed for this target.
unsigned int ph_count
Preference counter, length of the ph_head DLL.
struct Plugin * plugin
Our plugin with its environment.
struct GNUNET_MQ_Handle * mq
CORE MQ to send messages to this peer.
void * app_ctx
Application context for this target.
struct GNUNET_DHTU_PreferenceHandle * ph_tail
Tail of preferences expressed for this target.
struct GNUNET_DHTU_Hash peer_id
Hash of the pk to identify position of the peer in the DHT.
struct PublicKey pk
Public key of the peer.
A HELLO message is used to exchange information about transports with other peers.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_HELLO.
Handle to a message queue.
Definition: mq.c:86
Message handler for a specific message type.
Header for all communications.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
Handle for talking with the NSE service.
Definition: nse_api.c:41
Context for the info handler.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Entry in linked list for all offer-HELLO requests.
Handle for a HELLO we're offering the transport.
struct HelloHandle * next
Kept in a DLL.
struct Plugin * plugin
Our plugin.
struct GNUNET_TRANSPORT_OfferHelloHandle * ohh
Offer handle.
struct HelloHandle * prev
Kept in a DLL.
Handle for a plugin.
Definition: block.c:38
struct GNUNET_DHTU_PluginEnvironment * env
Callbacks into the DHT.
struct GNUNET_BLOCK_PluginFunctions * api
Plugin API.
Definition: block.c:47
struct HelloHandle * hh_tail
Hellos we are offering to transport.
struct GNUNET_DHTU_Source src
Our "source" address.
struct GNUNET_PeerIdentity my_identity
My identity.
struct GNUNET_PEERINFO_NotifyContext * nc
Watching for our address to change.
struct HelloHandle * hh_head
Hellos we are offering to transport.
struct GNUNET_DATACACHE_PluginEnvironment * env
Our execution environment.
struct GNUNET_NSE_Handle * nse
Handle to the NSE service.
struct GNUNET_ATS_ConnectivityHandle * ats
Handle to ATS service.
struct GNUNET_CORE_Handle * core
Handle to the CORE service.
Handle for a public key used by this underlay.
struct GNUNET_DHTU_PublicKey header
Header.
struct GNUNET_PeerIdentity peer_pub
GNUnet uses eddsa for peers.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.