GNUnet  0.10.x
Data Structures | Functions
transport_api_monitor_plugins.c File Reference

montoring api for transport plugin session status More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_arm_service.h"
#include "gnunet_hello_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_transport_service.h"
#include "transport.h"
Include dependency graph for transport_api_monitor_plugins.c:

Go to the source code of this file.

Data Structures

struct  GNUNET_TRANSPORT_PluginMonitor
 Handle for a plugin session state monitor. More...
 
struct  GNUNET_TRANSPORT_PluginSession
 Abstract representation of a plugin's session. More...
 
struct  SearchContext
 Context information to be used while searching for operation contexts. More...
 

Functions

static void do_plugin_connect (void *cls)
 Task run to re-establish the connection. More...
 
static int free_entry (void *cls, uint32_t key, void *value)
 Free the session entry and notify the callback about its demise. More...
 
static void reconnect_plugin_ctx (struct GNUNET_TRANSPORT_PluginMonitor *pm)
 Cut the existing connection and reconnect. More...
 
static uint32_t wrap_id (uint64_t id)
 Convert 64-bit session ID to 32-bit index for hash map. More...
 
static int locate_by_id (void *cls, uint32_t key, void *value)
 Locate a session entry. More...
 
static int check_event (void *cls, const struct TransportPluginMonitorMessage *tpmm)
 Function called with responses from the service. More...
 
static void handle_event (void *cls, const struct TransportPluginMonitorMessage *tpmm)
 Function called with responses from the service. More...
 
static void handle_sync (void *cls, const struct GNUNET_MessageHeader *msg)
 Function called with sync responses from the service. More...
 
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 creation of the message queue. More...
 
struct GNUNET_TRANSPORT_PluginMonitorGNUNET_TRANSPORT_monitor_plugins (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_TRANSPORT_SessionMonitorCallback cb, void *cb_cls)
 Install a plugin session state monitor callback. More...
 
void GNUNET_TRANSPORT_monitor_plugins_cancel (struct GNUNET_TRANSPORT_PluginMonitor *pm)
 Cancel monitoring the plugin session state. More...
 

Detailed Description

montoring api for transport plugin session status

Author
Christian Grothoff

Definition in file transport_api_monitor_plugins.c.

Function Documentation

◆ do_plugin_connect()

static void do_plugin_connect ( void *  cls)
static

Task run to re-establish the connection.

Parameters
clsour struct GNUNET_TRANSPORT_PluginMonitor *

Definition at line 365 of file transport_api_monitor_plugins.c.

References GNUNET_TRANSPORT_PluginMonitor::cfg, env, GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT, GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_START, GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_TRANSPORT_PluginMonitor::mq, mq_error_handler(), msg, pm, and GNUNET_TRANSPORT_PluginMonitor::reconnect_task.

Referenced by GNUNET_TRANSPORT_monitor_plugins(), and reconnect_plugin_ctx().

