164 return ((uint32_t)
id) ^ ((uint32_t) (
id >> 32));
225 pname = (
const char *) &tpmm[1];
233 (
'\0' != pname[pname_len - 1])))
263 pname = (
const char *) &tpmm[1];
266 paddr = &pname[pname_len];
301 info.address = &addr;
303 addr.
address = (0 == paddr_len) ? NULL : paddr;
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
static struct GNUNET_FS_SearchContext * sc
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
Helper library for handling HELLOs.
Constants for network protocols.
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_MultiHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_put(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
struct GNUNET_CONTAINER_MultiHashMap32 * GNUNET_CONTAINER_multihashmap32_create(unsigned int len)
Create a 32-bit key multi hash map.
void GNUNET_CONTAINER_multihashmap32_destroy(struct GNUNET_CONTAINER_MultiHashMap32 *map)
Destroy a 32-bit key hash map.
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_MultiHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_HELLO_ADDRESS_INFO_NONE
No additional information.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT
Monitoring event about the connection state of plugins, generated in response to a subscription initi...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_START
Request to start monitoring the connection state of plugins.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC
Monitoring event notifying client that the initial iteration is now completed and we are in sync with...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
void GNUNET_TRANSPORT_monitor_plugins_cancel(struct GNUNET_TRANSPORT_PluginMonitor *pm)
Cancel monitoring the plugin session state.
GNUNET_TRANSPORT_SessionState
Possible states of a session in a plugin.
void(* GNUNET_TRANSPORT_SessionMonitorCallback)(void *cls, struct GNUNET_TRANSPORT_PluginSession *session, void **session_ctx, const struct GNUNET_TRANSPORT_SessionInfo *info)
Function called by the plugin with information about the current sessions managed by the plugin (for ...
struct GNUNET_TRANSPORT_PluginMonitor * GNUNET_TRANSPORT_monitor_plugins(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_TRANSPORT_SessionMonitorCallback cb, void *cb_cls)
Install a plugin session state monitor callback.
@ GNUNET_TRANSPORT_SS_INIT
The session was created (first call for each session object).
@ GNUNET_TRANSPORT_SS_DONE
Session is being torn down and about to disappear.
Internal representation of the hash map.
An address for communicating with a peer.
const char * transport_name
Name of the transport plugin enabling the communication using this address.
size_t address_length
Number of bytes in address.
struct GNUNET_PeerIdentity peer
For which peer is this an address?
enum GNUNET_HELLO_AddressInfo local_info
Extended information about address.
const void * address
Binary representation of the address (plugin-specific).
Handle to a message queue.
Message handler for a specific message type.
Entry in list of pending tasks.
Time for relative time used by GNUnet, in microseconds.
Handle for a plugin session state monitor.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task ID for reconnect.
struct GNUNET_CONTAINER_MultiHashMap32 * sessions
Map of session_ids (reduced to 32-bits) to struct GNUNET_TRANSPORT_PluginSession objects.
void * cb_cls
Closure for cb.
GNUNET_TRANSPORT_SessionMonitorCallback cb
Callback to call.
struct GNUNET_TIME_Relative backoff
Backoff for reconnect.
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct GNUNET_MQ_Handle * mq
Connection to the service.
Abstract representation of a plugin's session.
uint64_t session_id
Unique session identifier.
void * client_ctx
Location for the client to store "data".
Information about a plugin's session.
Context information to be used while searching for operation contexts.
uint64_t session_id
ID to locate.
struct GNUNET_TRANSPORT_PluginSession * ps
Result.
Transport-level connection status update.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT.
struct GNUNET_TIME_AbsoluteNBO timeout
When will this transport plugin session time out?
uint16_t plugin_address_len
Length of the plugin address in bytes.
uint16_t plugin_name_len
Length of the plugin name in bytes, including 0-termination.
uint16_t session_state
An enum GNUNET_TRANSPORT_SessionState in NBO.
struct GNUNET_TIME_AbsoluteNBO delay
Until how long is this plugin currently blocked from reading?
uint32_t bytes_pending
Number of bytes waiting for transmission.
uint32_t msgs_pending
Number of messages waiting transmission.
uint64_t session_id
Unique identifier for the session.
struct GNUNET_PeerIdentity peer
Which peer is this connection for?
int16_t is_inbound
GNUNET_YES if this is an inbound connection, GNUNET_NO if this is an outbound connection,...
common internal definitions for transport service
static void reconnect_plugin_ctx(struct GNUNET_TRANSPORT_PluginMonitor *pm)
Cut the existing connection and reconnect.
static void handle_event(void *cls, const struct TransportPluginMonitorMessage *tpmm)
Function called with responses from the service.
static void mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static void do_plugin_connect(void *cls)
Task run to re-establish the connection.
static void handle_sync(void *cls, const struct GNUNET_MessageHeader *msg)
Function called with sync responses from the service.
static int locate_by_id(void *cls, uint32_t key, void *value)
Locate a session entry.
static int check_event(void *cls, const struct TransportPluginMonitorMessage *tpmm)
Function called with responses from the service.
static uint32_t wrap_id(uint64_t id)
Convert 64-bit session ID to 32-bit index for hash map.
static int free_entry(void *cls, uint32_t key, void *value)
Free the session entry and notify the callback about its demise.