GNUnet  0.11.x
Data Structures | Functions
testing_dhtu_cmd_send.c File Reference
#include "platform.h"
#include "gnunet_testing_ng_lib.h"
Include dependency graph for testing_dhtu_cmd_send.c:

Go to the source code of this file.

Data Structures

struct  SendState
 State for the 'send' command. More...
 

Functions

static void send_cleanup (void *cls)
 
static enum GNUNET_GenericReturnValue send_traits (void *cls, const void **ret, const char *trait, unsigned int index)
 Return trains of the send command. More...
 
static void send_run (void *cls, struct GNUNET_TESTING_Interpreter *is)
 Run the 'send' command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_DHTU_cmd_send (const char *label)
 

Function Documentation

◆ send_cleanup()

static void send_cleanup ( void *  cls)
static
Parameters
clsa struct SendState

Definition at line 50 of file testing_dhtu_cmd_send.c.

51 {
52  struct SendState *ss = cls;
53 
54  GNUNET_free (ss);
55 }
#define GNUNET_free(ptr)
Wrapper around free.
State for the 'send' command.

References GNUNET_free.

◆ send_traits()

static enum GNUNET_GenericReturnValue send_traits ( void *  cls,
const void **  ret,
const char *  trait,
unsigned int  index 
)
static

Return trains of the send command.

Parameters
clsclosure.
[out]retresult
traitname of the trait.
indexindex number of the object to offer.
Returns
GNUNET_OK on success. GNUNET_NO if no trait was found

Definition at line 50 of file testing_dhtu_cmd_send.c.

73 {
74  return GNUNET_NO;
75 }
@ GNUNET_NO
Definition: gnunet_common.h:94

◆ send_run()

static void send_run ( void *  cls,
struct GNUNET_TESTING_Interpreter is 
)
static

Run the 'send' command.

Parameters
clsclosure.
isinterpreter state.

Definition at line 85 of file testing_dhtu_cmd_send.c.

87 {
88  struct SendState *ss = cls;
89 
90 #if 0
91  other_cmd = GNUNET_TESTING_interpreter_lookup_command (ss->other_label);
92  GNUNET_TESTING_get_trait_XXX (other_cmd,
93  &data);
94 #endif
96 }
uint32_t data
The data value.
void GNUNET_TESTING_async_finish(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has finished.
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
struct GNUNET_TESTING_AsyncContext ac
Mandatory context for async commands.

◆ GNUNET_TESTING_DHTU_cmd_send()

struct GNUNET_TESTING_Command GNUNET_TESTING_DHTU_cmd_send ( const char *  label)

Definition at line 85 of file testing_dhtu_cmd_send.c.

101 {
102  struct SendState *ss;
103 
104  ss = GNUNET_new (struct SendState);
105 
106  {
107  struct GNUNET_TESTING_Command cmd = {
108  .cls = ss,
109  .label = label,
110  .run = &send_run,
111  .ac = &ss->ac,
112  .cleanup = &send_cleanup,
113  .traits = &send_traits
114  };
115 
116  return cmd;
117  }
118 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
A command to be run by the interpreter.
const char * label
Label for the command.
void * cls
Closure for all commands with command-specific context information.
static void send_cleanup(void *cls)
static void send_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
Run the 'send' command.
static enum GNUNET_GenericReturnValue send_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Return trains of the send command.