366 {
367  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
369  GNUNET_MQ_hd_var_size(event,
372  pm),
375  struct GNUNET_MessageHeader,
376  pm),
378  };
379  struct GNUNET_MessageHeader *msg;
380  struct GNUNET_MQ_Envelope *env;
381 
382  pm->reconnect_task = NULL;
383  pm->mq = GNUNET_CLIENT_connect(pm->cfg,
384  "transport",
385  handlers,
387  pm);
388  if (NULL == pm->mq)
389  return;
390  env = GNUNET_MQ_msg(msg,
392  GNUNET_MQ_send(pm->mq,
393  env);
394 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT
Monitoring event about the connection state of plugins, generated in response to a subscription initi...
struct GNUNET_SCHEDULER_Task * reconnect_task
Task ID for reconnect.
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.
Definition: client.c:900
struct GNUNET_MQ_Handle * mq
Connection to the service.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
Handle for a plugin session state monitor.
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_START
Request to start monitoring the connection state of plugins.
Message handler for a specific message type.
#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...
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...
Transport-level connection status update.
Definition: transport.h:593
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Header for all communications.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:351
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_entry()

static int free_entry ( void *  cls,
uint32_t  key,
void *  value 
)
static

Free the session entry and notify the callback about its demise.

Parameters
clsour struct GNUNET_TRANSPORT_PluginMonitor
keykey of the session in the map
valuethe session to free
Returns
GNUNET_OK (continue to iterate)

Definition at line 113 of file transport_api_monitor_plugins.c.

References GNUNET_TRANSPORT_PluginMonitor::cb, GNUNET_TRANSPORT_PluginMonitor::cb_cls, GNUNET_TRANSPORT_PluginSession::client_ctx, GNUNET_break, GNUNET_CONTAINER_multihashmap32_remove(), GNUNET_free, GNUNET_OK, GNUNET_YES, pm, GNUNET_TRANSPORT_PluginMonitor::sessions, and value.

Referenced by GNUNET_TRANSPORT_monitor_plugins_cancel(), and reconnect_plugin_ctx().

116 {
117  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
119 
120  pm->cb(pm->cb_cls,
121  ps,
122  &ps->client_ctx,
123  NULL);
126  key,
127  ps));
128  GNUNET_break(NULL == ps->client_ctx);
129  GNUNET_free(ps);
130  return GNUNET_OK;
131 }
Abstract representation of a plugin's session.
Handle for a plugin session state monitor.
GNUNET_TRANSPORT_SessionMonitorCallback cb
Callback to call.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
int GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
static char * value
Value of the record to add/remove.
struct GNUNET_HashCode key
The key used in the DHT.
void * client_ctx
Location for the client to store "data".
#define GNUNET_YES
Definition: gnunet_common.h:77
#define GNUNET_free(ptr)
Wrapper around free.
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
struct GNUNET_CONTAINER_MultiHashMap32 * sessions
Map of session_ids (reduced to 32-bits) to struct GNUNET_TRANSPORT_PluginSession objects.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reconnect_plugin_ctx()

static void reconnect_plugin_ctx ( struct GNUNET_TRANSPORT_PluginMonitor pm)
static

Cut the existing connection and reconnect.

Parameters
pmour context

Definition at line 140 of file transport_api_monitor_plugins.c.

References GNUNET_TRANSPORT_PluginMonitor::backoff, do_plugin_connect(), free_entry(), GNUNET_CONTAINER_multihashmap32_iterate(), GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, GNUNET_TRANSPORT_PluginMonitor::mq, GNUNET_TRANSPORT_PluginMonitor::reconnect_task, and GNUNET_TRANSPORT_PluginMonitor::sessions.

Referenced by handle_event(), and mq_error_handler().

141 {
142  GNUNET_MQ_destroy(pm->mq);
143  pm->mq = NULL;
145  &free_entry,
146  pm);
150  pm);
151 }
static int free_entry(void *cls, uint32_t key, void *value)
Free the session entry and notify the callback about its demise.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task ID for reconnect.
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_MulitHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_MQ_Handle * mq
Connection to the service.
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.
Definition: scheduler.c:1237
struct GNUNET_TIME_Relative backoff
Backoff for reconnect.
#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_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:821
static void do_plugin_connect(void *cls)
Task run to re-establish the connection.
struct GNUNET_CONTAINER_MultiHashMap32 * sessions
Map of session_ids (reduced to 32-bits) to struct GNUNET_TRANSPORT_PluginSession objects.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wrap_id()

static uint32_t wrap_id ( uint64_t  id)
static

Convert 64-bit session ID to 32-bit index for hash map.

Parameters
id64-bit session ID
Returns
32-bit hash map index

Definition at line 161 of file transport_api_monitor_plugins.c.

Referenced by handle_event().

162 {
163  return ((uint32_t)id) ^ ((uint32_t)(id >> 32));
164 }
Here is the caller graph for this function:

