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 373 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().

374 {
375  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
377  GNUNET_MQ_hd_var_size (event,
380  pm),
383  struct GNUNET_MessageHeader,
384  pm),
386  };
387  struct GNUNET_MessageHeader *msg;
388  struct GNUNET_MQ_Envelope *env;
389 
390  pm->reconnect_task = NULL;
391  pm->mq = GNUNET_CLIENT_connect (pm->cfg,
392  "transport",
393  handlers,
395  pm);
396  if (NULL == pm->mq)
397  return;
398  env = GNUNET_MQ_msg (msg,
400  GNUNET_MQ_send (pm->mq,
401  env);
402 }
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:901
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:625
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:353
#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 117 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().

120 {
121  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
123 
124  pm->cb (pm->cb_cls,
125  ps,
126  &ps->client_ctx,
127  NULL);
130  key,
131  ps));
132  GNUNET_break (NULL == ps->client_ctx);
133  GNUNET_free (ps);
134  return GNUNET_OK;
135 }
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:78
#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:80
#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 144 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().

145 {
146  GNUNET_MQ_destroy (pm->mq);
147  pm->mq = NULL;
149  &free_entry,
150  pm);
154  pm);
155 }
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.
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:1246
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...
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_HashMapIterator32 it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:824
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 165 of file transport_api_monitor_plugins.c.

Referenced by handle_event().

166 {
167  return ((uint32_t) id) ^ ((uint32_t) (id >> 32));
168 }
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 199 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().

202 {
203  struct SearchContext *sc = cls;
205 
206  if (sc->session_id == ps->session_id)
207  {
208  sc->ps = ps;
209  return GNUNET_SYSERR;
210  }
211  return GNUNET_OK;
212 }
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:78
static char * value
Value of the record to add/remove.
struct GNUNET_TRANSPORT_PluginSession * ps
Result.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
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:233
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 223 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.

225 {
226  const char *pname;
227  size_t pname_len;
228  size_t paddr_len;
229 
230  pname = (const char *) &tpmm[1];
231  pname_len = ntohs (tpmm->plugin_name_len);
232  paddr_len = ntohs (tpmm->plugin_address_len);
233  if ( (pname_len +
234  paddr_len +
235  sizeof (struct TransportPluginMonitorMessage) != ntohs (tpmm->header.size)) ||
236  ( (0 != pname_len) &&
237  ('\0' != pname[pname_len - 1]) ) )
238  {
239  GNUNET_break (0);
240  return GNUNET_SYSERR;
241  }
242  return GNUNET_OK;
243 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
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:681
uint16_t plugin_address_len
Length of the plugin address in bytes.
Definition: transport.h:686
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
Transport-level connection status update.
Definition: transport.h:625
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT.
Definition: transport.h:631

◆ 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 253 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().

255 {
256  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
258  const char *pname;
259  const void *paddr;
261  size_t pname_len;
262  size_t paddr_len;
263  struct GNUNET_TRANSPORT_SessionInfo info;
264  struct GNUNET_HELLO_Address addr;
265  struct SearchContext rv;
266 
267  pname = (const char *) &tpmm[1];
268  pname_len = ntohs (tpmm->plugin_name_len);
269  paddr_len = ntohs (tpmm->plugin_address_len);
270  paddr = &pname[pname_len];
271  ps = NULL;
272  ss = (enum GNUNET_TRANSPORT_SessionState) ntohs (tpmm->session_state);
273  if (GNUNET_TRANSPORT_SS_INIT == ss)
274  {
276  ps->session_id = tpmm->session_id;
278  wrap_id (tpmm->session_id),
279  ps,
281 
282  }
283  else
284  {
285  rv.session_id = tpmm->session_id;
286  rv.ps = NULL;
288  wrap_id (tpmm->session_id),
289  &locate_by_id,
290  &rv);
291  ps = rv.ps;
292  if (NULL == ps)
293  {
294  GNUNET_break (0);
296  return;
297  }
298  }
299  info.state = ss;
300  info.is_inbound = (int16_t) ntohs (tpmm->is_inbound);
301  info.num_msg_pending = ntohl (tpmm->msgs_pending);
302  info.num_bytes_pending = ntohl (tpmm->bytes_pending);
303  info.receive_delay = GNUNET_TIME_absolute_ntoh (tpmm->delay);
304  info.session_timeout = GNUNET_TIME_absolute_ntoh (tpmm->timeout);
305  info.address = &addr;
306  addr.peer = tpmm->peer;
307  addr.address = (0 == paddr_len) ? NULL : paddr;
308  addr.address_length = paddr_len;
309  addr.transport_name = (0 == pname_len) ? NULL : pname;
310  addr.local_info = GNUNET_HELLO_ADDRESS_INFO_NONE;
311  pm->cb (pm->cb_cls,
312  ps,
313  &ps->client_ctx,
314  &info);
315 
316  if (GNUNET_TRANSPORT_SS_DONE == ss)
317  {
318  GNUNET_break (NULL == ps->client_ctx);
321  wrap_id (tpmm->session_id),
322  ps));
323  GNUNET_free (ps);
324  }
325 }
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:670
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:646
struct GNUNET_PeerIdentity peer
Which peer is this connection for?
Definition: transport.h:671
#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_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:681
uint16_t plugin_address_len
Length of the plugin address in bytes.
Definition: transport.h:686
struct GNUNET_TRANSPORT_PluginSession * ps
Result.
uint32_t msgs_pending
Number of messages waiting transmission.
Definition: transport.h:651
struct GNUNET_TIME_AbsoluteNBO timeout
When will this transport plugin session time out?
Definition: transport.h:661
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:656
Allow multiple values with the same key.
uint64_t session_id
Unique identifier for the session.
Definition: transport.h:676
No additional information.
Context information to be used while searching for operation contexts.
Definition: testbed_api.c:233
uint16_t session_state
An enum GNUNET_TRANSPORT_SessionState in NBO.
Definition: transport.h:636
struct GNUNET_TIME_AbsoluteNBO delay
Until how long is this plugin currently blocked from reading?
Definition: transport.h:666
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:80
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_HashMapIterator32 it, void *it_cls)
Iterate over all entries in the map that match a particular key.
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 335 of file transport_api_monitor_plugins.c.

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

337 {
338  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
339 
340  /* we are in sync, notify callback */
341  pm->cb (pm->cb_cls,
342  NULL,
343  NULL,
344  NULL);
345 }
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 358 of file transport_api_monitor_plugins.c.

References pm, and reconnect_plugin_ctx().

Referenced by do_plugin_connect().

360 {
361  struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
362 
364 }
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: