GNUnet  0.20.0
testing_dhtu_cmd_send.c File Reference
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 51 of file testing_dhtu_cmd_send.c.

52 {
53  struct SendState *ss = cls;
54 
55  GNUNET_free (ss);
56 }
#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 51 of file testing_dhtu_cmd_send.c.

74 {
75  return GNUNET_NO;
76 }
@ GNUNET_NO

◆ 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 86 of file testing_dhtu_cmd_send.c.

88 {
89  struct SendState *ss = cls;
90 
91 #if 0
92  other_cmd = GNUNET_TESTING_interpreter_lookup_command (ss->other_label);
93  GNUNET_TESTING_get_trait_XXX (other_cmd,
94  &data);
95 #endif
97 }
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 86 of file testing_dhtu_cmd_send.c.

102 {
103  struct SendState *ss;
104 
105  ss = GNUNET_new (struct SendState);
106 
107  {
108  struct GNUNET_TESTING_Command cmd = {
109  .cls = ss,
110  .run = &send_run,
111  .ac = &ss->ac,
112  .cleanup = &send_cleanup,
113  .traits = &send_traits
114  };
116 
117  return cmd;
118  }
119 }
#define GNUNET_TESTING_CMD_MAX_LABEL_LENGTH
API for writing an interpreter to test GNUnet components.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
A command to be run by the interpreter.
char label[127+1]
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.