◆ locate_by_id()

static int locate_by_id ( void *  cls,
uint32_t  key,
void *  value 
)
static

Locate a session entry.

Parameters
clsour struct SearchContext
keykey of the session in the map
valuea session
Returns
GNUNET_OK (continue to iterate), or GNUNET_SYSERR (match found)

Definition at line 192 of file transport_api_monitor_plugins.c.

References GNUNET_OK, GNUNET_SYSERR, SearchContext::ps, sc, GNUNET_TRANSPORT_PluginSession::session_id, SearchContext::session_id, and value.

Referenced by handle_event().

195 {
196  struct SearchContext *sc = cls;
198 
199  if (sc->session_id == ps->session_id)
200  {
201  sc->ps = ps;
202  return GNUNET_SYSERR;
203  }
204  return GNUNET_OK;
205 }
uint64_t session_id
Unique session identifier.
Abstract representation of a plugin's session.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
static char * value
Value of the record to add/remove.
struct GNUNET_TRANSPORT_PluginSession * ps
Result.
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
static struct GNUNET_FS_SearchContext * sc
Definition: gnunet-search.c:37
Context information to be used while searching for operation contexts.
Definition: testbed_api.c:220
uint64_t session_id
ID to locate.
Here is the caller graph for this function:

◆ check_event()

static int check_event ( void *  cls,
const struct TransportPluginMonitorMessage tpmm 
)
static

Function called with responses from the service.

Parameters
clsour struct GNUNET_TRANSPORT_PluginMonitor * tpmm message with event data
Returns
#GNUNET_Ok if message is well-formed

Definition at line 216 of file transport_api_monitor_plugins.c.

References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, TransportPluginMonitorMessage::header, TransportPluginMonitorMessage::plugin_address_len, TransportPluginMonitorMessage::plugin_name_len, and GNUNET_MessageHeader::size.

