functions related to testing-tng More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_constants.h"
#include "transport-testing-communicator.h"
#include "gnunet_signatures.h"
#include "transport.h"
#include "gnunet_hello_uri_lib.h"
#include <inttypes.h>
Go to the source code of this file.
Data Structures | |
struct | MyClient |
struct | GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue |
Queue of a communicator and some context. More... | |
struct | GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission |
Handle/Context to a single transmission. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "transport-testing2", __VA_ARGS__) |
Functions | |
static int | check_communicator_available (void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *msg) |
Check whether incoming msg indicating available communicator is correct. More... | |
static void | handle_communicator_available (void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *msg) |
Handle new communicator. More... | |
static int | check_communicator_backchannel (void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *msg) |
Incoming message. More... | |
static void | handle_communicator_backchannel (void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *bc_msg) |
Receive an incoming message. More... | |
static int | check_add_address (void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *msg) |
Address of our peer added. More... | |
static void | handle_add_address (void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *msg) |
The communicator informs about an address. More... | |
static int | check_incoming_msg (void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *msg) |
Incoming message. More... | |
static void | handle_incoming_msg (void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *inc_msg) |
Receive an incoming message. More... | |
static void | handle_queue_create_ok (void *cls, const struct GNUNET_TRANSPORT_CreateQueueResponse *msg) |
Communicator informs that it tries to establish requested queue. More... | |
static void | handle_queue_create_fail (void *cls, const struct GNUNET_TRANSPORT_CreateQueueResponse *msg) |
Communicator informs that it won't try establishing requested queue. More... | |
static int | check_add_queue_message (void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *aqm) |
New queue became available. More... | |
static void | handle_add_queue_message (void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *msg) |
Handle new queue. More... | |
static void | handle_update_queue_message (void *cls, const struct GNUNET_TRANSPORT_UpdateQueueMessage *msg) |
Handle new queue. More... | |
static void | shutdown_service (void *cls) |
Shut down the service. More... | |
static void * | connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq) |
Callback called when new Client (Communicator) connects. More... | |
static void | disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *internal_cls) |
Callback called when Client disconnects. More... | |
static void | handle_send_message_ack (void *cls, const struct GNUNET_TRANSPORT_SendMessageToAck *sma) |
Message was transmitted. More... | |
static void | transport_communicator_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) |
Start the communicator part of the transport service. More... | |
static void | shutdown_process (struct GNUNET_OS_Process *proc) |
Task run at shutdown to kill communicator and clean up. More... | |
static void | shutdown_statistics (void *cls) |
Task run at shutdown to kill the statistics process. More... | |
static void | shutdown_peerstore (void *cls) |
Task run at shutdown to kill the peerstore process. More... | |
static void | shutdown_communicator (void *cls) |
Task run at shutdown to kill a communicator process. More... | |
static void | communicator_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *binary_name) |
Start the communicator. More... | |
static void | shutdown_nat (void *cls) |
Task run at shutdown to kill communicator and clean up. More... | |
static void | shutdown_resolver (void *cls) |
Task run at shutdown to kill the resolver process. More... | |
static void | resolver_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) |
Start Resolver. More... | |
static void | statistics_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) |
Start Statistics. More... | |
static void | peerstore_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) |
Start Peerstore. More... | |
static void | nat_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) |
Start NAT. More... | |
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * | GNUNET_TRANSPORT_TESTING_transport_communicator_service_start (const char *service_name, const char *binary_name, const char *cfg_filename, const struct GNUNET_PeerIdentity *peer_id, GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb, GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb, GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb, GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb, GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_message_cb, GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb, void *cb_cls) |
Start communicator part of transport service and communicator. More... | |
void | GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) |
void | GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const struct GNUNET_PeerIdentity *peer_id, const char *address) |
Instruct communicator to open a queue. More... | |
void | GNUNET_TRANSPORT_TESTING_transport_communicator_send (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls, const void *payload, size_t payload_size) |
Instruct communicator to send data. More... | |
functions related to testing-tng
Definition in file transport-testing-communicator.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "transport-testing2", __VA_ARGS__) |
Definition at line 37 of file transport-testing-communicator.c.
|
static |
Check whether incoming msg indicating available communicator is correct.
cls | Closure |
msg | Message struct |
Definition at line 149 of file transport-testing-communicator.c.
References GNUNET_MQ_check_zero_termination, GNUNET_OK, msg, GNUNET_MessageHeader::size, and size.
|
static |
Handle new communicator.
Store characteristics of communicator, call respective client callback.
cls | Closure - communicator handle |
msg | Message struct |
Definition at line 172 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_addr_prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_characteristics, MyClient::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::communicator_available_cb, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_SERVICE_client_continue(), GNUNET_strdup, LOG, msg, GNUNET_MessageHeader::size, size, and MyClient::tc.
|
static |
Incoming message.
Test message is well-formed.
cls | the client |
msg | the send message that was sent |
Definition at line 213 of file transport-testing-communicator.c.
References GNUNET_OK.
|
static |
Receive an incoming message.
Pass the message to the client.
cls | Closure - communicator handle |
bc_msg | Message |
Definition at line 238 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_enabled, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, MyClient::client, env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL_INCOMING, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_YES, LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::peer_id, GNUNET_TRANSPORT_CommunicatorBackchannel::pid, GNUNET_TRANSPORT_CommunicatorBackchannelIncoming::pid, GNUNET_MessageHeader::size, MyClient::tc, and GNUNET_MessageHeader::type.
|
static |
Address of our peer added.
Test message is well-formed.
cls | the client |
msg | the send message that was sent |
Definition at line 293 of file transport-testing-communicator.c.
References GNUNET_MQ_check_zero_termination, GNUNET_OK, and msg.
|
static |
The communicator informs about an address.
Store address and call client callback.
cls | Closure - communicator handle |
msg | Message |
Definition at line 315 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_address_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_SERVICE_client_continue(), GNUNET_strdup, GNUNET_TIME_relative_ntoh(), LOG, msg, GNUNET_MessageHeader::size, size, and MyClient::tc.
|
static |
Incoming message.
Test message is well-formed.
cls | the client |
msg | the send message that was sent |
Definition at line 351 of file transport-testing-communicator.c.
References GNUNET_MQ_check_boxed_message, GNUNET_OK, and msg.
|
static |
Receive an incoming message.
Pass the message to the client.
cls | Closure - communicator handle |
inc_msg | Message |
Definition at line 375 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, env, GNUNET_TRANSPORT_IncomingMessage::fc_id, GNUNET_TRANSPORT_IncomingMessageAck::fc_id, GNUNET_TRANSPORT_IncomingMessage::fc_on, GNUNET_assert, GNUNET_ERROR_TYPE_WARNING, GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_YES, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::incoming_msg_cb, LOG, msg, GNUNET_TRANSPORT_IncomingMessageAck::reserved, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_TRANSPORT_IncomingMessageAck::sender, GNUNET_MessageHeader::size, and MyClient::tc.
|
static |
Communicator informs that it tries to establish requested queue.
cls | Closure - communicator handle |
msg | Message |
Definition at line 422 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_SERVICE_client_continue(), GNUNET_YES, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, and MyClient::tc.
|
static |
Communicator informs that it won't try establishing requested queue.
It will not do so probably because the address is bougus (see comment to GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL)
cls | Closure - communicator handle |
msg | Message |
Definition at line 447 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, and MyClient::tc.
|
static |
New queue became available.
Check message.
cls | the client |
aqm | the send message that was sent |
Definition at line 470 of file transport-testing-communicator.c.
References GNUNET_MQ_check_zero_termination, and GNUNET_OK.
|
static |
Handle new queue.
Store context and call client callback.
cls | Closure - communicator handle |
msg | Message struct |
Definition at line 487 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_queue_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::cs, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_memcmp, GNUNET_new, GNUNET_ntohll(), GNUNET_SERVICE_client_continue(), LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mtu, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::nt, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::priority, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::q_len, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_tail, MyClient::tc, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.
|
static |
Handle new queue.
Store context and call client callback.
cls | Closure - communicator handle |
msg | Message struct |
Definition at line 535 of file transport-testing-communicator.c.
References MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::cs, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_memcmp, GNUNET_ntohll(), GNUNET_SERVICE_client_continue(), LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mtu, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::nt, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::priority, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::q_len, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, MyClient::tc, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.
|
static |
Shut down the service.
cls | Closure - Handle to the service |
Definition at line 582 of file transport-testing-communicator.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_SERVICE_stop(), h, and LOG.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().
|
static |
Callback called when new Client (Communicator) connects.
cls | Closure - TransporCommmunicator Handle |
client | Client |
mq | Messagequeue |
Definition at line 603 of file transport-testing-communicator.c.
References MyClient::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_tail, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_send(), GNUNET_new, LOG, mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, and MyClient::tc.
Referenced by transport_communicator_start().
|
static |
Callback called when Client disconnects.
cls | Closure - TransportCommunicator Handle |
client | Client |
internal_cls | TransporCommmunicator Handle |
Definition at line 649 of file transport-testing-communicator.c.
References MyClient::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, LOG, and MyClient::next.
Referenced by transport_communicator_start().
|
static |
Message was transmitted.
Process the request.
cls | the client |
sma | the send message that was sent |
Definition at line 679 of file transport-testing-communicator.c.
References MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cont, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cont_cls, GNUNET_SERVICE_client_continue(), and MyClient::tc.
|
static |
Start the communicator part of the transport service.
communicator_available | Callback to be called when a new communicator becomes available |
cfg | Configuration |
Definition at line 699 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, connect_cb(), disconnect_cb(), GNUNET_assert, GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS, GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL, GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG, GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_UPDATE, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_OS_project_data_gnunet(), GNUNET_SERVICE_start(), mh, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::sh.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().
|
static |
Task run at shutdown to kill communicator and clean up.
cls | Closure - Process of communicator |
Definition at line 768 of file transport-testing-communicator.c.
References GNUNET_break, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_OK, GNUNET_OS_process_destroy(), GNUNET_OS_process_kill(), GNUNET_OS_process_wait(), and LOG.
Referenced by shutdown_communicator(), shutdown_nat(), shutdown_peerstore(), shutdown_resolver(), and shutdown_statistics().
|
static |
Task run at shutdown to kill the statistics process.
cls | Closure - Process of communicator |
Definition at line 791 of file transport-testing-communicator.c.
References shutdown_process().
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().
|
static |
Task run at shutdown to kill the peerstore process.
cls | Closure - Process of communicator |
Definition at line 804 of file transport-testing-communicator.c.
References shutdown_process().
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().
|
static |
Task run at shutdown to kill a communicator process.
cls | Closure - Process of communicator |
Definition at line 817 of file transport-testing-communicator.c.
References shutdown_process().
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().
|
static |
Start the communicator.
cfgname | Name of the communicator |
Definition at line 830 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process_s(), GNUNET_strdup, LOG, and section_name.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().
|
static |
Task run at shutdown to kill communicator and clean up.
cls | Closure - Process of communicator |
Definition at line 877 of file transport-testing-communicator.c.
References shutdown_process().
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().
|
static |
Task run at shutdown to kill the resolver process.
cls | Closure - Process of communicator |
Definition at line 890 of file transport-testing-communicator.c.
References shutdown_process().
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().
|
static |
Start Resolver.
Definition at line 902 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process(), GNUNET_OS_USE_PIPE_CONTROL, LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::resolver_proc.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().
|
static |
Start Statistics.
Definition at line 937 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process(), LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::stat_proc.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().
|
static |
Start Peerstore.
Definition at line 968 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process(), LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::ps_proc.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().
|
static |
Start NAT.
Definition at line 999 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process(), GNUNET_OS_USE_PIPE_CONTROL, LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::nat_proc.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * GNUNET_TRANSPORT_TESTING_transport_communicator_service_start | ( | const char * | service_name, |
const char * | binary_name, | ||
const char * | cfg_filename, | ||
const struct GNUNET_PeerIdentity * | peer_id, | ||
GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback | communicator_available_cb, | ||
GNUNET_TRANSPORT_TESTING_AddAddressCallback | add_address_cb, | ||
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback | queue_create_reply_cb, | ||
GNUNET_TRANSPORT_TESTING_AddQueueCallback | add_queue_cb, | ||
GNUNET_TRANSPORT_TESTING_IncomingMessageCallback | incoming_message_cb, | ||
GNUNET_TRANSPORT_TESTING_BackchannelCallback | bc_cb, | ||
void * | cb_cls | ||
) |
Start communicator part of transport service and communicator.
service_name | Name of the service |
cfg | Configuration handle |
communicator_available_cb | Callback that is called when a new |
add_address_cb | Callback that is called when a new communicator becomes available |
cb_cls | Closure to communicator_available_cb and |
Definition at line 1040 of file transport-testing-communicator.c.
References _, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_address_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_queue_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_enabled, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, cfg_filename, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::communicator_available_cb, communicator_start(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_CONFIGURATION_load(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_OS_project_data_gnunet(), GNUNET_strdup, GNUNET_SYSERR, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::incoming_msg_cb, LOG, nat_start(), peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::peer_id, peerstore_start(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, resolver_start(), statistics_start(), and transport_communicator_start().
void GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop | ( | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * | tc_h | ) |
Definition at line 1105 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_addr_prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_CONFIGURATION_destroy(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::nat_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::ps_proc, queue(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_tail, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::resolver_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::sh, shutdown_communicator(), shutdown_nat(), shutdown_peerstore(), shutdown_resolver(), shutdown_service(), shutdown_statistics(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::stat_proc, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.
void GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue | ( | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * | tc_h, |
const struct GNUNET_PeerIdentity * | peer_id, | ||
const char * | address | ||
) |
Instruct communicator to open a queue.
tc_h | Handle to communicator which shall open queue |
peer_id | Towards which peer |
address | For which address |
Definition at line 1136 of file transport-testing-communicator.c.
References address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, env, GNUNET_break, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_HELLO_address_to_prefix(), GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::open_queue_env, peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_tail, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.
void GNUNET_TRANSPORT_TESTING_transport_communicator_send | ( | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * | tc_h, |
GNUNET_SCHEDULER_TaskCallback | cont, | ||
void * | cont_cls, | ||
const void * | payload, | ||
size_t | payload_size | ||
) |
Instruct communicator to send data.
tc_queue | The queue to use for sending |
cont | function to call when done sending |
cont_cls | closure for cont |
payload | Data to send |
payload_size | Size of the payload |
Definition at line 1182 of file transport-testing-communicator.c.
References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, env, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_DUMMY, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, LOG, mh, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mid, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mtu, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, payload, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::priority, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::q_len, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.