examples/Base/IPC/secureserver/secureclientandserver.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without
00005 modification, are permitted provided that the following conditions are met:
00006 
00007 * Redistributions of source code must retain the above copyright notice, this
00008   list of conditions and the following disclaimer.
00009 * Redistributions in binary form must reproduce the above copyright notice,
00010   this list of conditions and the following disclaimer in the documentation
00011   and/or other materials provided with the distribution.
00012 * Neither the name of Nokia Corporation nor the names of its contributors
00013   may be used to endorse or promote products derived from this software
00014   without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 Description:
00028 Defines enums and constants that are common to the client and the server.
00029 The most important items are:
00030 - the enum TSecureServerRequest that defines requests. These request numbers are also known as ‘op codes’.
00031 - the numbers that define the version of the server and the version of the server that the client requires.  
00032 */
00033 
00034 
00035 
00036 
00042 #ifndef __SECURECLIENTANDSERVER_H__
00043 #define __SECURECLIENTANDSERVER_H__
00044 
00045 #include <e32base.h>
00046 #include <e32cons.h>
00047 
00051 _LIT(KSecureServerName,"SecureServer");
00052 
00053 const TUint KDefaultMessageSlots=4;
00054 
00058 const TUint KSecureServMajorVersionNumber = 0;
00059 const TUint KSecureServMinorVersionNumber = 1;
00060 const TUint KSecureServBuildVersionNumber = 1;
00061 
00062 IMPORT_C TInt StartThread(RThread& aServerThread);
00063 
00067 enum TSecureServerRequest
00068         {
00072         ESecureServerCreateSubSession,
00076         ESecureServerCloseSubSession,
00080         ESecureServerInitSubSession,
00084         ESecureServerCloseSession,
00088         ESecureServerValue,
00092         ESecureServerResourceCount,
00096         ESecureServerIncrease,
00100         ESecureServerIncreaseBy,
00104         ESecureServerDecrease,
00108         ESecureServerDecreaseBy,
00112         ESecureServerReset,
00116         ESecureServerSaveCounter,
00120         ESecureServerSetCounterFromFile
00121         };
00122 
00126 enum TSecureServerLeave
00127         {
00133         ENonNumericString = 99
00134         };
00135 
00136 _LIT(KTextConsoleTitle, "Secure Server Console");
00137 _LIT(KTextFailed, " failed, leave code = %d");
00138 _LIT(KTextPressAnyKey, " [press any key]\n");
00139 
00140 _LIT(KTxtTestingCountServer,"Testing the count server test with 2 client sub sessions; these represent independent counters \n\n");
00141 _LIT(KTxtInitCounterAWith,"\nInitialize counter A with : ");
00142 _LIT(KTxtInitCounterBWith,"\nInitialize counter B with : ");
00143 _LIT(KTxtInitCounterFailed,"\nSetting the counter from string failed: non-numeric character detected\n");
00144 _LIT(KTxtInitCounterSucceeded,"\nSetting the counter from string succeeded\n");
00145 _LIT(KTxtGetCounterAValue,"Getting counterA value from server: %d \n");
00146 _LIT(KTxtGetCounterBValue,"Getting counterB value from server: %d \n");
00147 _LIT(KTxtTransactionId,"***\nTransaction ID of the session : %d\n***\n");
00148 _LIT(KMsgPressAnyKey," (press any key to continue)\n");
00149 _LIT(KTxtOption,"\nEnter 1 to initialise from file\n");
00150 _LIT(KTxtInitFromFile,"\nInitialising from file, value = %d\n");
00151 _LIT(KTxtTransactionID,"\nEnter the Transaction ID for the session\n");
00152 _LIT(KTxtSaveToFile,"\nTo save the value of counter A press 'a' and for counter B press 'b'..\n");
00153 _LIT(KTxtSelectCounter,"\nYou selected counter %c\n");
00154 _LIT(KTxtSaveCounter,"\nSaving Counter Value..\n");
00155 
00156 #endif

Generated by  doxygen 1.6.2