218 {
219  const char *pname;
220  size_t pname_len;
221  size_t paddr_len;
222 
223  pname = (const char *)&tpmm[1];
224  pname_len = ntohs(tpmm->plugin_name_len);
225  paddr_len = ntohs(tpmm->plugin_address_len);
226  if ((pname_len +
227  paddr_len +
228  sizeof(struct TransportPluginMonitorMessage) != ntohs(tpmm->header.size)) ||
229  ((0 != pname_len) &&
230  ('\0' != pname[pname_len - 1])))
231  {
232  GNUNET_break(0);
233  return GNUNET_SYSERR;
234  }
235  return GNUNET_OK;
236 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint16_t plugin_name_len
Length of the plugin name in bytes, including 0-termination.
Definition: transport.h:647
uint16_t plugin_address_len
Length of the plugin address in bytes.
Definition: transport.h:652
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
Transport-level connection status update.
Definition: transport.h:593
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT.
Definition: transport.h:597

◆ handle_event()

static void handle_event ( void *  cls,
const struct TransportPluginMonitorMessage tpmm 
)
static

Function called with responses from the service.

Parameters
clsour struct GNUNET_TRANSPORT_PluginMonitor * tpmm message with event data

Definition at line 246 of file transport_api_monitor_plugins.c.

References GNUNET_HELLO_Address::address, GNUNET_TRANSPORT_SessionInfo::address, GNUNET_HELLO_Address::address_length, TransportPluginMonitorMessage::bytes_pending, GNUNET_TRANSPORT_PluginMonitor::cb, GNUNET_TRANSPORT_PluginMonitor::cb_cls, GNUNET_TRANSPORT_PluginSession::client_ctx, TransportPluginMonitorMessage::delay, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_multihashmap32_get_multiple(), GNUNET_CONTAINER_multihashmap32_put(), GNUNET_CONTAINER_multihashmap32_remove(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_free, GNUNET_HELLO_ADDRESS_INFO_NONE, GNUNET_new, GNUNET_TIME_absolute_ntoh(), GNUNET_TRANSPORT_SS_DONE, GNUNET_TRANSPORT_SS_INIT, GNUNET_YES, GNUNET_TRANSPORT_SessionInfo::is_inbound, TransportPluginMonitorMessage::is_inbound, GNUNET_HELLO_Address::local_info, locate_by_id(), TransportPluginMonitorMessage::msgs_pending, GNUNET_TRANSPORT_SessionInfo::num_bytes_pending, GNUNET_TRANSPORT_SessionInfo::num_msg_pending, GNUNET_HELLO_Address::peer, TransportPluginMonitorMessage::peer, TransportPluginMonitorMessage::plugin_address_len, TransportPluginMonitorMessage::plugin_name_len, pm, SearchContext::ps, GNUNET_TRANSPORT_SessionInfo::receive_delay, reconnect_plugin_ctx(), GNUNET_TRANSPORT_PluginSession::session_id, SearchContext::session_id, TransportPluginMonitorMessage::session_id, TransportPluginMonitorMessage::session_state, GNUNET_TRANSPORT_SessionInfo::session_timeout, GNUNET_TRANSPORT_PluginMonitor::sessions, GNUNET_TRANSPORT_SessionInfo::state, TransportPluginMonitorMessage::timeout, GNUNET_HELLO_Address::transport_name, and wrap_id().

248 {
249  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
251  const char *pname;
252  const void *paddr;
254  size_t pname_len;
255  size_t paddr_len;
256  struct GNUNET_TRANSPORT_SessionInfo info;
257  struct GNUNET_HELLO_Address addr;
258  struct SearchContext rv;
259 
260  pname = (const char *)&tpmm[1];
261  pname_len = ntohs(tpmm->plugin_name_len);
262  paddr_len = ntohs(tpmm->plugin_address_len);
263  paddr = &pname[pname_len];
264  ps = NULL;
265  ss = (enum GNUNET_TRANSPORT_SessionState)ntohs(tpmm->session_state);
266  if (GNUNET_TRANSPORT_SS_INIT == ss)
267  {
269  ps->session_id = tpmm->session_id;
271  wrap_id(tpmm->session_id),
272  ps,
274  }
275  else
276  {
277  rv.session_id = tpmm->session_id;
278  rv.ps = NULL;
280  wrap_id(tpmm->session_id),
281  &locate_by_id,
282  &rv);
283  ps = rv.ps;
284  if (NULL == ps)
285  {
286  GNUNET_break(0);
288  return;
289  }
290  }
291  info.state = ss;
292  info.is_inbound = (int16_t)ntohs(tpmm->is_inbound);
293  info.num_msg_pending = ntohl(tpmm->msgs_pending);
294  info.num_bytes_pending = ntohl(tpmm->bytes_pending);
295  info.receive_delay = GNUNET_TIME_absolute_ntoh(tpmm->delay);
296  info.session_timeout = GNUNET_TIME_absolute_ntoh(tpmm->timeout);
297  info.address = &addr;
298  addr.peer = tpmm->peer;
299  addr.address = (0 == paddr_len) ? NULL : paddr;
300  addr.address_length = paddr_len;
301  addr.transport_name = (0 == pname_len) ? NULL : pname;
302  addr.local_info = GNUNET_HELLO_ADDRESS_INFO_NONE;
303  pm->cb(pm->cb_cls,
304  ps,
305  &ps->client_ctx,
306  &info);
307 
308  if (GNUNET_TRANSPORT_SS_DONE == ss)
309  {
310  GNUNET_break(NULL == ps->client_ctx);
313  wrap_id(tpmm->session_id),
314  ps));
315  GNUNET_free(ps);
316  }
317 }
uint64_t session_id
Unique session identifier.
Session is being torn down and about to disappear.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
Definition: time.c:671
int16_t is_inbound
GNUNET_YES if this is an inbound connection, GNUNET_NO if this is an outbound connection, GNUNET_SYSERR if connections of this plugin are so fundamentally bidirectional that they have no 'initiator' Value given in NBO.
Definition: transport.h:612
struct GNUNET_PeerIdentity peer
Which peer is this connection for?
Definition: transport.h:637
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
Abstract representation of a plugin's session.
Handle for a plugin session state monitor.
GNUNET_TRANSPORT_SessionMonitorCallback cb
Callback to call.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_MulitHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
int 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.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static int locate_by_id(void *cls, uint32_t key, void *value)
Locate a session entry.
Information about a plugin's session.
int GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
uint16_t plugin_name_len
Length of the plugin name in bytes, including 0-termination.
Definition: transport.h:647
uint16_t plugin_address_len
Length of the plugin address in bytes.
Definition: transport.h:652
struct GNUNET_TRANSPORT_PluginSession * ps
Result.
uint32_t msgs_pending
Number of messages waiting transmission.
Definition: transport.h:617
struct GNUNET_TIME_AbsoluteNBO timeout
When will this transport plugin session time out?
Definition: transport.h:627
static uint32_t wrap_id(uint64_t id)
Convert 64-bit session ID to 32-bit index for hash map.
uint32_t bytes_pending
Number of bytes waiting for transmission.
Definition: transport.h:622
Allow multiple values with the same key.
uint64_t session_id
Unique identifier for the session.
Definition: transport.h:642
No additional information.
Context information to be used while searching for operation contexts.
Definition: testbed_api.c:220
uint16_t session_state
An enum GNUNET_TRANSPORT_SessionState in NBO.
Definition: transport.h:602
struct GNUNET_TIME_AbsoluteNBO delay
Until how long is this plugin currently blocked from reading?
Definition: transport.h:632
void * client_ctx
Location for the client to store "data".
An address for communicating with a peer.
The session was created (first call for each session object).
#define GNUNET_YES
Definition: gnunet_common.h:77
GNUNET_TRANSPORT_SessionState
Possible states of a session in a plugin.
#define GNUNET_free(ptr)
Wrapper around free.
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
struct GNUNET_CONTAINER_MultiHashMap32 * sessions
Map of session_ids (reduced to 32-bits) to struct GNUNET_TRANSPORT_PluginSession objects.
static void reconnect_plugin_ctx(struct GNUNET_TRANSPORT_PluginMonitor *pm)
Cut the existing connection and reconnect.
Here is the call graph for this function:

