secureswitools/swianalysistoolkit/source/dumpswiregistrytool/siscontrollerinfo.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2005-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 the License "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 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "siscontrollerinfo.h"
       
    20 
       
    21 SISControllerInfo::SISControllerInfo()
       
    22 	:iMajor (0) ,
       
    23 	iMinor (0),
       
    24 	iBuild( 0)  ,
       
    25 	iOffset (0),
       
    26 	iAlgorithmType (0)
       
    27 	{
       
    28 	iAlgorithms[0] = "MD2" ;
       
    29 	iAlgorithms[1] = "MD5" ;
       
    30 	iAlgorithms[2] = "SHA1" ;
       
    31 	iAlgorithms[3] = "HMAC" ;
       
    32 	}
       
    33 
       
    34 void SISControllerInfo::ExtractControllerInfo(StreamReader& aReader )
       
    35 	{	
       
    36 	iMajor = aReader.ReadInt32();
       
    37 	iMinor = aReader.ReadInt32();
       
    38 	iBuild = aReader.ReadInt32();
       
    39 	iOffset = aReader.ReadInt32();
       
    40 	iAlgorithmType = aReader.ReadInt32();
       
    41 	char* controllerHash = aReader.ReadDescriptor();
       
    42 	delete [] controllerHash;
       
    43 	}
       
    44 
       
    45 
       
    46 void SISControllerInfo::DisplayControllerInfo(int i)
       
    47 	{
       
    48 	cout << endl ;
       
    49 	cout << "Controller" << i+1 << " Version :" << iMajor << "." << iMinor << "." << iBuild << endl;
       
    50 	if(iAlgorithms.find(iAlgorithmType) != iAlgorithms.end())
       
    51 		{
       
    52 		cout << "Controller" << i+1 << " Algorithm :" << iAlgorithms[iAlgorithmType] << endl << endl;
       
    53 		}
       
    54 	else
       
    55 		{
       
    56 		cout << "Controller" << i+1 << " Algorithm :" << "Unknown" << endl << endl;
       
    57 		}
       
    58 		
       
    59 	}
       
    60 
       
    61 
       
    62 SISControllerInfo::~SISControllerInfo()
       
    63 	{
       
    64 	}
       
    65 	
       
    66 
       
    67