Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/secureserver_8h_source.html
changeset 6 43e37759235e
equal deleted inserted replaced
5:f345bda72bc4 6:43e37759235e
       
     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       
     2 <html xmlns="http://www.w3.org/1999/xhtml">
       
     3 <head>
       
     4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
       
     5 <title>TB9.2 Example Applications: examples/Base/IPC/secureserver/secureserver.h Source File</title>
       
     6 <link href="tabs.css" rel="stylesheet" type="text/css"/>
       
     7 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
       
     8 </head>
       
     9 <body>
       
    10 <!-- Generated by Doxygen 1.6.2 -->
       
    11 <h1>examples/Base/IPC/secureserver/secureserver.h</h1><a href="secureserver_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
       
    12 <a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
       
    13 <a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
       
    14 <a name="l00004"></a>00004 <span class="comment">// under the terms of &quot;Eclipse Public License v1.0&quot;</span>
       
    15 <a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
       
    16 <a name="l00006"></a>00006 <span class="comment">// at the URL &quot;http://www.eclipse.org/legal/epl-v10.html&quot;.</span>
       
    17 <a name="l00007"></a>00007 <span class="comment">//</span>
       
    18 <a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
       
    19 <a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
       
    20 <a name="l00010"></a>00010 <span class="comment">//</span>
       
    21 <a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
       
    22 <a name="l00012"></a>00012 <span class="comment">//</span>
       
    23 <a name="l00013"></a>00013 <span class="comment">// Description:</span>
       
    24 <a name="l00014"></a>00014 <span class="comment">// Defines CSecureServer, CSecureServerSession and CSecureServerSubSession classes.</span>
       
    25 <a name="l00015"></a>00015 <span class="comment">// It also defines the constants that form the security policy for the server.</span>
       
    26 <a name="l00016"></a>00016 <span class="comment">//</span>
       
    27 <a name="l00017"></a>00017 
       
    28 <a name="l00018"></a>00018 
       
    29 <a name="l00019"></a>00019 
       
    30 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef __SECURESERVER_H__</span>
       
    31 <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __SECURESERVER_H__</span>
       
    32 <a name="l00026"></a>00026 <span class="preprocessor"></span>
       
    33 <a name="l00027"></a>00027 <span class="preprocessor">#include &lt;e32svr.h&gt;</span>
       
    34 <a name="l00028"></a>00028 <span class="preprocessor">#include &lt;e32uid.h&gt;</span>
       
    35 <a name="l00029"></a>00029 <span class="preprocessor">#include &lt;e32math.h&gt;</span>
       
    36 <a name="l00030"></a>00030 <span class="preprocessor">#include &lt;f32file.h&gt;</span>
       
    37 <a name="l00031"></a>00031 
       
    38 <a name="l00036"></a><a class="code" href="secureserver_8h.html#abccd7aceb4760cddd96866248e305f29">00036</a> <span class="keyword">const</span> TUint <a class="code" href="secureserver_8h.html#abccd7aceb4760cddd96866248e305f29">KDefaultHeapSize</a>=0x10000;
       
    39 <a name="l00037"></a>00037 
       
    40 <a name="l00043"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4ef">00043</a> <span class="keyword">enum</span> <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4ef">TSecureServerPanic</a>
       
    41 <a name="l00044"></a>00044         {
       
    42 <a name="l00048"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efaeef6b7f2a8413e6863e2136b93228c3a">00048</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efaeef6b7f2a8413e6863e2136b93228c3a">EBadRequest</a> = 1,
       
    43 <a name="l00052"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa59f7e1b1a0e300077050b023b97ebcfb">00052</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa59f7e1b1a0e300077050b023b97ebcfb">EDescriptorNonNumeric</a>,
       
    44 <a name="l00056"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa4dc32eda4a06b69469187275e825d99f">00056</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa4dc32eda4a06b69469187275e825d99f">EMainSchedulerError</a>,
       
    45 <a name="l00060"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa9b127171258d0cdb2748e608aaa757cb">00060</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa9b127171258d0cdb2748e608aaa757cb">EServerCreateServer</a>,
       
    46 <a name="l00064"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efad2d8074b4ac1ba9f45dbb70e6aec4144">00064</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efad2d8074b4ac1ba9f45dbb70e6aec4144">EServerStartServer</a>,
       
    47 <a name="l00068"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa36f3ebda4e94aedb5817599162216e69">00068</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa36f3ebda4e94aedb5817599162216e69">ECreateTrapCleanup</a>,
       
    48 <a name="l00072"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efaeebad163989c978b8edd91b6893411c0">00072</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efaeebad163989c978b8edd91b6893411c0">EBadSubsessionHandle</a>,
       
    49 <a name="l00076"></a><a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa58c52029fd13028de726c112eedc638a">00076</a>         <a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4efa58c52029fd13028de726c112eedc638a">ESecureServerSecurityPolicy</a>
       
    50 <a name="l00077"></a>00077         };
       
    51 <a name="l00078"></a>00078 
       
    52 <a name="l00083"></a><a class="code" href="secureserver_8h.html#a58c74f3d388b4e34764cddd3d0d24c92">00083</a> <span class="keyword">const</span> TInt <a class="code" href="secureserver_8h.html#a58c74f3d388b4e34764cddd3d0d24c92">KSecureServerRangeCount</a> = 5;
       
    53 <a name="l00084"></a>00084 
       
    54 <a name="l00089"></a><a class="code" href="secureserver_8h.html#a374f11258957fe4902b11706c8d378bf">00089</a> <span class="keyword">const</span> TInt <a class="code" href="secureserver_8h.html#a374f11258957fe4902b11706c8d378bf">KSecureServerRanges</a>[<a class="code" href="secureserver_8h.html#a58c74f3d388b4e34764cddd3d0d24c92">KSecureServerRangeCount</a>] =
       
    55 <a name="l00090"></a>00090         {
       
    56 <a name="l00094"></a>00094         0,
       
    57 <a name="l00098"></a>00098         5,
       
    58 <a name="l00102"></a>00102         6,
       
    59 <a name="l00106"></a>00106         11,
       
    60 <a name="l00110"></a>00110         13
       
    61 <a name="l00111"></a>00111         };
       
    62 <a name="l00112"></a>00112 
       
    63 <a name="l00117"></a><a class="code" href="secureserver_8h.html#a96a8dd34c3e8faf09bc5ef7050b5d0ce">00117</a> <span class="keyword">const</span> CPolicyServer::TPolicyElement <a class="code" href="secureserver_8h.html#a96a8dd34c3e8faf09bc5ef7050b5d0ce">KSecureServerElements</a>[] =
       
    64 <a name="l00118"></a>00118         {
       
    65 <a name="l00122"></a>00122         _INIT_SECURITY_POLICY_S0(0x70fffff0),
       
    66 <a name="l00126"></a>00126         {_INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData | ECapabilityWriteDeviceData), CPolicyServer::EFailClient}
       
    67 <a name="l00127"></a>00127         };
       
    68 <a name="l00128"></a>00128 
       
    69 <a name="l00133"></a><a class="code" href="secureserver_8h.html#a1c5ad63aafc1be2736f3a8177f4d7fd9">00133</a> <span class="keyword">const</span> TUint8 <a class="code" href="secureserver_8h.html#a1c5ad63aafc1be2736f3a8177f4d7fd9">KSecureServerElementsIndex</a>[<a class="code" href="secureserver_8h.html#a58c74f3d388b4e34764cddd3d0d24c92">KSecureServerRangeCount</a>] =
       
    70 <a name="l00134"></a>00134                 {
       
    71 <a name="l00139"></a>00139                 CPolicyServer::EAlwaysPass,
       
    72 <a name="l00144"></a>00144                 0,
       
    73 <a name="l00149"></a>00149                 CPolicyServer::ECustomCheck,
       
    74 <a name="l00154"></a>00154                 1,
       
    75 <a name="l00159"></a>00159                 CPolicyServer::ENotSupported
       
    76 <a name="l00160"></a>00160                 };
       
    77 <a name="l00161"></a>00161 
       
    78 <a name="l00167"></a><a class="code" href="secureserver_8h.html#a35e41e8fbb27c5be7ed4ce6c6cd28d2a">00167</a> <span class="keyword">const</span> CPolicyServer::TPolicy <a class="code" href="secureserver_8h.html#a35e41e8fbb27c5be7ed4ce6c6cd28d2a">KSecureServerPolicy</a> =
       
    79 <a name="l00168"></a>00168         {
       
    80 <a name="l00172"></a>00172         CPolicyServer::EAlwaysPass,
       
    81 <a name="l00173"></a>00173         <a class="code" href="secureserver_8h.html#a58c74f3d388b4e34764cddd3d0d24c92">KSecureServerRangeCount</a>,
       
    82 <a name="l00174"></a>00174         <a class="code" href="secureserver_8h.html#a374f11258957fe4902b11706c8d378bf">KSecureServerRanges</a>,
       
    83 <a name="l00175"></a>00175         <a class="code" href="secureserver_8h.html#a1c5ad63aafc1be2736f3a8177f4d7fd9">KSecureServerElementsIndex</a>,
       
    84 <a name="l00176"></a>00176         <a class="code" href="secureserver_8h.html#a96a8dd34c3e8faf09bc5ef7050b5d0ce">KSecureServerElements</a>
       
    85 <a name="l00177"></a>00177         };
       
    86 <a name="l00178"></a>00178 
       
    87 <a name="l00190"></a><a class="code" href="class_c_secure_server.html">00190</a> <span class="keyword">class </span><a class="code" href="class_c_secure_server.html">CSecureServer</a> : <span class="keyword">public</span> CPolicyServer
       
    88 <a name="l00191"></a>00191         {
       
    89 <a name="l00192"></a>00192 <span class="keyword">public</span>:
       
    90 <a name="l00193"></a>00193         CSession2* <a class="code" href="class_c_secure_server.html#a1f53e7eb732c048d41f7a74069c971bf">NewSessionL</a>(<span class="keyword">const</span> TVersion &amp;aVersion,<span class="keyword">const</span> RMessage2&amp; aMessage) <span class="keyword">const</span>;
       
    91 <a name="l00194"></a>00194         <span class="keyword">static</span> <a class="code" href="class_c_secure_server.html">CSecureServer</a>* <a class="code" href="class_c_secure_server.html#a3d4524a4e4accf80a32364780ae43e91">NewL</a>(CActive::TPriority aActiveObjectPriority);
       
    92 <a name="l00195"></a>00195         <span class="keyword">static</span> TInt <a class="code" href="class_c_secure_server.html#a97b0ca5c5966bba8c0cee269d1909b75">ThreadFunction</a>(TAny* aStarted);
       
    93 <a name="l00196"></a>00196         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server.html#ac8c14996a41c6d897efaee0fa7d12cd2">PanicServer</a>(<a class="code" href="secureserver_8h.html#a091a5ad2956fb84c4470a59010a0d4ef">TSecureServerPanic</a> aPanic);
       
    94 <a name="l00197"></a>00197         CPolicyServer::TCustomResult <a class="code" href="class_c_secure_server.html#acf179b4c14ae84701779f659c9e4488f">CustomSecurityCheckL</a>(<span class="keyword">const</span> RMessage2 &amp;aMsg, TInt &amp;aAction, TSecurityInfo &amp;aMissing);
       
    95 <a name="l00198"></a>00198         CObjectCon* <a class="code" href="class_c_secure_server.html#a65a88f3753c16940867d3b277608bdac">NewContainerL</a>();
       
    96 <a name="l00199"></a>00199         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server.html#ae6b5aba2bd5e4b8bffaa4febbe874e37">RemoveContainer</a>(CObjectCon *aCon);
       
    97 <a name="l00200"></a>00200         <a class="code" href="class_c_secure_server.html#a42202b0478075c59aa39dca27b1cb48d">~CSecureServer</a>();
       
    98 <a name="l00201"></a>00201 <span class="keyword">private</span> :
       
    99 <a name="l00202"></a>00202         <a class="code" href="class_c_secure_server.html">CSecureServer</a>(CActive::TPriority aActiveObjectPriority);
       
   100 <a name="l00203"></a>00203         <span class="keywordtype">void</span> ConstructL();
       
   101 <a name="l00204"></a>00204 
       
   102 <a name="l00205"></a>00205 <span class="keyword">private</span>:
       
   103 <a name="l00209"></a>00209         CObjectConIx* iContainerIndex;
       
   104 <a name="l00210"></a>00210         };
       
   105 <a name="l00211"></a>00211 
       
   106 <a name="l00212"></a>00212 <span class="keyword">class </span><a class="code" href="class_c_secure_server_sub_session.html">CSecureServerSubSession</a>;
       
   107 <a name="l00213"></a>00213 
       
   108 <a name="l00220"></a><a class="code" href="class_c_secure_server_session.html">00220</a> <span class="keyword">class </span><a class="code" href="class_c_secure_server_session.html">CSecureServerSession</a> : <span class="keyword">public</span> CSession2
       
   109 <a name="l00221"></a>00221         {
       
   110 <a name="l00222"></a>00222 <span class="keyword">public</span>:
       
   111 <a name="l00223"></a>00223         <span class="keyword">static</span> <a class="code" href="class_c_secure_server_session.html">CSecureServerSession</a>* NewL();
       
   112 <a name="l00224"></a>00224         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#ab9502afe61e2be236b5602af41ff234d">CreateL</a>();
       
   113 <a name="l00225"></a>00225         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#a1ef8c62f2085e8e860a9d4333a354a4c">ServiceL</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   114 <a name="l00226"></a>00226         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#a7f1276a074d2f92b29b924903a02f6bf">NewCounterL</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   115 <a name="l00227"></a>00227         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#a5921d8c81a8a2e3c01f73a5ea23cc194">CloseSession</a>();
       
   116 <a name="l00228"></a>00228         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#a4046b0fbcbf22d3aab8b2877cd554395">NumResourcesL</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   117 <a name="l00229"></a>00229         <a class="code" href="class_c_secure_server_sub_session.html">CSecureServerSubSession</a>* <a class="code" href="class_c_secure_server_session.html#a478b6424b1ab3dde2b874847164650f0">CounterFromHandle</a>(<span class="keyword">const</span> RMessage2&amp; aMessage,TInt aHandle);
       
   118 <a name="l00230"></a>00230         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#a879e7d197ab62104e2187e98ed2724b4">DeleteCounter</a>(TInt aHandle);
       
   119 <a name="l00231"></a>00231         TInt <a class="code" href="class_c_secure_server_session.html#a0307c128da103c5fa6b9f5b382f90e3c">CountResources</a>();
       
   120 <a name="l00232"></a>00232         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_session.html#a05f576bc35402465caafc65ad0593e8b">PanicClient</a>(<span class="keyword">const</span> RMessage2&amp; aMessage,TInt aPanic) <span class="keyword">const</span>;
       
   121 <a name="l00233"></a>00233         <a class="code" href="class_c_secure_server_session.html#ad02090d242cef53516c5680c97843b68">CSecureServerSession</a>();
       
   122 <a name="l00234"></a>00234 <span class="keyword">private</span>:
       
   123 <a name="l00238"></a>00238         CObjectCon* iContainer;
       
   124 <a name="l00242"></a>00242         CObjectIx* iCountersObjectIndex;
       
   125 <a name="l00247"></a>00247         TInt iResourceCount;
       
   126 <a name="l00248"></a>00248         };
       
   127 <a name="l00249"></a>00249 
       
   128 <a name="l00256"></a><a class="code" href="class_c_secure_server_sub_session.html">00256</a> <span class="keyword">class </span><a class="code" href="class_c_secure_server_sub_session.html">CSecureServerSubSession</a> : <span class="keyword">public</span> CObject
       
   129 <a name="l00257"></a>00257         {
       
   130 <a name="l00258"></a>00258 <span class="keyword">public</span>:
       
   131 <a name="l00259"></a>00259         <span class="keyword">static</span> <a class="code" href="class_c_secure_server_sub_session.html">CSecureServerSubSession</a>* NewL(<a class="code" href="class_c_secure_server_session.html">CSecureServerSession</a>* aSession);
       
   132 <a name="l00260"></a>00260         <a class="code" href="class_c_secure_server_sub_session.html#a5303b3bc024108cd70a7f331e2052672">CSecureServerSubSession</a>(<a class="code" href="class_c_secure_server_session.html">CSecureServerSession</a>* aSession);
       
   133 <a name="l00261"></a>00261         <span class="keywordtype">void</span> ConstructL(<a class="code" href="class_c_secure_server_session.html">CSecureServerSession</a>* aSession);
       
   134 <a name="l00262"></a>00262         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a97ed872aae87b8cb76d6fa101a52303f">SetFromStringL</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   135 <a name="l00263"></a>00263         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a388299f02880acd81521b12ea68fb6ba">Increase</a>();
       
   136 <a name="l00264"></a>00264         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a2de0131772c586accbd61fb2ed329647">IncreaseBy</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   137 <a name="l00265"></a>00265         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#ac9e4188e16b286e4ed6cbd1cce24a42e">Decrease</a>();
       
   138 <a name="l00266"></a>00266         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#aaee3504a264b7c7136660201bf143a6d">DecreaseBy</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   139 <a name="l00267"></a>00267         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a5ffe759ade87ebaeea7e2399d65b07e5">Reset</a>();
       
   140 <a name="l00268"></a>00268         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a3edaea36ff8bb03d5814b4aa245b761a">CounterValueL</a>(<span class="keyword">const</span> RMessage2&amp; aMessage);
       
   141 <a name="l00269"></a>00269         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a5a58cd7db75221072f5ef4251fe75a82">SaveCounterValueL</a>();
       
   142 <a name="l00270"></a>00270         <span class="keywordtype">void</span> <a class="code" href="class_c_secure_server_sub_session.html#a234065b99df276eca6097ab3d89cc81a">SetCounterValueFromFileL</a>();
       
   143 <a name="l00271"></a>00271 
       
   144 <a name="l00272"></a>00272 <span class="keyword">protected</span>:
       
   145 <a name="l00276"></a><a class="code" href="class_c_secure_server_sub_session.html#a12f71f6ef1769cfe3f98606e0d11ae41">00276</a>         <a class="code" href="class_c_secure_server_session.html">CSecureServerSession</a>* <a class="code" href="class_c_secure_server_sub_session.html#a12f71f6ef1769cfe3f98606e0d11ae41">iSession</a>;
       
   146 <a name="l00277"></a>00277 
       
   147 <a name="l00278"></a>00278 <span class="keyword">private</span>:
       
   148 <a name="l00282"></a>00282         TInt iCount;
       
   149 <a name="l00283"></a>00283         };
       
   150 <a name="l00284"></a>00284 
       
   151 <a name="l00285"></a>00285 <span class="preprocessor">#endif</span>
       
   152 </pre></div></div>
       
   153 <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
       
   154 <a href="http://www.doxygen.org/index.html">
       
   155 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
       
   156 </body>
       
   157 </html>