928ab1ee9796b76e62270c7317c01c845b5cacad
[yazproxy-moved-to-github.git] / include / yazproxy / limit-connect.h
1 /* This file is part of YAZ proxy
2    Copyright (C) 1998-2008 Index Data
3
4 YAZ proxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19 #ifndef YAZPROXY_LIMIT_CONNECT_H
20 #define YAZPROXY_LIMIT_CONNECT_H
21
22 #include <yaz/yconfig.h>
23 #include <yazproxy/bw.h>
24
25 class YAZ_EXPORT LimitConnect {
26 public:
27     LimitConnect();
28     ~LimitConnect();
29     void add_connect(const char *peername);
30     int get_total(const char *peername);
31     void cleanup(bool all);
32     void set_period(int sec);
33 private:
34     struct Peer;
35
36     int m_period; 
37     Peer *m_peers;
38     Peer **lookup(const char *peername);
39 };
40
41 #endif
42
43 /*
44  * Local variables:
45  * c-basic-offset: 4
46  * indent-tabs-mode: nil
47  * End:
48  * vim: shiftwidth=4 tabstop=8 expandtab
49  */
50