2 This file is part of GNUnet.
3 (C) 2001, 2002, 2003, 2004, 2009 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @author Christian Grothoff
23 * @file statistics/statistics.h
28 #include "gnunet_common.h"
31 GNUNET_NETWORK_STRUCT_BEGIN
34 * Statistics message. Contains how long the system is up
37 * The struct is be followed by the service name and
38 * name of the statistic, both 0-terminated.
40 struct GNUNET_STATISTICS_ReplyMessage
43 * Type: GNUNET_MESSAGE_TYPE_STATISTICS_VALUE
45 struct GNUNET_MessageHeader header;
48 * Unique numerical identifier for the value (will
49 * not change during the same client-session). Highest
50 * bit will be set for persistent values.
52 uint32_t uid GNUNET_PACKED;
57 uint64_t value GNUNET_PACKED;
61 #define GNUNET_STATISTICS_PERSIST_BIT (1<<31)
63 #define GNUNET_STATISTICS_SETFLAG_ABSOLUTE 0
65 #define GNUNET_STATISTICS_SETFLAG_RELATIVE 1
67 #define GNUNET_STATISTICS_SETFLAG_PERSISTENT 2
70 * Message to set a statistic. Followed
71 * by the subsystem name and the name of
72 * the statistic (each 0-terminated).
74 struct GNUNET_STATISTICS_SetMessage
77 * Type: GNUNET_MESSAGE_TYPE_STATISTICS_SET
79 struct GNUNET_MessageHeader header;
82 * 0 for absolute value, 1 for relative value; 2 to make persistent
83 * (see GNUNET_STATISTICS_SETFLAG_*).
85 uint32_t flags GNUNET_PACKED;
88 * Value. Note that if this is a relative value, it will
89 * be signed even though the type given here is unsigned.
91 uint64_t value GNUNET_PACKED;
97 * Message transmitted if a watched value changes.
99 struct GNUNET_STATISTICS_WatchValueMessage
102 * Type: GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE
104 struct GNUNET_MessageHeader header;
107 * 0 for absolute value, 1 for relative value; 2 to make persistent
108 * (see GNUNET_STATISTICS_SETFLAG_*).
110 uint32_t flags GNUNET_PACKED;
113 * Unique watch identification number (watch
114 * requests are enumerated in the order they
115 * are received, the first request having
118 uint32_t wid GNUNET_PACKED;
121 * Reserved (always 0).
123 uint32_t reserved GNUNET_PACKED;
126 * Value. Note that if this is a relative value, it will
127 * be signed even though the type given here is unsigned.
129 uint64_t value GNUNET_PACKED;
132 GNUNET_NETWORK_STRUCT_END