GNUnet  0.10.x
Functions
transport-testing-loggers.c File Reference

convenience functions for logging common events in tests More...

#include "transport-testing.h"
Include dependency graph for transport-testing-loggers.c:

Go to the source code of this file.

Functions

void GNUNET_TRANSPORT_TESTING_log_connect (void *cls, struct GNUNET_TRANSPORT_TESTING_PeerContext *me, const struct GNUNET_PeerIdentity *other)
 Log a connect event. More...
 
void GNUNET_TRANSPORT_TESTING_log_disconnect (void *cls, struct GNUNET_TRANSPORT_TESTING_PeerContext *me, const struct GNUNET_PeerIdentity *other)
 Log a disconnect event. More...
 

Detailed Description

convenience functions for logging common events in tests

Author
Christian Grothoff

Definition in file transport-testing-loggers.c.

Function Documentation

◆ GNUNET_TRANSPORT_TESTING_log_connect()

void GNUNET_TRANSPORT_TESTING_log_connect ( void *  cls,
struct GNUNET_TRANSPORT_TESTING_PeerContext me,
const struct GNUNET_PeerIdentity other 
)

Log a connect event.

Parameters
clsNULL
mepeer that had the event
otherpeer that connected.

Definition at line 37 of file transport-testing-loggers.c.

References GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_strdup, GNUNET_TRANSPORT_TESTING_PeerContext::id, and GNUNET_TRANSPORT_TESTING_PeerContext::no.

40 {
41  char *ps;
42 
43  ps = GNUNET_strdup (GNUNET_i2s (&me->id));
45  "Peer %s connected to %u (%s)!\n",
46  GNUNET_i2s (other),
47  me->no,
48  ps);
49  GNUNET_free (ps);
50 }
struct GNUNET_PeerIdentity id
Peer identity.
unsigned int no
An unique number to identify the peer.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_log(kind,...)
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:

◆ GNUNET_TRANSPORT_TESTING_log_disconnect()

void GNUNET_TRANSPORT_TESTING_log_disconnect ( void *  cls,
struct GNUNET_TRANSPORT_TESTING_PeerContext me,
const struct GNUNET_PeerIdentity other 
)

Log a disconnect event.

Parameters
clsNULL
mepeer that had the event
otherpeer that disconnected.

Definition at line 62 of file transport-testing-loggers.c.

References GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_strdup, GNUNET_TRANSPORT_TESTING_PeerContext::id, and GNUNET_TRANSPORT_TESTING_PeerContext::no.

65 {
66  char *ps;
67 
68  ps = GNUNET_strdup (GNUNET_i2s (&me->id));
70  "Peer `%s' disconnected from %u (%s)!\n",
71  GNUNET_i2s (other),
72  me->no,
73  ps);
74  GNUNET_free (ps);
75 }
struct GNUNET_PeerIdentity id
Peer identity.
unsigned int no
An unique number to identify the peer.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_log(kind,...)
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function: