wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_iap_data.cpp
branchRCL_3
changeset 6 e0f767079796
parent 0 c40eb8fe8501
child 16 5fb7af913dfd
equal deleted inserted replaced
5:51a71243e562 6:e0f767079796
    13 *
    13 *
    14 * Description:  Class holding all IAP related data
    14 * Description:  Class holding all IAP related data
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 /*
       
    19 * %version: 14.1.1 %
       
    20 */
    18 
    21 
    19 #include "core_iap_data.h"
    22 #include "core_iap_data.h"
    20 #include "core_tools.h"
    23 #include "core_tools.h"
    21 #include "am_debug.h"
    24 #include "am_debug.h"
    22 
    25 
   335             }
   338             }
   336         
   339         
   337         addr = iap_blacklist_m.next();
   340         addr = iap_blacklist_m.next();
   338         }       
   341         }       
   339     }
   342     }
       
   343 
       
   344 // ---------------------------------------------------------------------------
       
   345 // ---------------------------------------------------------------------------
       
   346 //
       
   347 bool_t core_iap_data_c::is_valid() const
       
   348     {
       
   349     if( iap_data_m.security_mode == core_security_mode_wep )
       
   350         {
       
   351         if( !iap_data_m.wep_key1.key_length &&
       
   352             !iap_data_m.wep_key2.key_length &&
       
   353             !iap_data_m.wep_key3.key_length &&
       
   354             !iap_data_m.wep_key4.key_length )
       
   355             {
       
   356             DEBUG( "core_iap_data_c::is_valid() - security mode is WEP but no keys defined" );
       
   357 
       
   358             return false_t;
       
   359             }
       
   360 
       
   361         if( ( iap_data_m.default_wep_key > WEP_KEY4 ) ||             
       
   362             ( iap_data_m.default_wep_key == WEP_KEY1 &&
       
   363               !iap_data_m.wep_key1.key_length ) ||
       
   364             ( iap_data_m.default_wep_key == WEP_KEY2 &&
       
   365               !iap_data_m.wep_key2.key_length ) ||
       
   366             ( iap_data_m.default_wep_key == WEP_KEY3 &&
       
   367               !iap_data_m.wep_key3.key_length ) ||
       
   368             ( iap_data_m.default_wep_key == WEP_KEY4 &&
       
   369               !iap_data_m.wep_key4.key_length ) )
       
   370             {
       
   371             DEBUG( "core_iap_data_c::is_valid() - security mode is WEP but default key not defined" );
       
   372 
       
   373             return false_t;
       
   374             }
       
   375         }
       
   376 
       
   377     if( iap_data_m.wpa_preshared_key_in_use &&
       
   378         !iap_data_m.wpa_preshared_key.key_length )
       
   379         {
       
   380         DEBUG( "core_iap_data_c::is_valid() - security mode is WPA-PSK but key is not defined" );
       
   381 
       
   382         return false_t;   
       
   383         }
       
   384     
       
   385     if( iap_data_m.op_mode == core_operating_mode_ibss &&
       
   386         ( iap_data_m.security_mode != core_security_mode_allow_unsecure &&
       
   387           iap_data_m.security_mode != core_security_mode_wep ) )
       
   388         {
       
   389         DEBUG1( "core_iap_data_c::is_valid() - IBSS mode with security mode %u not supported",
       
   390             iap_data_m.security_mode );
       
   391 
       
   392         return false_t;        
       
   393         }
       
   394 
       
   395     return true_t;
       
   396     }