GNUnet
0.19.4
transport-testing-loggers2.c
Go to the documentation of this file.
1
/*
2
This file is part of GNUnet.
3
Copyright (C) 2016 GNUnet e.V.
4
5
GNUnet is free software: you can redistribute it and/or modify it
6
under the terms of the GNU Affero General Public License as published
7
by the Free Software Foundation, either version 3 of the License,
8
or (at your option) any later version.
9
10
GNUnet is distributed in the hope that it will be useful, but
11
WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Affero General Public License for more details.
14
15
You should have received a copy of the GNU Affero General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18
SPDX-License-Identifier: AGPL3.0-or-later
19
*/
25
#include "
platform.h
"
26
#include "
transport-testing2.h
"
27
28
36
void
37
GNUNET_TRANSPORT_TESTING_log_connect
(
void
*cls,
38
struct
39
GNUNET_TRANSPORT_TESTING_PeerContext
*
me
,
40
const
struct
GNUNET_PeerIdentity
*other)
41
{
42
char
*ps;
43
44
ps =
GNUNET_strdup
(
GNUNET_i2s
(&
me
->id));
45
GNUNET_log
(
GNUNET_ERROR_TYPE_INFO
,
46
"Peer %s connected to %u (%s)!\n"
,
47
GNUNET_i2s
(other),
48
me
->no,
49
ps);
50
GNUNET_free
(ps);
51
}
52
53
61
void
62
GNUNET_TRANSPORT_TESTING_log_disconnect
(
void
*cls,
63
struct
64
GNUNET_TRANSPORT_TESTING_PeerContext
*
65
me
,
66
const
struct
67
GNUNET_PeerIdentity
*other)
68
{
69
char
*ps;
70
71
ps =
GNUNET_strdup
(
GNUNET_i2s
(&
me
->id));
72
GNUNET_log
(
GNUNET_ERROR_TYPE_INFO
,
73
"Peer `%s' disconnected from %u (%s)!\n"
,
74
GNUNET_i2s
(other),
75
me
->no,
76
ps);
77
GNUNET_free
(ps);
78
}
79
80
81
/* end of transport-testing-loggers.c */
me
static GNUNET_NETWORK_STRUCT_END struct GNUNET_PeerIdentity me
Our own peer identity.
Definition:
gnunet-daemon-hostlist.c:119
GNUNET_log
#define GNUNET_log(kind,...)
Definition:
gnunet_common.h:568
GNUNET_i2s
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
Definition:
common_logging.c:1275
GNUNET_ERROR_TYPE_INFO
@ GNUNET_ERROR_TYPE_INFO
Definition:
gnunet_common.h:443
GNUNET_strdup
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
Definition:
gnunet_common.h:1426
GNUNET_free
#define GNUNET_free(ptr)
Wrapper around free.
Definition:
gnunet_common.h:1412
platform.h
GNUNET_PeerIdentity
The identity of the host (wraps the signing key of the peer).
Definition:
gnunet_crypto_lib.h:229
GNUNET_TRANSPORT_TESTING_PeerContext
Context for a single peer.
Definition:
transport-testing.h:55
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.
Definition:
transport-testing-loggers2.c:62
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.
Definition:
transport-testing-loggers2.c:37
transport-testing2.h
src
transport
transport-testing-loggers2.c
Generated by
1.9.1