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

Go to the source code of this file.

Data Structures

struct  LocalFinishedState
 

Macros

#define LOG(kind, ...)   GNUNET_log (kind, __VA_ARGS__)
 Generic logging shortcut. More...
 

Functions

static int local_test_finished_traits (void *cls, const void **ret, const char *trait, unsigned int index)
 
static void local_test_finished_cleanup (void *cls, const struct GNUNET_TESTING_Command *cmd)
 
static void local_test_finished_run (void *cls, const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TESTING_Interpreter *is)
 
static int local_test_finished_finish (void *cls, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_finished (const char *label, TESTBED_CMD_HELPER_write_cb write_message)
 Create command. More...
 

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log (kind, __VA_ARGS__)

Function Documentation

◆ local_test_finished_traits()

static int local_test_finished_traits ( void *  cls,
const void **  ret,
const char *  trait,
unsigned int  index 
)
static

Definition at line 45 of file testbed_api_cmd_local_test_finished.c.

References GNUNET_OK.

Referenced by GNUNET_TESTING_cmd_local_test_finished().

49 {
50  return GNUNET_OK;
51 }
Here is the caller graph for this function:

◆ local_test_finished_cleanup()

static void local_test_finished_cleanup ( void *  cls,
const struct GNUNET_TESTING_Command cmd 
)
static

Definition at line 55 of file testbed_api_cmd_local_test_finished.c.

References GNUNET_free, and LocalFinishedState::reply.

Referenced by GNUNET_TESTING_cmd_local_test_finished().

57 {
58  struct LocalFinishedState *lfs = cls;
59 
60  GNUNET_free (lfs->reply);
61  GNUNET_free (lfs);
62 }
struct GNUNET_CMDS_LOCAL_FINISHED * reply
#define GNUNET_free(ptr)
Wrapper around free.
Here is the caller graph for this function:

◆ local_test_finished_run()

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

Definition at line 66 of file testbed_api_cmd_local_test_finished.c.

References GNUNET_ERROR_TYPE_ERROR, GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED, GNUNET_new, GNUNET_CMDS_LOCAL_FINISHED::header, LOG, LocalFinishedState::reply, GNUNET_MessageHeader::size, GNUNET_MessageHeader::type, and LocalFinishedState::write_message.

Referenced by GNUNET_TESTING_cmd_local_test_finished().

69 {
70  struct LocalFinishedState *lfs = cls;
71 
72  struct GNUNET_CMDS_LOCAL_FINISHED *reply;
73  size_t msg_length;
74 
76  "We got here 12!\n");
77 
78  msg_length = sizeof(struct GNUNET_CMDS_LOCAL_FINISHED);
79  reply = GNUNET_new (struct GNUNET_CMDS_LOCAL_FINISHED);
81  reply->header.size = htons ((uint16_t) msg_length);
82  lfs->reply = reply;
83  lfs->write_message ((struct GNUNET_MessageHeader *) reply, msg_length);
84 
86  "We got here 13!\n");
87 }
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
TESTBED_CMD_HELPER_write_cb write_message
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define LOG(kind,...)
Generic logging shortcut.
struct GNUNET_CMDS_LOCAL_FINISHED * reply
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED.
Header for all communications.
Here is the caller graph for this function:

◆ local_test_finished_finish()

static int local_test_finished_finish ( void *  cls,
GNUNET_SCHEDULER_TaskCallback  cont,
void *  cont_cls 
)
static

Definition at line 91 of file testbed_api_cmd_local_test_finished.c.

References GNUNET_ERROR_TYPE_ERROR, GNUNET_YES, and LOG.

Referenced by GNUNET_TESTING_cmd_local_test_finished().

94 {
95  // This will stop the local loop without shutting down the scheduler, because we do not call the continuation, which is the interpreter_next method.
97  "Stopping local loop\n");
98  return GNUNET_YES;
99 }
#define LOG(kind,...)
Generic logging shortcut.
Here is the caller graph for this function: