7efaf58a45a73cf3e0a89b83cefbb75a7e7a7c53
[yazproxy-moved-to-github.git] / include / yazproxy / limit-connect.h
1 /* $Id: limit-connect.h,v 1.2 2006-03-30 14:16:34 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 private:
36     struct Peer;
37
38     int m_period; 
39     Peer *m_peers;
40     Peer **lookup(const char *peername);
41 };
42
43 #endif
44
45 /*
46  * Local variables:
47  * c-basic-offset: 4
48  * indent-tabs-mode: nil
49  * End:
50  * vim: shiftwidth=4 tabstop=8 expandtab
51  */
52