◆ handle_sync()

static void handle_sync ( void *  cls,
const struct GNUNET_MessageHeader msg 
)
static

Function called with sync responses from the service.

Parameters
clsour struct GNUNET_TRANSPORT_PluginMonitor *
msgmessage from the service

Definition at line 327 of file transport_api_monitor_plugins.c.

References GNUNET_TRANSPORT_PluginMonitor::cb, GNUNET_TRANSPORT_PluginMonitor::cb_cls, and pm.

329 {
330  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
331 
332  /* we are in sync, notify callback */
333  pm->cb(pm->cb_cls,
334  NULL,
335  NULL,
336  NULL);
337 }
Handle for a plugin session state monitor.
GNUNET_TRANSPORT_SessionMonitorCallback cb
Callback to call.
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.

◆ mq_error_handler()

static void mq_error_handler ( void *  cls,
enum GNUNET_MQ_Error  error 
)
static

Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue.

Not every message queue implementation supports an error handler.

Parameters
clsclosure with the struct GNUNET_NSE_Handle *
errorerror code

Definition at line 350 of file transport_api_monitor_plugins.c.

References pm, and reconnect_plugin_ctx().

Referenced by do_plugin_connect().

352 {
353  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
354 
356 }
Handle for a plugin session state monitor.
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
static void reconnect_plugin_ctx(struct GNUNET_TRANSPORT_PluginMonitor *pm)
Cut the existing connection and reconnect.
Here is the call graph for this function:
Here is the caller graph for this function: