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