GNUnet  0.11.x
Functions
testbed_api_cmd_peer_store.c File Reference

Command to start the peer store service of a peer. More...

Go to the source code of this file.

Functions

static void service_run (void *cls, const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TESTING_Interpreter *is)
 
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_peer_store (const char *label, struct GNUNET_CONFIGURATION_Handle *cfg)
 

Detailed Description

Command to start the peer store service of a peer.

Author
t3sserakt

Definition in file testbed_api_cmd_peer_store.c.

Function Documentation

◆ service_run()

static void service_run ( void *  cls,
const struct GNUNET_TESTING_Command cmd,
struct GNUNET_TESTING_Interpreter is 
)
static

Definition at line 29 of file testbed_api_cmd_peer_store.c.

References GNUNET_PEERSTORE_connect().

32 {
33  struct PeerStoreState *pss = cls;
34 
35  pss->psh = GNUNET_PEERSTORE_connect (pss->cfg);
36  GNUNET_TESTING_interpreter_next (ps->is);
37 }
struct GNUNET_PEERSTORE_Handle * GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the PEERSTORE service.
Here is the call graph for this function:

◆ GNUNET_TESTBED_cmd_peer_store()

struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_peer_store ( const char *  label,
struct GNUNET_CONFIGURATION_Handle cfg 
)

Definition at line 41 of file testbed_api_cmd_peer_store.c.

References cfg, GNUNET_TESTING_Command::cls, GNUNET_new, and GNUNET_TESTING_Command::label.

43 {
44 
45  struct PeerStoreState *pss;
46 
47  pss = GNUNET_new (struct PeerStoreState);
48  pss->cfg = cfg;
49 
50  struct GNUNET_TESTING_Command cmd = {
51  .cls = pss,
52  .label = label,
53  .run = &peer_store_run,
54  .cleanup = &peer_store_cleanup,
55  .traits = &peer_store_traits
56  };
57 
58  return cmd;
59 
60 }
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
const char * label
Label for the command.
A command to be run by the interpreter.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void * cls
Closure for all commands with command-specific context information.