1078 // CApSettingsModel::ChangeWepSettingsL |
1086 // CApSettingsModel::ChangeWepSettingsL |
1079 // --------------------------------------------------------- |
1087 // --------------------------------------------------------- |
1080 // |
1088 // |
1081 TInt CApSettingsModel::ChangeWepSettingsL( CApAccessPointItem* aApItem ) |
1089 TInt CApSettingsModel::ChangeWepSettingsL( CApAccessPointItem* aApItem ) |
1082 { |
1090 { |
1083 APSETUILOGGER_ENTERFN( EModel,"Model::ChangeWepSettingsL - ERROR: not suported") |
1091 APSETUILOGGER_ENTERFN( EModel,"Model::ChangeWepSettingsL") |
1084 aApItem = aApItem; |
1092 TInt retval(0); |
1085 return KErrNotSupported; |
1093 |
|
1094 if ( !iWepSecSettings ) |
|
1095 { |
|
1096 iWepSecSettings = CWEPSecuritySettings::NewL(); |
|
1097 TUint32 iapid( 0 ); |
|
1098 aApItem->ReadUint( EApIapServiceId, iapid ); |
|
1099 iWepSecSettings->LoadL( iapid, *Database()->Database() ); |
|
1100 } |
|
1101 |
|
1102 if ( !iWepSecSettingsUi ) |
|
1103 { |
|
1104 iWepSecSettingsUi = CWEPSecuritySettingsUi::NewL( *EikEnv() ); |
|
1105 } |
|
1106 |
|
1107 iWepUiExitReason = iWepSecSettings->EditL( *iWepSecSettingsUi, |
|
1108 aApItem->ConnectionName() ); |
|
1109 |
|
1110 if ( iWepUiExitReason & CWEPSecuritySettings::EExitReq ) |
|
1111 { |
|
1112 retval += KApUiEventExitRequested; |
|
1113 } |
|
1114 if ( iWepUiExitReason & CWEPSecuritySettings::EShutDownReq ) |
|
1115 { |
|
1116 retval += KApUiEventShutDownRequested; |
|
1117 } |
|
1118 APSETUILOGGER_LEAVEFN( EModel,"Model::ChangeWepSettingsL") |
|
1119 return retval; |
1086 } |
1120 } |
1087 |
1121 |
1088 |
1122 |
1089 |
1123 |
1090 // --------------------------------------------------------- |
1124 // --------------------------------------------------------- |
1091 // CApSettingsModel::ChangeWpaSettingsL |
1125 // CApSettingsModel::ChangeWpaSettingsL |
1092 // --------------------------------------------------------- |
1126 // --------------------------------------------------------- |
1093 // |
1127 // |
1094 TInt CApSettingsModel::ChangeWpaSettingsL( CApAccessPointItem* aApItem ) |
1128 TInt CApSettingsModel::ChangeWpaSettingsL( CApAccessPointItem* aApItem ) |
1095 { |
1129 { |
1096 APSETUILOGGER_ENTERFN( EModel,"Model::ChangeWpaSettingsL - ERROR: not suported") |
1130 APSETUILOGGER_ENTERFN( EModel,"Model::ChangeWpaSettingsL") |
1097 aApItem = aApItem; |
1131 TInt retval(0); |
1098 return KErrNotSupported; |
1132 |
|
1133 if ( !iWpaSecSettings ) |
|
1134 { |
|
1135 iWpaSecSettings = CWPASecuritySettings::NewL( ESecurityModeWpa ); |
|
1136 TUint32 iapid( 0 ); |
|
1137 aApItem->ReadUint( EApIapServiceId, iapid ); |
|
1138 iWpaSecSettings->LoadL( iapid, *Database()->Database() ); |
|
1139 } |
|
1140 |
|
1141 if ( !iWpaSecSettingsUi ) |
|
1142 { |
|
1143 iWpaSecSettingsUi = CWPASecuritySettingsUi::NewL( *EikEnv() ); |
|
1144 } |
|
1145 |
|
1146 iWpaUiExitReason = iWpaSecSettings->EditL( *iWpaSecSettingsUi, |
|
1147 aApItem->ConnectionName() ); |
|
1148 |
|
1149 if ( iWpaUiExitReason & CWPASecuritySettings::EExitReq ) |
|
1150 { |
|
1151 retval += KApUiEventExitRequested; |
|
1152 } |
|
1153 if ( iWpaUiExitReason & CWPASecuritySettings::EShutDownReq ) |
|
1154 { |
|
1155 retval += KApUiEventShutDownRequested; |
|
1156 } |
|
1157 APSETUILOGGER_LEAVEFN( EModel,"Model::ChangeWpaSettingsL") |
|
1158 return retval; |
1099 } |
1159 } |
1100 |
1160 |
1101 |
1161 |
1102 |
1162 |
1103 // --------------------------------------------------------- |
1163 // --------------------------------------------------------- |
1104 // CApSettingsModel::Change8021xSettingsL |
1164 // CApSettingsModel::Change8021xSettingsL |
1105 // --------------------------------------------------------- |
1165 // --------------------------------------------------------- |
1106 // |
1166 // |
1107 TInt CApSettingsModel::Change8021xSettingsL( CApAccessPointItem* aApItem ) |
1167 TInt CApSettingsModel::Change8021xSettingsL( CApAccessPointItem* aApItem ) |
1108 { |
1168 { |
1109 APSETUILOGGER_ENTERFN( EModel,"Model::Change8021xSettingsL - ERROR: not suported") |
1169 APSETUILOGGER_ENTERFN( EModel,"Model::Change8021xSettingsL") |
1110 aApItem = aApItem; |
1170 TInt retval(0); |
1111 return KErrNotSupported; |
1171 |
|
1172 if ( !iWpaSecSettings ) |
|
1173 { |
|
1174 iWpaSecSettings = CWPASecuritySettings::NewL( ESecurityMode8021x ); |
|
1175 TUint32 iapid( 0 ); |
|
1176 aApItem->ReadUint( EApIapServiceId, iapid ); |
|
1177 iWpaSecSettings->LoadL( iapid, *Database()->Database() ); |
|
1178 } |
|
1179 |
|
1180 if ( !iWpaSecSettingsUi ) |
|
1181 { |
|
1182 iWpaSecSettingsUi = CWPASecuritySettingsUi::NewL( *EikEnv() ); |
|
1183 } |
|
1184 |
|
1185 iWpaUiExitReason = iWpaSecSettings->EditL( *iWpaSecSettingsUi, |
|
1186 aApItem->ConnectionName() ); |
|
1187 |
|
1188 if ( iWpaUiExitReason & CWPASecuritySettings::EExitReq ) |
|
1189 { |
|
1190 retval += KApUiEventExitRequested; |
|
1191 } |
|
1192 if ( iWpaUiExitReason & CWPASecuritySettings::EShutDownReq ) |
|
1193 { |
|
1194 retval += KApUiEventShutDownRequested; |
|
1195 } |
|
1196 APSETUILOGGER_LEAVEFN( EModel,"Model::Change8021xSettingsL") |
|
1197 return retval; |
1112 } |
1198 } |
1113 |
1199 |
1114 |
1200 |
1115 |
1201 |
1116 // --------------------------------------------------------- |
1202 // --------------------------------------------------------- |
1117 // CApSettingsModel::ClearWEPAndWPASettings |
1203 // CApSettingsModel::ClearWEPAndWPASettings |
1118 // --------------------------------------------------------- |
1204 // --------------------------------------------------------- |
1119 // |
1205 // |
1120 void CApSettingsModel::ClearWEPAndWPASettings() |
1206 void CApSettingsModel::ClearWEPAndWPASettings() |
1121 { |
1207 { |
1122 APSETUILOGGER_ENTERFN( EModel,"Model::ClearWEPAndWPASettings - ERROR: not suported") |
1208 APSETUILOGGER_ENTERFN( EModel,"Model::ClearWEPAndWPASettings") |
1123 } |
1209 |
|
1210 delete iWepSecSettings; |
|
1211 iWepSecSettings = NULL; |
|
1212 |
|
1213 delete iWpaSecSettings; |
|
1214 iWpaSecSettings = NULL; |
|
1215 |
|
1216 APSETUILOGGER_LEAVEFN( EModel,"Model::ClearWEPAndWPASettings") |
|
1217 } |
|
1218 |
1124 |
1219 |
1125 |
1220 |
1126 // --------------------------------------------------------- |
1221 // --------------------------------------------------------- |
1127 // CApSettingsModel::WriteWlanL |
1222 // CApSettingsModel::WriteWlanL |
1128 // --------------------------------------------------------- |
1223 // --------------------------------------------------------- |
1129 // |
1224 // |
1130 void CApSettingsModel::WriteWlanL( CApAccessPointItem& aApItem, |
1225 void CApSettingsModel::WriteWlanL( CApAccessPointItem& aApItem, |
1131 TBool aIsNew ) |
1226 TBool aIsNew ) |
1132 { |
1227 { |
1133 APSETUILOGGER_ENTERFN( EModel,"Model::WriteWlanL - ERROR: not supported") |
1228 APSETUILOGGER_ENTERFN( EModel,"Model::WriteWlanL") |
1134 aApItem; |
1229 // now check if it is WLAN and handle security savings... |
1135 aIsNew; |
1230 if ( aApItem.BearerTypeL() == EApBearerTypeWLAN ) |
1136 User::Leave( KErrNotSupported ); |
1231 { // it is WLAN... |
1137 } |
1232 // check that there were no bearer-change, because if orig. bearer |
|
1233 // was NOT wlan, then we shouls consider it as a new record!!! |
|
1234 TUint32 wlanid(0); |
|
1235 aApItem.ReadUint( EApIapServiceId, wlanid ); |
|
1236 |
|
1237 TUint32 oldwlanid(wlanid); |
|
1238 |
|
1239 TTypeOfSaving savetype( ESavingEditedAP ); |
|
1240 |
|
1241 if ( aIsNew ) |
|
1242 { |
|
1243 savetype = ESavingBrandNewAP; |
|
1244 oldwlanid = 0; |
|
1245 } |
|
1246 // now check if it is WEP... |
|
1247 // read up security mode |
|
1248 TUint32 secmode( 0 ); |
|
1249 aApItem.ReadUint( EApWlanSecurityMode, secmode ); |
|
1250 |
|
1251 |
|
1252 TBool fresh(EFalse); |
|
1253 |
|
1254 |
|
1255 switch ( secmode ) |
|
1256 { |
|
1257 case EOpen: |
|
1258 { |
|
1259 break; |
|
1260 } |
|
1261 case EWep: |
|
1262 { |
|
1263 // we have to try to save if: |
|
1264 // 1. it is a changed AP, it is possible that only |
|
1265 // sec. settings have been changed. |
|
1266 // In this case, iWepSecSettings might be NULL!! |
|
1267 // 2. it's sec. settings had been edited |
|
1268 |
|
1269 if ( !iWepSecSettings ) |
|
1270 { |
|
1271 iWepSecSettings = CWEPSecuritySettings::NewL(); |
|
1272 fresh = ETrue; |
|
1273 iWepSecSettings->LoadL( oldwlanid, |
|
1274 *Database()->Database() ); |
|
1275 } |
|
1276 |
|
1277 if ( ( iWepUiExitReason & CWEPSecuritySettings::EValid ) |
|
1278 || ( fresh ) ) |
|
1279 { // save WEP settings, too, into same transaction... |
|
1280 iWepSecSettings->SaveL( wlanid, *iDb->Database() ); |
|
1281 } |
|
1282 break; |
|
1283 } |
|
1284 case E802_1x: |
|
1285 { |
|
1286 |
|
1287 if ( !iWpaSecSettings ) |
|
1288 { |
|
1289 iWpaSecSettings = |
|
1290 CWPASecuritySettings::NewL( ESecurityMode8021x ); |
|
1291 fresh = ETrue; |
|
1292 iWpaSecSettings->LoadL( oldwlanid, |
|
1293 *Database()->Database() ); |
|
1294 } |
|
1295 |
|
1296 if ( ( iWpaUiExitReason & CWPASecuritySettings::EValid ) |
|
1297 || ( fresh ) ) |
|
1298 { // save WPA settings, too, into same transaction... |
|
1299 iWpaSecSettings->SaveL( wlanid, *iDb->Database(), |
|
1300 savetype, oldwlanid ); |
|
1301 } |
|
1302 break; |
|
1303 } |
|
1304 case EWpa: |
|
1305 case EWpa2: |
|
1306 { |
|
1307 |
|
1308 if ( !iWpaSecSettings ) |
|
1309 { |
|
1310 iWpaSecSettings = |
|
1311 CWPASecuritySettings::NewL( ESecurityModeWpa ); |
|
1312 fresh = ETrue; |
|
1313 iWpaSecSettings->LoadL( oldwlanid, |
|
1314 *Database()->Database() ); |
|
1315 } |
|
1316 |
|
1317 if ( ( iWpaUiExitReason & CWPASecuritySettings::EValid ) |
|
1318 || ( fresh ) ) |
|
1319 { // save WPA settings, too, into same transaction... |
|
1320 iWpaSecSettings->SaveL( wlanid, *iDb->Database(), |
|
1321 savetype, oldwlanid ); |
|
1322 } |
|
1323 break; |
|
1324 } |
|
1325 default: |
|
1326 { |
|
1327 __ASSERT_DEBUG( EFalse, Panic( EUnknownCase ) ); |
|
1328 // do nothing in urel |
|
1329 break; |
|
1330 } |
|
1331 } |
|
1332 } |
|
1333 APSETUILOGGER_LEAVEFN( EModel,"Model::WriteWlanL") |
|
1334 } |
|
1335 |
|
1336 |
|
1337 |
1138 |
1338 |
1139 |
1339 |
1140 // --------------------------------------------------------- |
1340 // --------------------------------------------------------- |
1141 // CApSettingsModel::LoadWlanL |
1341 // CApSettingsModel::LoadWlanL |
1142 // --------------------------------------------------------- |
1342 // --------------------------------------------------------- |
1143 // |
1343 // |
1144 void CApSettingsModel::LoadWlanL( CApAccessPointItem& aApItem ) |
1344 void CApSettingsModel::LoadWlanL( CApAccessPointItem& aApItem ) |
1145 { |
1345 { |
1146 APSETUILOGGER_ENTERFN( EModel,"Model::LoadWlanL - ERROR: not supported") |
1346 APSETUILOGGER_ENTERFN( EModel,"Model::LoadWlanL") |
1147 aApItem; |
1347 // now check if it is WLAN and handle security savings... |
1148 User::Leave( KErrNotSupported ); |
1348 if ( aApItem.BearerTypeL() == EApBearerTypeWLAN ) |
1149 } |
1349 { // it is WLAN... |
|
1350 // now check if it is WEP... |
|
1351 // read up security mode |
|
1352 TUint32 secmode( 0 ); |
|
1353 aApItem.ReadUint( EApWlanSecurityMode, secmode ); |
|
1354 switch ( secmode ) |
|
1355 { |
|
1356 case EOpen: |
|
1357 { |
|
1358 break; |
|
1359 } |
|
1360 case EWep: |
|
1361 { |
|
1362 if ( !iWepSecSettings ) |
|
1363 { |
|
1364 iWepSecSettings = CWEPSecuritySettings::NewL(); |
|
1365 } |
|
1366 |
|
1367 if ( !iWepSecSettingsUi ) |
|
1368 { |
|
1369 iWepSecSettingsUi = |
|
1370 CWEPSecuritySettingsUi::NewL( *EikEnv() ); |
|
1371 } |
|
1372 TUint32 wlanid( 0 ); |
|
1373 aApItem.ReadUint( EApIapServiceId, wlanid ); |
|
1374 iWepSecSettings->LoadL( wlanid, *Database()->Database() ); |
|
1375 break; |
|
1376 } |
|
1377 case E802_1x: |
|
1378 { |
|
1379 if ( !iWpaSecSettings ) |
|
1380 { |
|
1381 iWpaSecSettings = |
|
1382 CWPASecuritySettings::NewL( ESecurityMode8021x ); |
|
1383 } |
|
1384 |
|
1385 if ( !iWpaSecSettingsUi ) |
|
1386 { |
|
1387 iWpaSecSettingsUi = |
|
1388 CWPASecuritySettingsUi::NewL( *EikEnv() ); |
|
1389 } |
|
1390 TUint32 wlanid( 0 ); |
|
1391 aApItem.ReadUint( EApIapServiceId, wlanid ); |
|
1392 iWpaSecSettings->LoadL( wlanid, *Database()->Database() ); |
|
1393 break; |
|
1394 } |
|
1395 case EWpa: |
|
1396 case EWpa2: |
|
1397 { |
|
1398 if ( !iWpaSecSettings ) |
|
1399 { |
|
1400 iWpaSecSettings = |
|
1401 CWPASecuritySettings::NewL( ESecurityModeWpa ); |
|
1402 } |
|
1403 |
|
1404 if ( !iWpaSecSettingsUi ) |
|
1405 { |
|
1406 iWpaSecSettingsUi = |
|
1407 CWPASecuritySettingsUi::NewL( *EikEnv() ); |
|
1408 } |
|
1409 TUint32 wlanid( 0 ); |
|
1410 aApItem.ReadUint( EApIapServiceId, wlanid ); |
|
1411 iWpaSecSettings->LoadL( wlanid, *Database()->Database() ); |
|
1412 break; |
|
1413 } |
|
1414 default: |
|
1415 { |
|
1416 __ASSERT_DEBUG( EFalse, Panic( EUnknownCase ) ); |
|
1417 // do nothing in urel |
|
1418 break; |
|
1419 } |
|
1420 } |
|
1421 } |
|
1422 APSETUILOGGER_LEAVEFN( EModel,"Model::LoadWlanL") |
|
1423 } |
|
1424 |
|
1425 |
|
1426 |
1150 |
1427 |
1151 |
1428 |
1152 //---------------------------------------------------------- |
1429 //---------------------------------------------------------- |
1153 // CApSettingsModel::HasWlanSecSettingsFilledL |
1430 // CApSettingsModel::HasWlanSecSettingsFilledL |
1154 //---------------------------------------------------------- |
1431 //---------------------------------------------------------- |
1155 // |
1432 // |
1156 TBool CApSettingsModel::HasWlanSecSettingsFilledL( CApAccessPointItem& aApItem ) |
1433 TBool CApSettingsModel::HasWlanSecSettingsFilledL( CApAccessPointItem& aApItem ) |
1157 { |
1434 { |
1158 APSETUILOGGER_ENTERFN( EModel,"Model::HasWlanSecSettingsFilledL - ERROR: not supported") |
1435 APSETUILOGGER_ENTERFN( EModel,"Model::HasWlanSecSettingsFilledL") |
1159 aApItem; |
1436 TBool retval(EFalse); |
1160 return EFalse; |
1437 |
|
1438 TUint32 secmode( 0 ); |
|
1439 aApItem.ReadUint( EApWlanSecurityMode, secmode ); |
|
1440 |
|
1441 TUint32 wlanid(0); |
|
1442 aApItem.ReadUint( EApIapServiceId, wlanid ); |
|
1443 |
|
1444 TUint32 oldwlanid(wlanid); |
|
1445 |
|
1446 TUint32 wapuid = aApItem.WapUid(); |
|
1447 |
|
1448 if ( ( wapuid == KApNoneUID ) |
|
1449 || ( iUtils->BearerTypeL( wapuid ) != EApBearerTypeWLAN ) ) |
|
1450 { |
|
1451 oldwlanid = 0; |
|
1452 } |
|
1453 |
|
1454 switch ( secmode ) |
|
1455 { |
|
1456 case EOpen: |
|
1457 { |
|
1458 retval = ETrue; |
|
1459 break; |
|
1460 } |
|
1461 case EWep: |
|
1462 { |
|
1463 if ( !iWepSecSettings ) |
|
1464 { |
|
1465 iWepSecSettings = CWEPSecuritySettings::NewL(); |
|
1466 iWepSecSettings->LoadL( oldwlanid, |
|
1467 *Database()->Database() ); |
|
1468 } |
|
1469 retval = iWepSecSettings->IsValid(); |
|
1470 break; |
|
1471 } |
|
1472 case E802_1x: |
|
1473 { |
|
1474 if ( !iWpaSecSettings ) |
|
1475 { |
|
1476 iWpaSecSettings = |
|
1477 CWPASecuritySettings::NewL( ESecurityMode8021x ); |
|
1478 iWpaSecSettings->LoadL( oldwlanid, |
|
1479 *Database()->Database() ); |
|
1480 } |
|
1481 retval = iWpaSecSettings->IsValid(); |
|
1482 break; |
|
1483 } |
|
1484 case EWpa: |
|
1485 case EWpa2: |
|
1486 { |
|
1487 if ( !iWpaSecSettings ) |
|
1488 { |
|
1489 iWpaSecSettings = |
|
1490 CWPASecuritySettings::NewL( ESecurityModeWpa ); |
|
1491 iWpaSecSettings->LoadL( oldwlanid, |
|
1492 *Database()->Database() ); |
|
1493 } |
|
1494 retval = iWpaSecSettings->IsValid(); |
|
1495 break; |
|
1496 } |
|
1497 default: |
|
1498 { |
|
1499 __ASSERT_DEBUG( EFalse, Panic( EUnknownCase ) ); |
|
1500 // do nothing in urel |
|
1501 break; |
|
1502 } |
|
1503 } |
|
1504 APSETUILOGGER_LEAVEFN( EModel,"Model::HasWlanSecSettingsFilledL") |
|
1505 return retval; |
1161 } |
1506 } |
1162 |
1507 |
1163 |
1508 |
1164 //---------------------------------------------------------- |
1509 //---------------------------------------------------------- |
1165 // CApSettingsModel::UpdateSecurityModeL |
1510 // CApSettingsModel::UpdateSecurityModeL |
1166 //---------------------------------------------------------- |
1511 //---------------------------------------------------------- |
1167 // |
1512 // |
1168 void CApSettingsModel::UpdateSecurityModeL( CApAccessPointItem& aApItem ) |
1513 void CApSettingsModel::UpdateSecurityModeL( CApAccessPointItem& aApItem ) |
1169 { |
1514 { |
1170 APSETUILOGGER_ENTERFN( EModel,"Model::UpdateSecurityModeL - ERROR: not supported") |
1515 APSETUILOGGER_ENTERFN( EModel,"Model::UpdateSecurityModeL") |
1171 aApItem; |
1516 TUint32 secmode( 0 ); |
1172 User::Leave( KErrNotSupported ); |
1517 aApItem.ReadUint( EApWlanSecurityMode, secmode ); |
|
1518 |
|
1519 TUint32 wlanid(0); |
|
1520 aApItem.ReadUint( EApIapServiceId, wlanid ); |
|
1521 |
|
1522 switch ( secmode ) |
|
1523 { |
|
1524 case EOpen: |
|
1525 { |
|
1526 break; |
|
1527 } |
|
1528 case EWep: |
|
1529 { |
|
1530 if ( iWepSecSettings ) |
|
1531 { |
|
1532 delete iWepSecSettings; |
|
1533 iWepSecSettings = NULL; // to satisfy CodeScanner |
|
1534 } |
|
1535 iWepSecSettings = CWEPSecuritySettings::NewL(); |
|
1536 iWepSecSettings->LoadL( wlanid, |
|
1537 *Database()->Database() ); |
|
1538 break; |
|
1539 } |
|
1540 case E802_1x: |
|
1541 { |
|
1542 if ( iWpaSecSettings ) |
|
1543 { |
|
1544 delete iWpaSecSettings; |
|
1545 iWpaSecSettings = NULL; // to satisfy CodeScanner |
|
1546 } |
|
1547 iWpaSecSettings = |
|
1548 CWPASecuritySettings::NewL( ESecurityMode8021x ); |
|
1549 iWpaSecSettings->LoadL( wlanid, |
|
1550 *Database()->Database() ); |
|
1551 break; |
|
1552 } |
|
1553 case EWpa: |
|
1554 case EWpa2: |
|
1555 { |
|
1556 if ( iWpaSecSettings ) |
|
1557 { |
|
1558 delete iWpaSecSettings; |
|
1559 iWpaSecSettings = NULL; // to satisfy CodeScanner |
|
1560 } |
|
1561 iWpaSecSettings = |
|
1562 CWPASecuritySettings::NewL( ESecurityModeWpa ); |
|
1563 iWpaSecSettings->LoadL( wlanid, |
|
1564 *Database()->Database() ); |
|
1565 break; |
|
1566 } |
|
1567 default: |
|
1568 { |
|
1569 __ASSERT_DEBUG( EFalse, Panic( EUnknownCase ) ); |
|
1570 // do nothing in urel |
|
1571 break; |
|
1572 } |
|
1573 } |
|
1574 APSETUILOGGER_LEAVEFN( EModel,"Model::UpdateSecurityModeL") |
1173 } |
1575 } |
1174 |
1576 |
1175 // End of File |
1577 // End of File |