475 |
476 |
476 // Client's copy of lan service record. |
477 // Client's copy of lan service record. |
477 CCDLANServiceRecord* clientServiceRecordCopy = |
478 CCDLANServiceRecord* clientServiceRecordCopy = |
478 static_cast<CCDLANServiceRecord*>( aGenRecordArray[KServiceRecordIndex] ); |
479 static_cast<CCDLANServiceRecord*>( aGenRecordArray[KServiceRecordIndex] ); |
479 |
480 |
480 // LAN Service copy does not work so we have to copy it manually. |
481 CopyRecordFieldsL( *clientServiceRecordCopy, *origServiceRecord ); |
481 |
|
482 if ( !clientServiceRecordCopy->iRecordTag.IsNull() ) |
|
483 { |
|
484 origServiceRecord->iRecordTag.SetL( |
|
485 clientServiceRecordCopy->iRecordTag ); |
|
486 } |
|
487 if ( !clientServiceRecordCopy->iRecordName.IsNull() ) |
|
488 { |
|
489 origServiceRecord->iRecordName.SetL( |
|
490 clientServiceRecordCopy->iRecordName ); |
|
491 } |
|
492 if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() ) |
|
493 { |
|
494 origServiceRecord->iServiceEnableLlmnr.SetL( |
|
495 clientServiceRecordCopy->iServiceEnableLlmnr ); |
|
496 } |
|
497 if ( !clientServiceRecordCopy->iIfNetworks.IsNull() ) |
|
498 { |
|
499 origServiceRecord->iIfNetworks.SetL( |
|
500 clientServiceRecordCopy->iIfNetworks ); |
|
501 } |
|
502 if ( !clientServiceRecordCopy->iIpNetmask.IsNull() ) |
|
503 { |
|
504 origServiceRecord->iIpNetmask.SetL( |
|
505 clientServiceRecordCopy->iIpNetmask ); |
|
506 } |
|
507 if ( !clientServiceRecordCopy->iIpGateway.IsNull() ) |
|
508 { |
|
509 origServiceRecord->iIpGateway.SetL( |
|
510 clientServiceRecordCopy->iIpGateway ); |
|
511 } |
|
512 if ( !clientServiceRecordCopy->iIpAddrFromServer.IsNull() ) |
|
513 { |
|
514 origServiceRecord->iIpAddrFromServer.SetL( |
|
515 clientServiceRecordCopy->iIpAddrFromServer ); |
|
516 } |
|
517 if ( !clientServiceRecordCopy->iIpAddr.IsNull() ) |
|
518 { |
|
519 origServiceRecord->iIpAddr.SetL( |
|
520 clientServiceRecordCopy->iIpAddr ); |
|
521 } |
|
522 if ( !clientServiceRecordCopy->iIpDnsAddrFromServer.IsNull() ) |
|
523 { |
|
524 origServiceRecord->iIpDnsAddrFromServer.SetL( |
|
525 clientServiceRecordCopy->iIpDnsAddrFromServer ); |
|
526 } |
|
527 if ( !clientServiceRecordCopy->iIpNameServer1.IsNull() ) |
|
528 { |
|
529 origServiceRecord->iIpNameServer1.SetL( |
|
530 clientServiceRecordCopy->iIpNameServer1 ); |
|
531 } |
|
532 if ( !clientServiceRecordCopy->iIpNameServer2.IsNull() ) |
|
533 { |
|
534 origServiceRecord->iIpNameServer2.SetL( |
|
535 clientServiceRecordCopy->iIpNameServer2 ); |
|
536 } |
|
537 if ( !clientServiceRecordCopy->iIp6DnsAddrFromServer.IsNull() ) |
|
538 { |
|
539 origServiceRecord->iIp6DnsAddrFromServer.SetL( |
|
540 clientServiceRecordCopy->iIp6DnsAddrFromServer ); |
|
541 } |
|
542 if ( !clientServiceRecordCopy->iIp6NameServer1.IsNull() ) |
|
543 { |
|
544 origServiceRecord->iIp6NameServer1.SetL( |
|
545 clientServiceRecordCopy->iIp6NameServer1 ); |
|
546 } |
|
547 if ( !clientServiceRecordCopy->iIp6NameServer2.IsNull() ) |
|
548 { |
|
549 origServiceRecord->iIp6NameServer2.SetL( |
|
550 clientServiceRecordCopy->iIp6NameServer2 ); |
|
551 } |
|
552 if ( !clientServiceRecordCopy->iIpAddrLeaseValidFrom.IsNull() ) |
|
553 { |
|
554 origServiceRecord->iIpAddrLeaseValidFrom.SetL( |
|
555 clientServiceRecordCopy->iIpAddrLeaseValidFrom ); |
|
556 } |
|
557 if ( !clientServiceRecordCopy->iIpAddrLeaseValidTo.IsNull() ) |
|
558 { |
|
559 origServiceRecord->iIpAddrLeaseValidTo.SetL( |
|
560 clientServiceRecordCopy->iIpAddrLeaseValidTo ); |
|
561 } |
|
562 if ( !clientServiceRecordCopy->iConfigDaemonManagerName.IsNull() ) |
|
563 { |
|
564 origServiceRecord->iConfigDaemonManagerName.SetL( |
|
565 clientServiceRecordCopy->iConfigDaemonManagerName ); |
|
566 } |
|
567 if ( !clientServiceRecordCopy->iConfigDaemonName.IsNull() ) |
|
568 { |
|
569 origServiceRecord->iConfigDaemonName.SetL( |
|
570 clientServiceRecordCopy->iConfigDaemonName ); |
|
571 } |
|
572 if ( !clientServiceRecordCopy->iServiceExtensionTableName.IsNull() ) |
|
573 { |
|
574 origServiceRecord->iServiceExtensionTableName.SetL( |
|
575 clientServiceRecordCopy->iServiceExtensionTableName ); |
|
576 } |
|
577 if ( !clientServiceRecordCopy->iServiceExtensionTableRecordId.IsNull() ) |
|
578 { |
|
579 origServiceRecord->iServiceExtensionTableRecordId.SetL( |
|
580 clientServiceRecordCopy->iServiceExtensionTableRecordId ); //TODO, check this works ok. |
|
581 } |
|
582 |
482 |
583 origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() ); |
483 origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() ); |
584 |
484 |
585 if ( !origServiceRecord->RecordId() ) |
485 if ( !origServiceRecord->RecordId() ) |
586 { |
486 { |
587 origServiceRecord->SetRecordId( KCDNewRecordRequest ); |
487 origServiceRecord->SetRecordId( KCDNewRecordRequest ); |
588 origServiceRecord->StoreL( iSession ); |
488 origServiceRecord->StoreL( iSession ); |
589 |
489 |
|
490 // Have to be "reloaded" to get possible default values from template records. |
|
491 origServiceRecord->LoadL( iSession ); |
|
492 |
590 // Update received element ID to client's copy too. |
493 // Update received element ID to client's copy too. |
591 clientServiceRecordCopy->SetElementId( origServiceRecord->ElementId() ); |
494 clientServiceRecordCopy->SetElementId( origServiceRecord->ElementId() ); |
592 } |
495 } |
593 else |
496 else |
594 { |
497 { |
595 origServiceRecord->ModifyL( iSession ); |
498 origServiceRecord->ModifyL( iSession ); |
596 } |
499 } |
|
500 |
|
501 CCmPluginBaseEng::CopyRecordFieldsL( *origServiceRecord, |
|
502 *clientServiceRecordCopy ); |
597 |
503 |
598 OstTraceFunctionExit0( CCMPLUGINLAN_UPDATESERVICERECORDL_EXIT ); |
504 OstTraceFunctionExit0( CCMPLUGINLAN_UPDATESERVICERECORDL_EXIT ); |
599 } |
505 } |
600 |
506 |
601 // --------------------------------------------------------------------------- |
507 // --------------------------------------------------------------------------- |