hotspotfw/hsserver/inc/hssscaninfoie.h
changeset 0 56b72877c1cb
equal deleted inserted replaced
-1:000000000000 0:56b72877c1cb
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:   Declaration of the ScanInfoIe class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HSSSCANINFOIE_H
       
    21 #define HSSSCANINFOIE_H
       
    22 
       
    23 #include "hssscaninfo.h"
       
    24 
       
    25 /** Defines the possible types of security information elements. */
       
    26 enum HssScanInfoIeType
       
    27     {
       
    28     HssScanInfoIeTypeRsn,
       
    29     HssScanInfoIeTypeWpa
       
    30     };
       
    31 
       
    32 /** Defines the possible types of key management suites. */
       
    33 enum HssScanInfoIeKeyManagement
       
    34     {
       
    35     HssScanInfoIeKeyManagementEap,
       
    36     HssScanInfoIeKeyManagementPsk
       
    37     };
       
    38 
       
    39 /**
       
    40 * Class determining the security mode of an access point.
       
    41 */
       
    42 class HssScanInfoIe
       
    43     {
       
    44     public: // Methods
       
    45 
       
    46        // Constructors and destructor
       
    47         
       
    48         /**
       
    49         * C++ default constructor.
       
    50         */
       
    51         HssScanInfoIe();
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~HssScanInfoIe();
       
    57 
       
    58        // New methods
       
    59 
       
    60         /**
       
    61         * Parses the given scan information and returns the security
       
    62         * mode of the access point.
       
    63         * @param info Scan information to be parsed.
       
    64         * @return Security mode of the access point.
       
    65         */
       
    66         HssSecurityMode SecurityMode(
       
    67             HssScanInfo& info );
       
    68 
       
    69     private: // Methods
       
    70 
       
    71         /**
       
    72         * Checks whether the given memory buffers are equal.
       
    73         * 
       
    74         */
       
    75         int Compare(
       
    76             const unsigned char* pl,
       
    77             int ll, 
       
    78             const unsigned char* pr, 
       
    79             int rl );
       
    80 
       
    81         /**
       
    82         * Checks whether the given information element defines
       
    83         * the expected key management suite.
       
    84         */
       
    85         TBool IsKeyManagement(
       
    86             HssScanInfoIeType ie_type,
       
    87             HssScanInfoIeKeyManagement key_type,
       
    88             TUint8 ie_length,
       
    89             const TUint8* ie_data
       
    90             );
       
    91 
       
    92         /**
       
    93         * Checks whether the given information element defines
       
    94         * valid ciphers suites for WPA2.
       
    95         */
       
    96         TBool IsWpa2Ciphers(
       
    97             HssScanInfoIeType ie_type,
       
    98             TUint8 ie_length,
       
    99             const TUint8* ie_data
       
   100             );
       
   101 
       
   102         // Prohibit copy constructor if not deriving from CBase.
       
   103         HssScanInfoIe(
       
   104             const HssScanInfoIe& );
       
   105         // Prohibit assigment operator if not deriving from CBase.
       
   106         HssScanInfoIe& operator= (
       
   107             const HssScanInfoIe& );
       
   108     };
       
   109 
       
   110 #endif // HssSCANINFOIE_H