OSDN Git Service

Port range check was implemented.
[ultramonkey-l7/ultramonkey-l7-v2.git] / module / protocol / module_sslid_hash_map.h
1 /*
2  * @file  module_sslid_hash_map.h
3  * @brief sslid hashmap container.
4  * @brief this module provide session persistence by SSL session ID.
5  *
6  * L7VSD: Linux Virtual Server for Layer7 Load Balancing
7  * Copyright (C) 2008  NTT COMWARE Corporation.
8  * Copyright (C) 2009  Shinya TAKEBAYASHI
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  *
25  **********************************************************************/
26
27 #ifndef __MODULE_SSLID_HASH_MAP_H_5D6935E5_0C3D_447D_8E13_BEFC7619F621__
28 #define __MODULE_SSLID_HASH_MAP_H_5D6935E5_0C3D_447D_8E13_BEFC7619F621__
29
30
31 typedef std::tr1::unordered_map<std::string, struct l7vs_dest> IDMAP;
32 typedef std::list<std::string> IDLIST;
33
34
35 class CSSLIDMap
36 {
37  public: 
38   CSSLIDMap();
39   ~CSSLIDMap();
40
41   void add(const std::string, struct l7vs_dest);
42   bool search(const std::string, struct l7vs_dest**);
43
44   void allocate(unsigned int);
45   void destroy(void);
46   
47   void *getIDMAP(void);
48   void *getIDLIST(void);
49   int getLISTSIZE(void);
50   void setPointer(const void *, const void *, unsigned int);
51   void construct_sessionlist(struct l7vs_sslid_service*);  
52   void rebuild_sessionlist(struct l7vs_sslid_service*);  
53
54  private:
55   IDMAP *m;
56   IDLIST *l;
57   unsigned int listsize;
58 };
59
60
61 #endif // __MODULE_SSLID_HASH_MAP_H_5D6935E5_0C3D_447D_8E13_BEFC7619F621__