aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-15 16:54:10 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-15 16:54:10 +0000
commit4fcf3ed7d39b7f7b66bb762c87afeed31b30f698 (patch)
treebd17b142ba740c32a1335ad7f2184e0770a45d2f /src
parente1425e372bdcff85dd7d164c99a6cd9341b2abd5 (diff)
downloadgnunet-4fcf3ed7d39b7f7b66bb762c87afeed31b30f698.tar.gz
gnunet-4fcf3ed7d39b7f7b66bb762c87afeed31b30f698.zip
-adding statistics to EXIT
Diffstat (limited to 'src')
-rw-r--r--src/exit/gnunet-daemon-exit.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index bfa600e48..7d9799d10 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -521,6 +521,9 @@ send_to_peer_notify_callback (void *cls, size_t size, void *buf)
521 tnq->len, 521 tnq->len,
522 &send_to_peer_notify_callback, 522 &send_to_peer_notify_callback,
523 s); 523 s);
524 GNUNET_STATISTICS_update (stats,
525 gettext_noop ("# Bytes transmitted via mesh tunnels"),
526 size, GNUNET_NO);
524 return size; 527 return size;
525} 528}
526 529
@@ -733,6 +736,9 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
733 const struct tun_header *pkt_tun; 736 const struct tun_header *pkt_tun;
734 size_t size; 737 size_t size;
735 738
739 GNUNET_STATISTICS_update (stats,
740 gettext_noop ("# Packets received from TUN"),
741 1, GNUNET_NO);
736 if (ntohs (message->type) != GNUNET_MESSAGE_TYPE_VPN_HELPER) 742 if (ntohs (message->type) != GNUNET_MESSAGE_TYPE_VPN_HELPER)
737 { 743 {
738 GNUNET_break (0); 744 GNUNET_break (0);
@@ -1236,6 +1242,9 @@ send_tcp_packet_via_tun (const struct SocketAddress *destination_address,
1236{ 1242{
1237 size_t len; 1243 size_t len;
1238 1244
1245 GNUNET_STATISTICS_update (stats,
1246 gettext_noop ("# TCP packets sent via TUN"),
1247 1, GNUNET_NO);
1239 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1248 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1240 "Sending packet with %u bytes TCP payload via TUN\n", 1249 "Sending packet with %u bytes TCP payload via TUN\n",
1241 (unsigned int) payload_length); 1250 (unsigned int) payload_length);
@@ -1332,6 +1341,9 @@ receive_tcp_service (void *unused GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunn
1332 const struct GNUNET_EXIT_TcpServiceStartMessage *start; 1341 const struct GNUNET_EXIT_TcpServiceStartMessage *start;
1333 uint16_t pkt_len = ntohs (message->size); 1342 uint16_t pkt_len = ntohs (message->size);
1334 1343
1344 GNUNET_STATISTICS_update (stats,
1345 gettext_noop ("# TCP service creation requests received via mesh"),
1346 1, GNUNET_NO);
1335 /* check that we got at least a valid header */ 1347 /* check that we got at least a valid header */
1336 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpServiceStartMessage)) 1348 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpServiceStartMessage))
1337 { 1349 {
@@ -1400,6 +1412,9 @@ receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1400 const void *payload; 1412 const void *payload;
1401 int af; 1413 int af;
1402 1414
1415 GNUNET_STATISTICS_update (stats,
1416 gettext_noop ("# TCP IP-exit creation requests received via mesh"),
1417 1, GNUNET_NO);
1403 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpInternetStartMessage)) 1418 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpInternetStartMessage))
1404 { 1419 {
1405 GNUNET_break_op (0); 1420 GNUNET_break_op (0);
@@ -1490,6 +1505,9 @@ receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1490 const struct GNUNET_EXIT_TcpDataMessage *data; 1505 const struct GNUNET_EXIT_TcpDataMessage *data;
1491 uint16_t pkt_len = ntohs (message->size); 1506 uint16_t pkt_len = ntohs (message->size);
1492 1507
1508 GNUNET_STATISTICS_update (stats,
1509 gettext_noop ("# TCP data requests received via mesh"),
1510 1, GNUNET_NO);
1493 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpDataMessage)) 1511 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpDataMessage))
1494 { 1512 {
1495 GNUNET_break_op (0); 1513 GNUNET_break_op (0);
@@ -1540,6 +1558,9 @@ send_udp_packet_via_tun (const struct SocketAddress *destination_address,
1540{ 1558{
1541 size_t len; 1559 size_t len;
1542 1560
1561 GNUNET_STATISTICS_update (stats,
1562 gettext_noop ("# UDP packets sent via TUN"),
1563 1, GNUNET_NO);
1543 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1564 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1544 "Sending packet with %u bytes UDP payload via TUN\n", 1565 "Sending packet with %u bytes UDP payload via TUN\n",
1545 (unsigned int) payload_length); 1566 (unsigned int) payload_length);
@@ -1640,6 +1661,9 @@ receive_udp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1640 const void *payload; 1661 const void *payload;
1641 int af; 1662 int af;
1642 1663
1664 GNUNET_STATISTICS_update (stats,
1665 gettext_noop ("# UDP IP-exit requests received via mesh"),
1666 1, GNUNET_NO);
1643 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpInternetMessage)) 1667 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpInternetMessage))
1644 { 1668 {
1645 GNUNET_break_op (0); 1669 GNUNET_break_op (0);
@@ -1724,6 +1748,9 @@ receive_udp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1724 const struct GNUNET_EXIT_UdpServiceMessage *msg; 1748 const struct GNUNET_EXIT_UdpServiceMessage *msg;
1725 uint16_t pkt_len = ntohs (message->size); 1749 uint16_t pkt_len = ntohs (message->size);
1726 1750
1751 GNUNET_STATISTICS_update (stats,
1752 gettext_noop ("# UDP service requests received via mesh"),
1753 1, GNUNET_NO);
1727 /* check that we got at least a valid header */ 1754 /* check that we got at least a valid header */
1728 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpServiceMessage)) 1755 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpServiceMessage))
1729 { 1756 {
@@ -1773,6 +1800,9 @@ new_tunnel (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1773{ 1800{
1774 struct TunnelState *s = GNUNET_malloc (sizeof (struct TunnelState)); 1801 struct TunnelState *s = GNUNET_malloc (sizeof (struct TunnelState));
1775 1802
1803 GNUNET_STATISTICS_update (stats,
1804 gettext_noop ("# Inbound MESH tunnels created"),
1805 1, GNUNET_NO);
1776 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1806 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1777 "Received inbound tunnel from `%s'\n", 1807 "Received inbound tunnel from `%s'\n",
1778 GNUNET_i2s (initiator)); 1808 GNUNET_i2s (initiator));