aboutsummaryrefslogtreecommitdiffstats
path: root/modules/eng_aep/aep_conn.h
blob: 9b1d97e5861ad61b0ddb2a86ac20f1d43896c027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*************************************************
* AEP Connection Management Header File          *
* (C) 1999-2006 The Botan Project                *
*************************************************/

#ifndef BOTAN_EXT_AEP_CONNECTION_H__
#define BOTAN_EXT_AEP_CONNECTION_H__

#include <botan/eng_aep.h>
#include <botan/mutex.h>

namespace Botan {

/*************************************************
* AEP Connection                                 *
*************************************************/
class AEP_Connection
   {
   public:
      operator u32bit () { return this_connection; }

      static void close_all_connections();

      AEP_Connection();
      ~AEP_Connection();
   private:
      struct Connection_Info { u32bit id; bool in_use; };

      static const u32bit MAX_CACHED_CONNECTIONS = 8;
      static std::vector<Connection_Info> pool;

      u32bit this_connection;
   };

}

#endif