GNUnet 0.21.1
transport-testing-loggers2.c File Reference
#include "platform.h"
#include "transport-testing2.h"
Include dependency graph for transport-testing-loggers2.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...
 

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-loggers2.c.

41{
42 char *ps;
43
44 ps = GNUNET_strdup (GNUNET_i2s (&me->id));
46 "Peer %s connected to %u (%s)!\n",
47 GNUNET_i2s (other),
48 me->no,
49 ps);
51}
static GNUNET_NETWORK_STRUCT_END struct GNUNET_PeerIdentity me
Our own peer identity.
static struct GNUNET_PEERSTORE_Handle * ps
Handle to the PEERSTORE service.
#define GNUNET_log(kind,...)
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_INFO
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_free(ptr)
Wrapper around free.

References GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_strdup, me, and ps.

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-loggers2.c.

68{
69 char *ps;
70
71 ps = GNUNET_strdup (GNUNET_i2s (&me->id));
73 "Peer `%s' disconnected from %u (%s)!\n",
74 GNUNET_i2s (other),
75 me->no,
76 ps);
78}

References GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_strdup, me, and ps.

Here is the call graph for this function: