]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_httpd_stats.cpp
Foulups
[user/henk/code/inspircd.git] / src / modules / m_httpd_stats.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                     E-mail:
7  *              <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *     
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *          the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 using namespace std;
18
19 #include <stdio.h>
20 #include "users.h"
21 #include "channels.h"
22 #include "modules.h"
23 #include "inspsocket.h"
24 #include "helperfuncs.h"
25 #include "httpd.h"
26
27 /* $ModDesc: Provides statistics over HTTP via m_httpd.so */
28
29 class ModuleHttpStats : public Module
30 {
31         Server* Srv;
32  public:
33
34         void ReadConfig()
35         {
36         }
37
38         ModuleHttpStats(Server* Me) : Module::Module(Me)
39         {
40                 Srv = Me;
41                 ReadConfig();
42         }
43
44         void OnEvent(Event* event)
45         {
46                 if (event->GetEventID() == "httpd_url")
47                 {
48                         log(DEBUG,"HTTP URL!");
49                 }
50         }
51
52         char* OnRequest(Request* request)
53         {
54                 return NULL;
55         }
56
57         void Implements(char* List)
58         {
59                 List[I_OnEvent] = List[I_OnRequest] = 1;
60         }
61
62         virtual ~ModuleHttpStats()
63         {
64         }
65
66         virtual Version GetVersion()
67         {
68                 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
69         }
70 };
71
72
73 class ModuleHttpStatsFactory : public ModuleFactory
74 {
75  public:
76         ModuleHttpStatsFactory()
77         {
78         }
79         
80         ~ModuleHttpStatsFactory()
81         {
82         }
83         
84         virtual Module * CreateModule(Server* Me)
85         {
86                 return new ModuleHttpStats(Me);
87         }
88 };
89
90
91 extern "C" void * init_module( void )
92 {
93         return new ModuleHttpStatsFactory;
94 }