Implementation of the dummy core underlay that uses unix domain sockets. More...
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <inttypes.h>
#include "gnunet_core_underlay_dummy.h"
Go to the source code of this file.
Data Structures | |
struct | PeerConnectCls |
Closure used for the peer_connect_task. More... | |
struct | QueuedMessage |
struct | Connection |
Used to keep track of context of peer. More... | |
struct | GNUNET_CORE_UNDERLAY_DUMMY_Handle |
Opaque handle to the service. More... | |
Enumerations | |
enum | ConnectionStatus { CONNECTION_INITIALIZING , CONNECTION_INITIALIZING_SEND , CONNECTION_INITIALIZING_RECV , CONNECTION_LIVE , CONNECTION_DESTROY } |
Functions | |
static const char * | status2string (enum ConnectionStatus status) |
static void | do_read (void *cls) |
Callback scheduled to run when there is something to read from the socket. More... | |
static void | connection_destroy (struct Connection *connection) |
Destroy a connection. More... | |
static void | set_handlers_closure (struct GNUNET_MQ_MessageHandler *handlers, void *handlers_cls) |
Set the closures for mq handlers. More... | |
static void | do_handle_message (void *cls) |
static void | check_for_messages (struct Connection *connection) |
static void | do_notify_connect (void *cls) |
Notify the api caller about a new connection. More... | |
static void | try_notify_connect (struct Connection *connection) |
static void | cancle_initiating_connections (struct GNUNET_CORE_UNDERLAY_DUMMY_Handle *h, struct Connection *connection) |
static void | write_cb (void *cls) |
Callback scheduled to run once the socket is ready for writing. More... | |
static void | send_init (struct Connection *connection) |
static void | mq_send_impl (struct GNUNET_MQ_Handle *mq, const struct GNUNET_MessageHeader *msg, void *impl_state) |
Callback called from the MQ to send a message over a socket. More... | |
static void | mq_destroy_impl (struct GNUNET_MQ_Handle *mq, void *impl_state) |
Callback to destroy the message queue. More... | |
static void | mq_cancel_impl (struct GNUNET_MQ_Handle *mq, void *impl_state) |
Callback to cancel sending a message. More... | |
static void | mq_error_handler_impl (void *cls, enum GNUNET_MQ_Error error) |
Handle mq errors. More... | |
static void | do_accept (void *cls) |
Accept a connection on the dummy's socket. More... | |
static void | do_connect_to_peer (void *cls) |
Connect to another peer. More... | |
static void | do_notify_address_change (void *cls) |
Notify core about address change. More... | |
static void | try_connect (struct GNUNET_CORE_UNDERLAY_DUMMY_Handle *h, const char *address) |
static enum GNUNET_GenericReturnValue | discovered_socket_cb (void *cls, const char *filename) |
Handle the discovery of a certain socket. More... | |
static void | do_discover_peers (void *cls) |
Discover sockets of other peers. More... | |
static enum GNUNET_GenericReturnValue | try_open_listening_socket (struct GNUNET_CORE_UNDERLAY_DUMMY_Handle *h, char *sock_name) |
static void | do_open_listening_socket (void *cls, uint64_t sock_name_ctr_start) |
Opens UNIX domain socket. More... | |
static void | do_close_listening_socket (void *cls) |
static void | do_change_address (void *cls) |
struct GNUNET_CORE_UNDERLAY_DUMMY_Handle * | GNUNET_CORE_UNDERLAY_DUMMY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_MQ_MessageHandler *handlers, void *cls, GNUNET_CORE_UNDERLAY_DUMMY_NotifyConnect nc, GNUNET_CORE_UNDERLAY_DUMMY_NotifyDisconnect nd, GNUNET_CORE_UNDERLAY_DUMMY_NotifyAddressChange na) |
Connect to the core underlay dummy service. More... | |
void | GNUNET_CORE_UNDERLAY_DUMMY_disconnect (struct GNUNET_CORE_UNDERLAY_DUMMY_Handle *handle) |
Disconnect from the core underlay dummy service. More... | |
Implementation of the dummy core underlay that uses unix domain sockets.
Definition in file gnunet_core_underlay_dummy.c.