480 |
479 |
481 // LAN Service copy does not work so we have to copy it manually. |
480 // LAN Service copy does not work so we have to copy it manually. |
482 |
481 |
483 if ( !clientServiceRecordCopy->iRecordTag.IsNull() ) |
482 if ( !clientServiceRecordCopy->iRecordTag.IsNull() ) |
484 { |
483 { |
485 origServiceRecord->iRecordTag.SetL( clientServiceRecordCopy->iRecordTag ); |
484 origServiceRecord->iRecordTag.SetL( |
|
485 clientServiceRecordCopy->iRecordTag ); |
486 } |
486 } |
487 if ( !clientServiceRecordCopy->iRecordName.IsNull() ) |
487 if ( !clientServiceRecordCopy->iRecordName.IsNull() ) |
488 { |
488 { |
489 origServiceRecord->iRecordName.SetL( clientServiceRecordCopy->iRecordName ); |
489 origServiceRecord->iRecordName.SetL( |
|
490 clientServiceRecordCopy->iRecordName ); |
490 } |
491 } |
491 if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() ) |
492 if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() ) |
492 { |
493 { |
493 origServiceRecord->iServiceEnableLlmnr.SetL( clientServiceRecordCopy->iServiceEnableLlmnr ); |
494 origServiceRecord->iServiceEnableLlmnr.SetL( |
|
495 clientServiceRecordCopy->iServiceEnableLlmnr ); |
494 } |
496 } |
495 if ( !clientServiceRecordCopy->iIfNetworks.IsNull() ) |
497 if ( !clientServiceRecordCopy->iIfNetworks.IsNull() ) |
496 { |
498 { |
497 origServiceRecord->iIfNetworks.SetL( clientServiceRecordCopy->iIfNetworks ); |
499 origServiceRecord->iIfNetworks.SetL( |
|
500 clientServiceRecordCopy->iIfNetworks ); |
498 } |
501 } |
499 if ( !clientServiceRecordCopy->iIpNetmask.IsNull() ) |
502 if ( !clientServiceRecordCopy->iIpNetmask.IsNull() ) |
500 { |
503 { |
501 origServiceRecord->iIpNetmask.SetL( clientServiceRecordCopy->iIpNetmask ); |
504 origServiceRecord->iIpNetmask.SetL( |
|
505 clientServiceRecordCopy->iIpNetmask ); |
502 } |
506 } |
503 if ( !clientServiceRecordCopy->iIpGateway.IsNull() ) |
507 if ( !clientServiceRecordCopy->iIpGateway.IsNull() ) |
504 { |
508 { |
505 origServiceRecord->iIpGateway.SetL( clientServiceRecordCopy->iIpGateway ); |
509 origServiceRecord->iIpGateway.SetL( |
|
510 clientServiceRecordCopy->iIpGateway ); |
506 } |
511 } |
507 if ( !clientServiceRecordCopy->iIpAddrFromServer.IsNull() ) |
512 if ( !clientServiceRecordCopy->iIpAddrFromServer.IsNull() ) |
508 { |
513 { |
509 origServiceRecord->iIpAddrFromServer.SetL( clientServiceRecordCopy->iIpAddrFromServer ); |
514 origServiceRecord->iIpAddrFromServer.SetL( |
|
515 clientServiceRecordCopy->iIpAddrFromServer ); |
510 } |
516 } |
511 if ( !clientServiceRecordCopy->iIpAddr.IsNull() ) |
517 if ( !clientServiceRecordCopy->iIpAddr.IsNull() ) |
512 { |
518 { |
513 origServiceRecord->iIpAddr.SetL( clientServiceRecordCopy->iIpAddr ); |
519 origServiceRecord->iIpAddr.SetL( |
|
520 clientServiceRecordCopy->iIpAddr ); |
514 } |
521 } |
515 if ( !clientServiceRecordCopy->iIpDnsAddrFromServer.IsNull() ) |
522 if ( !clientServiceRecordCopy->iIpDnsAddrFromServer.IsNull() ) |
516 { |
523 { |
517 origServiceRecord->iIpDnsAddrFromServer.SetL( clientServiceRecordCopy->iIpDnsAddrFromServer ); |
524 origServiceRecord->iIpDnsAddrFromServer.SetL( |
|
525 clientServiceRecordCopy->iIpDnsAddrFromServer ); |
518 } |
526 } |
519 if ( !clientServiceRecordCopy->iIpNameServer1.IsNull() ) |
527 if ( !clientServiceRecordCopy->iIpNameServer1.IsNull() ) |
520 { |
528 { |
521 origServiceRecord->iIpNameServer1.SetL( clientServiceRecordCopy->iIpNameServer1 ); |
529 origServiceRecord->iIpNameServer1.SetL( |
|
530 clientServiceRecordCopy->iIpNameServer1 ); |
522 } |
531 } |
523 if ( !clientServiceRecordCopy->iIpNameServer2.IsNull() ) |
532 if ( !clientServiceRecordCopy->iIpNameServer2.IsNull() ) |
524 { |
533 { |
525 origServiceRecord->iIpNameServer2.SetL( clientServiceRecordCopy->iIpNameServer2 ); |
534 origServiceRecord->iIpNameServer2.SetL( |
|
535 clientServiceRecordCopy->iIpNameServer2 ); |
526 } |
536 } |
527 if ( !clientServiceRecordCopy->iIp6DnsAddrFromServer.IsNull() ) |
537 if ( !clientServiceRecordCopy->iIp6DnsAddrFromServer.IsNull() ) |
528 { |
538 { |
529 origServiceRecord->iIp6DnsAddrFromServer.SetL( clientServiceRecordCopy->iIp6DnsAddrFromServer ); |
539 origServiceRecord->iIp6DnsAddrFromServer.SetL( |
|
540 clientServiceRecordCopy->iIp6DnsAddrFromServer ); |
530 } |
541 } |
531 if ( !clientServiceRecordCopy->iIp6NameServer1.IsNull() ) |
542 if ( !clientServiceRecordCopy->iIp6NameServer1.IsNull() ) |
532 { |
543 { |
533 origServiceRecord->iIp6NameServer1.SetL( clientServiceRecordCopy->iIp6NameServer1 ); |
544 origServiceRecord->iIp6NameServer1.SetL( |
|
545 clientServiceRecordCopy->iIp6NameServer1 ); |
534 } |
546 } |
535 if ( !clientServiceRecordCopy->iIp6NameServer2.IsNull() ) |
547 if ( !clientServiceRecordCopy->iIp6NameServer2.IsNull() ) |
536 { |
548 { |
537 origServiceRecord->iIp6NameServer2.SetL( clientServiceRecordCopy->iIp6NameServer2 ); |
549 origServiceRecord->iIp6NameServer2.SetL( |
|
550 clientServiceRecordCopy->iIp6NameServer2 ); |
538 } |
551 } |
539 if ( !clientServiceRecordCopy->iIpAddrLeaseValidFrom.IsNull() ) |
552 if ( !clientServiceRecordCopy->iIpAddrLeaseValidFrom.IsNull() ) |
540 { |
553 { |
541 origServiceRecord->iIpAddrLeaseValidFrom.SetL( clientServiceRecordCopy->iIpAddrLeaseValidFrom ); |
554 origServiceRecord->iIpAddrLeaseValidFrom.SetL( |
|
555 clientServiceRecordCopy->iIpAddrLeaseValidFrom ); |
542 } |
556 } |
543 if ( !clientServiceRecordCopy->iIpAddrLeaseValidTo.IsNull() ) |
557 if ( !clientServiceRecordCopy->iIpAddrLeaseValidTo.IsNull() ) |
544 { |
558 { |
545 origServiceRecord->iIpAddrLeaseValidTo.SetL( clientServiceRecordCopy->iIpAddrLeaseValidTo ); |
559 origServiceRecord->iIpAddrLeaseValidTo.SetL( |
|
560 clientServiceRecordCopy->iIpAddrLeaseValidTo ); |
546 } |
561 } |
547 if ( !clientServiceRecordCopy->iConfigDaemonManagerName.IsNull() ) |
562 if ( !clientServiceRecordCopy->iConfigDaemonManagerName.IsNull() ) |
548 { |
563 { |
549 origServiceRecord->iConfigDaemonManagerName.SetL( clientServiceRecordCopy->iConfigDaemonManagerName ); |
564 origServiceRecord->iConfigDaemonManagerName.SetL( |
|
565 clientServiceRecordCopy->iConfigDaemonManagerName ); |
550 } |
566 } |
551 if ( !clientServiceRecordCopy->iConfigDaemonName.IsNull() ) |
567 if ( !clientServiceRecordCopy->iConfigDaemonName.IsNull() ) |
552 { |
568 { |
553 origServiceRecord->iConfigDaemonName.SetL( clientServiceRecordCopy->iConfigDaemonName ); |
569 origServiceRecord->iConfigDaemonName.SetL( |
|
570 clientServiceRecordCopy->iConfigDaemonName ); |
554 } |
571 } |
555 if ( !clientServiceRecordCopy->iServiceExtensionTableName.IsNull() ) |
572 if ( !clientServiceRecordCopy->iServiceExtensionTableName.IsNull() ) |
556 { |
573 { |
557 origServiceRecord->iServiceExtensionTableName.SetL( clientServiceRecordCopy->iServiceExtensionTableName ); |
574 origServiceRecord->iServiceExtensionTableName.SetL( |
|
575 clientServiceRecordCopy->iServiceExtensionTableName ); |
558 } |
576 } |
559 if ( !clientServiceRecordCopy->iServiceExtensionTableRecordId.IsNull() ) |
577 if ( !clientServiceRecordCopy->iServiceExtensionTableRecordId.IsNull() ) |
560 { |
578 { |
561 origServiceRecord->iServiceExtensionTableRecordId.SetL( clientServiceRecordCopy->iServiceExtensionTableRecordId ); //TODO, check this works ok. |
579 origServiceRecord->iServiceExtensionTableRecordId.SetL( |
|
580 clientServiceRecordCopy->iServiceExtensionTableRecordId ); //TODO, check this works ok. |
562 } |
581 } |
563 |
582 |
564 origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() ); |
583 origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() ); |
565 |
584 |
566 if ( !origServiceRecord->RecordId() ) |
585 if ( !origServiceRecord->RecordId() ) |
584 // --------------------------------------------------------------------------- |
603 // --------------------------------------------------------------------------- |
585 // |
604 // |
586 void CCmPluginLan::CreateBearerRecordsL() |
605 void CCmPluginLan::CreateBearerRecordsL() |
587 { |
606 { |
588 OstTraceFunctionEntry0( CCMPLUGINLAN_CREATEBEARERRECORDSL_ENTRY ); |
607 OstTraceFunctionEntry0( CCMPLUGINLAN_CREATEBEARERRECORDSL_ENTRY ); |
589 |
|
590 OstTraceFunctionExit0( CCMPLUGINLAN_CREATEBEARERRECORDSL_EXIT ); |
608 OstTraceFunctionExit0( CCMPLUGINLAN_CREATEBEARERRECORDSL_EXIT ); |
591 } |
609 } |
592 |
610 |
593 // -------------------------------------------------------------------------- |
611 // -------------------------------------------------------------------------- |
594 // CCmPluginLan::LoadBearerRecordsL |
612 // CCmPluginLan::LoadBearerRecordsL |
595 // -------------------------------------------------------------------------- |
613 // -------------------------------------------------------------------------- |
596 // |
614 // |
597 void CCmPluginLan::LoadBearerRecordsL() |
615 void CCmPluginLan::LoadBearerRecordsL() |
598 { |
616 { |
599 OstTraceFunctionEntry0( CCMPLUGINLAN_LOADBEARERRECORDSL_ENTRY ); |
617 OstTraceFunctionEntry0( CCMPLUGINLAN_LOADBEARERRECORDSL_ENTRY ); |
600 |
|
601 OstTraceFunctionExit0( CCMPLUGINLAN_LOADBEARERRECORDSL_EXIT ); |
618 OstTraceFunctionExit0( CCMPLUGINLAN_LOADBEARERRECORDSL_EXIT ); |
602 } |
619 } |
603 |
620 |
604 // --------------------------------------------------------------------------- |
621 // --------------------------------------------------------------------------- |
605 // CCmPluginLan::ServiceRecord() |
622 // CCmPluginLan::ServiceRecord() |
640 // CCmPluginLan::BearerRecordIdL() |
657 // CCmPluginLan::BearerRecordIdL() |
641 // --------------------------------------------------------------------------- |
658 // --------------------------------------------------------------------------- |
642 // |
659 // |
643 void CCmPluginLan::BearerRecordIdL( TUint32& aRecordId ) |
660 void CCmPluginLan::BearerRecordIdL( TUint32& aRecordId ) |
644 { |
661 { |
645 CCDLANBearerRecord* lanBearerRecord = static_cast<CCDLANBearerRecord*> |
662 CCDLANBearerRecord* lanBearerRecord = static_cast<CCDLANBearerRecord*>( |
646 (CCDRecordBase::RecordFactoryL( KCDTIdLANBearerRecord )); |
663 CCDRecordBase::RecordFactoryL( KCDTIdLANBearerRecord ) ); |
647 CleanupStack::PushL( lanBearerRecord ); |
664 CleanupStack::PushL( lanBearerRecord ); |
648 |
665 |
649 lanBearerRecord->iRecordName.SetL( TPtrC( KLanBearerName ) ); |
666 lanBearerRecord->iRecordName.SetL( TPtrC( KLanBearerName ) ); |
650 if ( !lanBearerRecord->FindL( iSession ) ) |
667 if ( !lanBearerRecord->FindL( iSession ) ) |
651 { // bearer not found -> create dummy values |
668 { // Bearer not found -> create dummy values. |
652 lanBearerRecord->SetRecordId( KCDNewRecordRequest ); |
669 lanBearerRecord->SetRecordId( KCDNewRecordRequest ); |
653 lanBearerRecord->iBearerAgent = KLanBearerAgent; |
670 lanBearerRecord->iBearerAgent = KLanBearerAgent; |
654 lanBearerRecord->iRecordName = KLanBearerName; |
671 lanBearerRecord->iRecordName = KLanBearerName; |
655 lanBearerRecord->iLanBearerNifName = KLanBearerNif; |
672 lanBearerRecord->iLanBearerNifName = KLanBearerNif; |
656 |
673 |
657 lanBearerRecord->iLanBearerLddFilename = KLanLDDFileName; |
674 lanBearerRecord->iLanBearerLddFilename = KLanLDDFileName; |
658 lanBearerRecord->iLanBearerLddName = KLanLDDName; |
675 lanBearerRecord->iLanBearerLddName = KLanLDDName; |
659 lanBearerRecord->iLanBearerPddFilename = KLanPDDFileName; |
676 lanBearerRecord->iLanBearerPddFilename = KLanPDDFileName; |
660 lanBearerRecord->iLanBearerPddName = KLanPDDName; |
677 lanBearerRecord->iLanBearerPddName = KLanPDDName; |
661 lanBearerRecord->iLanBearerPacketDriverName = KLanPacketDriverName; |
678 lanBearerRecord->iLanBearerPacketDriverName = KLanPacketDriverName; |
662 lanBearerRecord->iLastSocketActivityTimeout = |
679 lanBearerRecord->iLastSocketActivityTimeout = (TUint32)KLanLastSocketActivityTimeout; |
663 (TUint32)KLanLastSocketActivityTimeout; |
680 lanBearerRecord->iLastSessionClosedTimeout = (TUint32)KLanLastSessionClosedTimeout; |
664 lanBearerRecord->iLastSessionClosedTimeout = |
681 lanBearerRecord->iLastSocketClosedTimeout = (TUint32)KLanLastSocketClosedTimeout; |
665 (TUint32)KLanLastSessionClosedTimeout; |
|
666 lanBearerRecord->iLastSocketClosedTimeout = |
|
667 (TUint32)KLanLastSocketClosedTimeout; |
|
668 |
682 |
669 lanBearerRecord->StoreL( iSession ); |
683 lanBearerRecord->StoreL( iSession ); |
670 } |
684 } |
671 |
685 |
672 aRecordId = lanBearerRecord->RecordId(); |
686 aRecordId = lanBearerRecord->RecordId(); |
733 // --------------------------------------------------------------------------- |
747 // --------------------------------------------------------------------------- |
734 // CCmPluginLan::SetDaemonNameL |
748 // CCmPluginLan::SetDaemonNameL |
735 // --------------------------------------------------------------------------- |
749 // --------------------------------------------------------------------------- |
736 // |
750 // |
737 void CCmPluginLan::SetDaemonNameL( |
751 void CCmPluginLan::SetDaemonNameL( |
738 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
752 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
739 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) |
753 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) |
740 { |
754 { |
741 OstTraceFunctionEntry0( CCMPLUGINLAN_SETDAEMONNAMEL_ENTRY ); |
755 OstTraceFunctionEntry0( CCMPLUGINLAN_SETDAEMONNAMEL_ENTRY ); |
742 |
756 |
743 // we have to check first that these values has not been |
757 // We have to check first that these values have not been set (or changed) |
744 // set(or changed) by any 3rd party sw to ensure that |
758 // by any 3rd party SW to ensure that we don't break their settings. |
745 // we don't break their settings |
759 HBufC* daemonName = GetBearerStringAttributeL( |
746 HBufC* daemonName = GetBearerStringAttributeL( ECmConfigDaemonManagerName, |
760 ECmConfigDaemonManagerName, |
747 aGenRecordArray, |
761 aGenRecordArray, |
748 aBearerSpecRecordArray ); |
762 aBearerSpecRecordArray ); |
749 if ( daemonName ) |
763 if ( daemonName ) |
750 { |
764 { |
751 if ( daemonName->Compare( KDaemonManagerName ) != 0 ) |
765 if ( daemonName->Compare( KDaemonManagerName ) != 0 ) |
752 { |
766 { |
753 delete daemonName; |
767 delete daemonName; |
756 return; |
770 return; |
757 } |
771 } |
758 delete daemonName; |
772 delete daemonName; |
759 } |
773 } |
760 |
774 |
761 // use DHCP if we can |
775 // Use DHCP if we can. |
762 TBool ipfromSrv = GetBearerBoolAttributeL( ECmIPAddFromServer, |
776 TBool ipfromSrv = GetBearerBoolAttributeL( |
763 aGenRecordArray, |
777 ECmIPAddFromServer, |
764 aBearerSpecRecordArray ); |
778 aGenRecordArray, |
|
779 aBearerSpecRecordArray ); |
765 if ( ipfromSrv ) |
780 if ( ipfromSrv ) |
766 { |
781 { |
767 SetBearerStringAttributeL( ECmConfigDaemonManagerName, |
782 SetBearerStringAttributeL( |
768 KDaemonManagerName, |
783 ECmConfigDaemonManagerName, |
769 aGenRecordArray, |
784 KDaemonManagerName, |
770 aBearerSpecRecordArray ); |
785 aGenRecordArray, |
771 |
786 aBearerSpecRecordArray ); |
772 SetBearerStringAttributeL( ECmConfigDaemonName, |
787 SetBearerStringAttributeL(ECmConfigDaemonName, |
773 KConfigDaemonName, |
788 KConfigDaemonName, |
774 aGenRecordArray, |
789 aGenRecordArray, |
775 aBearerSpecRecordArray ); |
790 aBearerSpecRecordArray ); |
776 |
|
777 } |
791 } |
778 else |
792 else |
779 { |
793 { |
780 if ( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) |
794 if ( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) |
781 { |
795 { |
782 SetBearerStringAttributeL( ECmConfigDaemonManagerName, |
796 SetBearerStringAttributeL( |
783 KDaemonManagerName, |
797 ECmConfigDaemonManagerName, |
784 aGenRecordArray, |
798 KDaemonManagerName, |
785 aBearerSpecRecordArray ); |
799 aGenRecordArray, |
786 |
800 aBearerSpecRecordArray ); |
787 SetBearerStringAttributeL( ECmConfigDaemonName, |
801 SetBearerStringAttributeL( |
788 KConfigDaemonName, |
802 ECmConfigDaemonName, |
789 aGenRecordArray, |
803 KConfigDaemonName, |
790 aBearerSpecRecordArray ); |
804 aGenRecordArray, |
|
805 aBearerSpecRecordArray ); |
791 } |
806 } |
792 else |
807 else |
793 { |
808 { |
794 SetBearerStringAttributeL( ECmConfigDaemonManagerName, |
809 SetBearerStringAttributeL( |
795 KNullDesC(), |
810 ECmConfigDaemonManagerName, |
796 aGenRecordArray, |
811 KNullDesC(), |
797 aBearerSpecRecordArray ); |
812 aGenRecordArray, |
798 |
813 aBearerSpecRecordArray ); |
799 SetBearerStringAttributeL( ECmConfigDaemonName, |
814 SetBearerStringAttributeL( |
800 KNullDesC(), |
815 ECmConfigDaemonName, |
801 aGenRecordArray, |
816 KNullDesC(), |
802 aBearerSpecRecordArray ); |
817 aGenRecordArray, |
803 } |
818 aBearerSpecRecordArray ); |
804 } |
819 } |
|
820 } |
|
821 |
805 OstTraceFunctionExit0( DUP1_CCMPLUGINLAN_SETDAEMONNAMEL_EXIT ); |
822 OstTraceFunctionExit0( DUP1_CCMPLUGINLAN_SETDAEMONNAMEL_EXIT ); |
806 } |
823 } |
807 |
824 |
808 // -------------------------------------------------------------------------- |
825 // -------------------------------------------------------------------------- |
809 // CCmPluginLan::GetBearerIntAttributeL |
826 // CCmPluginLan::GetBearerIntAttributeL |