2 * @file module_sslid_hash.cpp
3 * @brief sslid hashmap container wrapper.
4 * @brief this module provide session persistence by SSL session ID.
6 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
7 * Copyright (C) 2008 NTT COMWARE Corporation.
8 * Copyright (C) 2009 Shinya TAKEBAYASHI
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.
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.
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
25 **********************************************************************/
29 #include <tr1/unordered_map>
30 #include "l7vs_dest.h"
31 #include "module_sslid_hash.h"
32 #include "module_sslid_hash_map.h"
34 static CSSLIDMap idmap;
36 void hash_setPointer(const void *keymap, const void *keylist, unsigned int size)
38 idmap.setPointer((IDLIST *)keymap, (IDLIST *)keylist, size);
42 void hash_add(const char *key, struct l7vs_dest data)
48 int hash_search(const char *key, struct l7vs_dest **data)
50 struct l7vs_dest *tmpdata;
54 retval_boolean = idmap.search(key, &tmpdata);
56 if (true == retval_boolean) {
69 void hash_allocate(unsigned int size)
75 void hash_destroy(void)
81 void *hash_getIDMAP(void)
83 return idmap.getIDMAP();
87 void *hash_getIDLIST(void)
89 return idmap.getIDLIST();
93 int hash_getLISTSIZE(void)
99 void hash_construct_sessionlist(struct l7vs_sslid_service* sslid_service)
101 idmap.construct_sessionlist(sslid_service);
105 void hash_rebuild_sessionlist(struct l7vs_sslid_service* sslid_service)
107 idmap.rebuild_sessionlist(sslid_service);