1 #ifndef STATS_H_INCLUDED
2 #define STATS_H_INCLUDED
3 #define STATS_H_VERSION "$Id: stats.h,v 2.3 2002/12/30 19:56:16 david__schmidt Exp $"
4 /*********************************************************************
6 * File : $Source: /cvsroot/ijbswa/current/src/stats.h,v $
8 * Purpose : Functions and definitions for accumulating and
9 * sending statistics to an "external" stats console
11 * Copyright : Written by and Copyright (C) 2002, 2003 the SourceForge
12 * Privoxy team. http://www.privoxy.org/
14 * Based on the Internet Junkbuster originally written
15 * by and Copyright (C) 1997 Anonymous Coders and
16 * Junkbusters Corporation. http://www.junkbusters.com
18 * This program is free software; you can redistribute it
19 * and/or modify it under the terms of the GNU General
20 * Public License as published by the Free Software
21 * Foundation; either version 2 of the License, or (at
22 * your option) any later version.
24 * This program is distributed in the hope that it will
25 * be useful, but WITHOUT ANY WARRANTY; without even the
26 * implied warranty of MERCHANTABILITY or FITNESS FOR A
27 * PARTICULAR PURPOSE. See the GNU General Public
28 * License for more details.
30 * The GNU General Public License should be included with
31 * this file. If not, you can view it at
32 * http://www.gnu.org/copyleft/gpl.html
33 * or write to the Free Software Foundation, Inc., 59
34 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 * Revision 2.3 2002/12/30 19:56:16 david__schmidt
39 * End of initial drop of statistics console infrastructure. Data stream
40 * is transmitted on the stats port every interval, provided the data has
41 * changed since the last transmission. More work probably needs to be
42 * done with regard to multiplatform threading; I stole the thread spawning
43 * code from jcc.c, but haven't been able to test it everywhere.
45 * Revision 2.2 2002/12/28 04:17:58 david__schmidt
46 * Fix null_routine on unix
48 * Revision 2.1 2002/12/28 03:58:19 david__schmidt
49 * Initial drop of dashboard instrumentation - enabled with
50 * --enable-activity-console
53 *********************************************************************/
56 /* Revision control strings from this header and associated .c file */
57 extern const char stats_rcs[];
58 extern const char stats_h_rcs[];
60 /* Global variables */
62 /* These are the different types of statistics we will be gathering. */
63 #define STATS_PRIVOXY_PORT 0
64 #define STATS_REQUEST 1
65 #define STATS_FILTER 2
66 #define STATS_IMAGE_BLOCK 3
67 #define STATS_GIF_DEANIMATE 4
68 #define STATS_COOKIE 5
69 #define STATS_REFERER 6
70 #define STATS_ACL_RESTRICT 7
71 #define STATS_CLIENT_UA 8
72 #define STATS_CLIENT_FROM 9
73 #define STATS_CLIENT_X_FORWARDED 10
74 /** Define the maximum number of 'keys' we'll be sending. Always keep this
75 * number one greater than the last actual key; it is used to define an
76 * array (i.e. int stats[STATS_MAX_KEYS]. */
77 #define STATS_MAX_KEYS 11
81 void init_stats_config(struct configuration_spec * config);
82 void update_stats_config(struct configuration_spec * config);
83 void accumulate_stats(int key, int value);
84 void *forward_stats();
85 void send_stats(int p_local_stats_array[]);
87 void null_routine(int sig);
95 int stats_array[STATS_MAX_KEYS];
96 struct configuration_spec *config;
99 #endif /* ndef STATS_H_INCLUDED */