#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
#include "gnunet_testing_arm_lib.h"
#include "gnunet_testing_core_lib.h"
#include "gnunet_core_service.h"
Go to the source code of this file.
Macros | |
#define | MTYPE 12345 |
#define | LOG(kind, ...) GNUNET_log_from (kind, "testing-core-connect", __VA_ARGS__) |
Generic logging shortcut. More... | |
Functions | |
static void | handle_test (void *cls, const struct GNUNET_TESTING_CORE_Message *msg) |
static enum GNUNET_GenericReturnValue | connect_traits (void *cls, const void **ret, const char *trait, unsigned int index) |
This function prepares an array with traits. More... | |
static void | init_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity) |
static void * | connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer_id, struct GNUNET_MQ_Handle *mq, enum GNUNET_CORE_PeerClass class) |
static void | disconnect_cb (void *cls, const struct GNUNET_PeerIdentity *peer, void *peer_cls) |
static void | exec_connect_run (void *cls, struct GNUNET_TESTING_Interpreter *is) |
static void | exec_connect_cleanup (void *cls) |
const struct GNUNET_TESTING_Command | GNUNET_TESTING_CORE_cmd_connect (const char *label, const char *node_id, char *arm_service_label) |
#define MTYPE 12345 |
Definition at line 38 of file testing_core_cmd_connect.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "testing-core-connect", __VA_ARGS__) |
Generic logging shortcut.
Definition at line 43 of file testing_core_cmd_connect.c.
|
static |
Definition at line 48 of file testing_core_cmd_connect.c.
References GNUNET_TESTING_CORE_Channel::connect_state, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ntohll(), LOG, msg, GNUNET_TESTING_CORE_ConnectState::node_id, NODE_ID_LEN, GNUNET_TESTING_CORE_ConnectState::recv_handlers, GNUNET_TESTING_CORE_ConnectState::recv_handlers_cls, and GNUNET_TESTING_CORE_ConnectState::recv_handlers_len.
|
static |
This function prepares an array with traits.
Definition at line 83 of file testing_core_cmd_connect.c.
References GNUNET_CORE_TESTING_make_trait_connect(), GNUNET_TESTING_get_trait(), GNUNET_TESTING_trait_end(), GNUNET_TESTING_Trait::index, ret, and traits().
Referenced by GNUNET_TESTING_CORE_cmd_connect().
|
static |
Definition at line 102 of file testing_core_cmd_connect.c.
References GNUNET_TESTING_CORE_ConnectState::ac, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_memcpy, GNUNET_TESTING_async_finish(), LOG, my_identity, and GNUNET_TESTING_CORE_ConnectState::peer_id.
Referenced by exec_connect_run().
|
static |
Definition at line 117 of file testing_core_cmd_connect.c.
References GNUNET_TESTING_CORE_ConnectCb::callback, GNUNET_TESTING_CORE_ConnectState::channels_head, GNUNET_TESTING_CORE_ConnectState::channels_tail, GNUNET_TESTING_CORE_ConnectCb::cls, GNUNET_TESTING_CORE_ConnectState::connect_cbs, GNUNET_TESTING_CORE_ConnectState::connect_cbs_len, GNUNET_TESTING_CORE_Channel::connect_state, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_memcmp, GNUNET_memcpy, GNUNET_new, LOG, mq, GNUNET_TESTING_CORE_Channel::mq, peer_id, GNUNET_TESTING_CORE_Channel::peer_id, and GNUNET_TESTING_CORE_ConnectState::peer_id.
Referenced by exec_connect_run(), GNUNET_SERVICE_register_(), GNUNET_SERVICE_run_(), and GNUNET_SERVICE_start().
|
static |
Remove the closed channel:
Definition at line 203 of file testing_core_cmd_connect.c.
References GNUNET_TESTING_CORE_ConnectState::channels_head, GNUNET_TESTING_CORE_ConnectState::channels_tail, GNUNET_TESTING_CORE_Channel::connect_state, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_memcmp, LOG, GNUNET_TESTING_CORE_Channel::peer_id, and GNUNET_TESTING_CORE_ConnectState::peer_id.
Referenced by exec_connect_run(), GNUNET_SERVICE_register_(), GNUNET_SERVICE_run_(), and GNUNET_SERVICE_start().
|
static |
Definition at line 240 of file testing_core_cmd_connect.c.
References GNUNET_TESTING_CORE_ConnectState::arm_service_label, GNUNET_TESTING_CORE_ConnectState::cfg, connect_cb(), disconnect_cb(), GNUNET_CORE_connect(), GNUNET_CORE_SERVICE_TEST, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_OK, GNUNET_TESTING_FAIL, GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TESTING_CORE_ConnectState::h, handlers, init_cb(), is, LOG, MTYPE, GNUNET_TESTING_CORE_ConnectState::node_id, and GNUNET_CORE_ServiceInfo::service.
Referenced by GNUNET_TESTING_CORE_cmd_connect().
|
static |
Definition at line 285 of file testing_core_cmd_connect.c.
References GNUNET_assert, GNUNET_CORE_disconnect(), and GNUNET_TESTING_CORE_ConnectState::h.
Referenced by GNUNET_TESTING_CORE_cmd_connect().
const struct GNUNET_TESTING_Command GNUNET_TESTING_CORE_cmd_connect | ( | const char * | label, |
const char * | node_id, | ||
char * | arm_service_label | ||
) |
Definition at line 297 of file testing_core_cmd_connect.c.
References GNUNET_TESTING_CORE_ConnectState::ac, GNUNET_TESTING_CORE_ConnectState::arm_service_label, GNUNET_TESTING_CORE_ConnectState::connect_cbs, GNUNET_TESTING_CORE_ConnectState::connect_cbs_len, connect_traits(), exec_connect_cleanup(), exec_connect_run(), GNUNET_TESTING_CORE_ConnectState::finished, GNUNET_ERROR_TYPE_DEBUG, GNUNET_new, GNUNET_new_array, GNUNET_NO, GNUNET_strdup, GNUNET_TESTING_command_new_ac(), LOG, GNUNET_TESTING_CORE_ConnectState::node_id, GNUNET_TESTING_CORE_ConnectState::recv_handlers, and GNUNET_TESTING_CORE_ConnectState::recv_handlers_len.