diff -r bb2423252ea3 -r c1029e558ef5 tcpiputils/dnd/src/servers.cpp --- a/tcpiputils/dnd/src/servers.cpp Wed Sep 15 13:53:10 2010 +0300 +++ b/tcpiputils/dnd/src/servers.cpp Wed Oct 13 16:17:27 2010 +0300 @@ -1,3 +1,4 @@ +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -35,7 +36,6 @@ public: TName iName; //< Name of the interface TUint32 iScope[16]; //< The scope vector - RInetSuffixList iSuffixList;//< Structure to hold the interface specific domain search list }; // Item of the configured servers list @@ -70,10 +70,6 @@ TInt BuildServerList(); void AddServerAddress(const TName &aInterface, const TInetAddr &aAddr); void LockByAddress(const TInetAddr &aAddr, TUint32 aNid, TDnsServerFilter &aFilter); - // Retrieves the domain search list configured on the interface associated with the nominated name server - void InterfaceSuffixList(TInt aServerId, RInetSuffixList& aSuffixList); - // Performs the network id selection for the query based on the domain name on the query - void UpdateDomain(TDnsServerFilter &aFilter) const; private: // Build and add interface entry to the list (basic operation) @@ -97,9 +93,6 @@ CArrayFixFlat *iServerList; //< Current list of servers CArrayFixFlat *iInterfaceList; //< Current list of interfaces CArrayFixFlat *iConfiguredList; //< Current list of configured servers - -private: - TInt AddInterfaceEntry(const TSoInetIfQuery &aInfo, RSocket& aSocket); }; @@ -147,44 +140,18 @@ delete iConfiguredList; } -// CDnsServerManager::AddInterfaceEntry -TInt CDnsServerManager::AddInterfaceEntry(const TSoInetIfQuery &aInfo, RSocket& aSocket) +// CDnsServerManager::AddInterfaceData +TInt CDnsServerManager::AddInterfaceEntry(const TSoInetIfQuery &aInfo) { - TRAPD(err, - TDnsInterfaceData &ifd = iInterfaceList->ExtendL(); - - ifd.iName = aInfo.iName; - for (TInt i = sizeof(ifd.iScope) / sizeof(ifd.iScope[0]); --i >= 0; ) - ifd.iScope[i] = aInfo.iZone[i]; - - if (aSocket.SetOpt(KSoInetEnumDomainSuffix, KSolInetIfCtrl) == KErrNone) - { - ifd.iSuffixList.Reset(); - TInetSuffix data; - TPckg opt(data); - while (aSocket.GetOpt(KSoInetNextDomainSuffix, KSolInetIfCtrl, opt) == KErrNone) - { - TSuffixName tmpBuf; - tmpBuf.Copy(opt().iSuffixName); - ifd.iSuffixList.AppendL(tmpBuf); - } - } + TRAPD(err, + TDnsInterfaceData &ifd = iInterfaceList->ExtendL(); + ifd.iName = aInfo.iName; + for (TInt i = sizeof(ifd.iScope) / sizeof(ifd.iScope[0]); --i >= 0; ) + ifd.iScope[i] = aInfo.iZone[i]; ); - return err < 0 ? err : iInterfaceList->Count() - 1; } -TInt CDnsServerManager::AddInterfaceEntry(const TSoInetIfQuery &aInfo) - { - TRAPD(err, - TDnsInterfaceData &ifd = iInterfaceList->ExtendL(); - ifd.iName = aInfo.iName; - for (TInt i = sizeof(ifd.iScope) / sizeof(ifd.iScope[0]); --i >= 0; ) - ifd.iScope[i] = aInfo.iZone[i]; - ); - return err < 0 ? err : iInterfaceList->Count() - 1; - } - // CDnsServerManager::AddToInterfaceList // ************************************* /** @@ -211,14 +178,13 @@ if (data.iName.Compare(aInfo.iName) == 0) return i; // Interface already present in the list } - // // A new interface, get the scope vector // TPckgBuf opt; opt().iName = aInfo.iName; const TInt err = aSocket.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, opt); - return err < 0 ? err : AddInterfaceEntry(opt(), aSocket); + return err < 0 ? err : AddInterfaceEntry(opt()); } // CDnsServerManager::FindInterface @@ -479,32 +445,6 @@ return TRUE; } -/** -// @name UpdateDomain -// @param aFilter the server filter -// @param aServer to be tested against the filter -*/ -void CDnsServerManager::UpdateDomain(TDnsServerFilter &aFilter) const - { - LOG(Log::Printf(_L("CDnsServerManager -- RHostResolver opened on implicit connection"))); - if ( aFilter.iDomainName.Length() ) - { - TBool updatedDomain(FALSE); - for (TInt i = iInterfaceList->Count(); --i >= 0 && !updatedDomain; ) - { - TDnsInterfaceData &id = iInterfaceList->At(i); - for (TInt i=0; iCount(); - for (TInt i = 0; i < N; ++i) - { - const TDnsServerData &server = iServerList->At(i); - if (server.iServerId == aServerId) - { - aSuffixList = iInterfaceList->At(server.iInterface).iSuffixList; - break; - } - } - }