|
1 /* |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : ctlscache.h |
|
16 * Part of : SIPSec TLS Plugin |
|
17 * Interface : |
|
18 * Version : %version: 2.1.1 % |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 /** |
|
26 @internalComponent |
|
27 */ |
|
28 |
|
29 #ifndef C_TLSCACHE_H |
|
30 #define C_TLSCACHE_H |
|
31 |
|
32 // INCLUDES |
|
33 #include <e32base.h> |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class TInetAddr; |
|
37 class MSIPSecUser; |
|
38 class MSIPTransportMgr; |
|
39 class CTLSEntry; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * @brief This class implements TLS mechanism, and is an ECOM plugin |
|
45 */ |
|
46 class CTLSCache : public CBase |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Constructs the object. |
|
52 * @return Return New object, ownership is transferred. |
|
53 */ |
|
54 static CTLSCache* NewL(); |
|
55 |
|
56 /** |
|
57 * Destructor |
|
58 */ |
|
59 ~CTLSCache(); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * Add a new entry to the cache. |
|
65 * |
|
66 * @param aNextHop Next hop address |
|
67 * @param aTransportId Transport identifier |
|
68 * @param aSIPSecUser SIPSec user |
|
69 */ |
|
70 void AddEntryL( const TInetAddr& aNextHop, |
|
71 TUint32 aTransportId, |
|
72 const MSIPSecUser& aSIPSecUser ); |
|
73 |
|
74 /** |
|
75 * Searches the cache for an entry with a matching next hop address. |
|
76 * |
|
77 * @param aNextHop Next hop address |
|
78 * @return CTLSEntry* Matching entry, or NULL if not found. Ownership is not |
|
79 * transferred. |
|
80 */ |
|
81 CTLSEntry* SearchByNextHop( const TInetAddr& aNextHop ) const; |
|
82 |
|
83 /** |
|
84 * Remove the SIPSec user from all cache entries. |
|
85 * |
|
86 * @param aTransportMgr TransportMgr for removing the used TLS transport. |
|
87 * @param aSIPSecUser SIPSec user to be removed. |
|
88 */ |
|
89 void RemoveSIPSecUser( MSIPTransportMgr& aTransportMgr, |
|
90 const MSIPSecUser& aSIPSecUser ); |
|
91 |
|
92 private: // New functions, for internal use |
|
93 |
|
94 /* |
|
95 * Constructor |
|
96 */ |
|
97 CTLSCache(); |
|
98 |
|
99 private: // Data |
|
100 |
|
101 //There can be only one entry for each next hop address. |
|
102 //Elements of the array are owned. |
|
103 RPointerArray<CTLSEntry> iEntries; |
|
104 |
|
105 |
|
106 // For testing purposes |
|
107 #ifdef CPPUNIT_TEST |
|
108 friend class CTLSCacheTest; |
|
109 friend class CSIPSecTlsPluginTest; |
|
110 #endif |
|
111 }; |
|
112 |
|
113 #endif //end of C_TLSCACHE_H |
|
114 |
|
115 // End of File |