Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / stats.h
index b3613f4..a781eb7 100644 (file)
 #include <freeradius-devel/ident.h>
 RCSIDH(stats_h, "$Id$")
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef WITH_STATS_64BIT
 typedef uint64_t fr_uint_t;
 #else
@@ -48,12 +52,26 @@ typedef struct fr_stats_t {
        fr_uint_t               total_unknown_types;
 } fr_stats_t;
 
+typedef struct fr_stats_ema_t {
+       int             window;
+
+       int             f1, f10;
+       int             ema1, ema10;
+
+} fr_stats_ema_t;
+
 extern fr_stats_t      radius_auth_stats;
 extern fr_stats_t      radius_acct_stats;
+#ifdef WITH_PROXY
+extern fr_stats_t      proxy_auth_stats;
+extern fr_stats_t      proxy_acct_stats;
+#endif
 
 void radius_stats_init(int flag);
 void request_stats_final(REQUEST *request);
 void request_stats_reply(REQUEST *request);
+void radius_stats_ema(fr_stats_ema_t *ema,
+                     struct timeval *start, struct timeval *end);
 
 #define RAD_STATS_INC(_x) _x++
 #ifdef WITH_ACCOUNTING
@@ -87,4 +105,8 @@ void request_stats_reply(REQUEST *request);
 
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* FR_STATS_H */