14
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// cmdnsprobemanager.cpp
|
|
15 |
//
|
|
16 |
//
|
|
17 |
/**
|
|
18 |
@file
|
|
19 |
@internalTechnology
|
|
20 |
*/
|
|
21 |
//User include
|
|
22 |
#include "e32math.h"
|
|
23 |
#include "cmdnsprobemanager.h"
|
|
24 |
//System include
|
|
25 |
#include <mdns/ccacheentry.h>
|
|
26 |
__FLOG_STMT(_LIT8(KComponent,"MDNSServer");)
|
|
27 |
/*
|
|
28 |
* Two phase constructor
|
|
29 |
* @param aCache reference to cache
|
|
30 |
* @param aMessageHandler reference to message handler.
|
|
31 |
* @param aAutoresolveEnabled True if name conflict to be handled.
|
|
32 |
*/
|
|
33 |
CMDNSProbeManager* CMDNSProbeManager::NewL(MDNSCacheMgr& aCache,CMessageHandler& aMessageHandler,TBool aAutoResolveEnabled)
|
|
34 |
{
|
|
35 |
CMDNSProbeManager* self = CMDNSProbeManager::NewLC(aCache,aMessageHandler,aAutoResolveEnabled);
|
|
36 |
CleanupStack::Pop(self);
|
|
37 |
return self;
|
|
38 |
}
|
|
39 |
|
|
40 |
static void CleanUpCache(TAny* aAny)
|
|
41 |
{
|
|
42 |
RPointerArray <CCacheEntry> * records = static_cast < RPointerArray <CCacheEntry>* > (aAny);
|
|
43 |
records->ResetAndDestroy();
|
|
44 |
records->Close();
|
|
45 |
}
|
|
46 |
/*
|
|
47 |
* Two phase constructor
|
|
48 |
* @param aCache reference to cache
|
|
49 |
* @param aMessageHandler reference to message handler.
|
|
50 |
* @param aAutoresolveEnabled True if name conflict to be handled.
|
|
51 |
*/
|
|
52 |
CMDNSProbeManager* CMDNSProbeManager::NewLC(MDNSCacheMgr& aCache,CMessageHandler& aMessageHandler,TBool aAutoResolveEnabled)
|
|
53 |
{
|
|
54 |
CMDNSProbeManager* self = new (ELeave)CMDNSProbeManager(aCache,aMessageHandler,aAutoResolveEnabled);
|
|
55 |
CleanupStack::PushL(self);
|
|
56 |
self->ConstructL();
|
|
57 |
return self;
|
|
58 |
}
|
|
59 |
|
|
60 |
/*
|
|
61 |
* Constructor
|
|
62 |
*/
|
|
63 |
CMDNSProbeManager::CMDNSProbeManager(MDNSCacheMgr& aCache,CMessageHandler& aMessageHandler,TBool aAutoResolveEnabled)
|
|
64 |
:CTimer(CActive::EPriorityStandard),iCache(aCache),iMessageHandler(aMessageHandler),iAutoResolveEnabled(aAutoResolveEnabled)
|
|
65 |
{
|
|
66 |
CActiveScheduler::Add(this);
|
|
67 |
}
|
|
68 |
|
|
69 |
/*
|
|
70 |
* Two phase Constructor
|
|
71 |
*/
|
|
72 |
void CMDNSProbeManager::ConstructL()
|
|
73 |
{
|
|
74 |
__FLOG_OPEN(KMDNSSubsystem, KComponent);
|
|
75 |
CTimer::ConstructL();
|
|
76 |
iCurrentProbeState = EIdle;
|
|
77 |
}
|
|
78 |
/*
|
|
79 |
* Destructor
|
|
80 |
*/
|
|
81 |
CMDNSProbeManager::~CMDNSProbeManager()
|
|
82 |
{
|
|
83 |
__FLOG(_L8("CMDNSProbeManager::~CMDNSProbeManager - Entry"));
|
|
84 |
iName.Close();
|
|
85 |
iTarget.Close();
|
|
86 |
iProbeName.Close();
|
|
87 |
iProbeType.Close();
|
|
88 |
__FLOG(_L8("CMDNSProbeManager::~CMDNSProbeManager - Exit"));
|
|
89 |
__FLOG_CLOSE;
|
|
90 |
}
|
|
91 |
|
|
92 |
/*
|
|
93 |
* State machine which probe send announcement and handle conflicts
|
|
94 |
* if autoresolve enabled.
|
|
95 |
*/
|
|
96 |
void CMDNSProbeManager::RunL()
|
|
97 |
{
|
|
98 |
__FLOG(_L8("CMDNSProbeManager::RunL - Entry"));
|
|
99 |
TTime currentTime;
|
|
100 |
|
|
101 |
if(iCurrentProbeState <= EProbeComplete)
|
|
102 |
{
|
|
103 |
if(DefensiveResponseL())
|
|
104 |
{
|
|
105 |
iCurrentProbeState = EStart;
|
|
106 |
if(iAutoResolveEnabled)
|
|
107 |
{
|
|
108 |
GenerateNonConflictingName();
|
|
109 |
}
|
|
110 |
// else { }// to intimate server of failure
|
|
111 |
if(iProbeCounter >= KMaxFailures)
|
|
112 |
{
|
|
113 |
//If Probe Failure rate is greater then 15 per second, wait for
|
|
114 |
//5 seconds before probing again
|
|
115 |
iProbeCounter = 0;
|
|
116 |
After(5*1000*1000);
|
|
117 |
}
|
|
118 |
}
|
|
119 |
}
|
|
120 |
|
|
121 |
switch(iCurrentProbeState)
|
|
122 |
{
|
|
123 |
case EIdle:
|
|
124 |
break;//Do Nothing
|
|
125 |
|
|
126 |
case EStart:
|
|
127 |
{
|
|
128 |
currentTime.UniversalTime();
|
|
129 |
TInt64 randseed = currentTime.Int64();
|
|
130 |
|
|
131 |
//Random time between 0 & 250 ms
|
|
132 |
TInt delay = Math::Rand(randseed) % 250;
|
|
133 |
iCurrentProbeState = EProbeFirstUnicast;
|
|
134 |
//Convert to microsecond
|
|
135 |
|
|
136 |
After(delay*1000);
|
|
137 |
}
|
|
138 |
break;
|
|
139 |
|
|
140 |
case EProbeFirstUnicast:
|
|
141 |
{
|
|
142 |
SendProbeL(ETrue);
|
|
143 |
iCurrentProbeState = EProbeSecondUnicast;
|
|
144 |
}
|
|
145 |
break;
|
|
146 |
|
|
147 |
case EProbeSecondUnicast:
|
|
148 |
{
|
|
149 |
SendProbeL(ETrue);
|
|
150 |
iCurrentProbeState = EProbeMulticast;
|
|
151 |
}
|
|
152 |
break;
|
|
153 |
|
|
154 |
case EProbeMulticast:
|
|
155 |
{
|
|
156 |
SendProbeL(EFalse);
|
|
157 |
iCurrentProbeState = EProbeComplete;
|
|
158 |
}
|
|
159 |
break;
|
|
160 |
|
|
161 |
case EProbeComplete:
|
|
162 |
{
|
|
163 |
iCurrentProbeState = EFirstAnnouncement;
|
|
164 |
//Probe succeeded ,insert in cache
|
|
165 |
InsertInCache();
|
|
166 |
iMessageHandler.Server().SetHostNameL(iName);
|
|
167 |
After(KProbeDelay*1000);
|
|
168 |
//Some Delay ?? Required or defensive response HAS TO come within 750ms?
|
|
169 |
}
|
|
170 |
break;
|
|
171 |
|
|
172 |
case EFirstAnnouncement:
|
|
173 |
{
|
|
174 |
SendAnnouncementL();
|
|
175 |
iCurrentProbeState = ESecondAnnouncement;
|
|
176 |
//After(1000);// A Millisecond delay: Required??
|
|
177 |
}
|
|
178 |
break;
|
|
179 |
|
|
180 |
case ESecondAnnouncement:
|
|
181 |
{
|
|
182 |
SendAnnouncementL();
|
|
183 |
iCurrentProbeState = EIdle;
|
|
184 |
}
|
|
185 |
break;
|
|
186 |
}
|
|
187 |
__FLOG(_L8("CMDNSProbeManager::RunL - Exit"));
|
|
188 |
}
|
|
189 |
|
|
190 |
/*
|
|
191 |
* Handles any leave from RunL
|
|
192 |
*/
|
|
193 |
TInt CMDNSProbeManager::RunError(TInt aError)
|
|
194 |
{
|
|
195 |
__FLOG(_L8("CMDNSProbeManager::RunError - Entry Exit"));
|
|
196 |
return aError;
|
|
197 |
}
|
|
198 |
|
|
199 |
/*
|
|
200 |
* Probe host
|
|
201 |
* @param aUnicast True if unicast or else multicast.
|
|
202 |
*/
|
|
203 |
void CMDNSProbeManager::SendProbeL(TBool aUnicast)
|
|
204 |
{
|
|
205 |
__FLOG(_L8("CMDNSProbeManager::SendProbeL - Entry"));
|
|
206 |
//Construct DNS Message
|
|
207 |
CDnsMessage* message = CDnsMessage::NewL(0,ETrue);
|
|
208 |
CleanupStack::PushL(message);
|
|
209 |
|
|
210 |
//Form the Query/Question part of the message
|
|
211 |
CDnsQuestion* question = CDnsQuestion::NewL();
|
|
212 |
CleanupStack::PushL(question);
|
|
213 |
question->SetNameL(iName);
|
|
214 |
question->SetClass(EDnsClass_IN);
|
|
215 |
question->SetType(EDnsQType_Any);
|
|
216 |
if(aUnicast)
|
|
217 |
{
|
|
218 |
question->SetUnicast(ETrue);
|
|
219 |
}
|
|
220 |
|
|
221 |
//Append the Query to the Message
|
|
222 |
message->AppendQueryL(question);
|
|
223 |
|
|
224 |
|
|
225 |
//Form the Record to be filled in the Authoritative Field of the Query
|
|
226 |
switch(iType)
|
|
227 |
{
|
|
228 |
case EDnsType_A:
|
|
229 |
{
|
|
230 |
CRdTypeA* addRec = FormAddressRecordL();
|
|
231 |
//Append to the Authoritative Section
|
|
232 |
message->AppendAuthorityL(addRec);
|
|
233 |
}
|
|
234 |
break;
|
|
235 |
|
|
236 |
case EDnsType_SRV:
|
|
237 |
{
|
|
238 |
CRdTypeSrv* srvRec = FormServiceRecordL();
|
|
239 |
//Append to the Authoritative Section
|
|
240 |
message->AppendAuthorityL(srvRec);
|
|
241 |
}
|
|
242 |
|
|
243 |
break;
|
|
244 |
}
|
|
245 |
//Send the query
|
|
246 |
iMessageHandler.SendQueryL(message,*this);
|
|
247 |
|
|
248 |
CleanupStack::Pop();//question
|
|
249 |
CleanupStack::Pop();//message
|
|
250 |
__FLOG(_L8("CMDNSProbeManager::SendProbeL - Exit"));
|
|
251 |
}
|
|
252 |
|
|
253 |
|
|
254 |
/*
|
|
255 |
* Send an announcement if probing is successfull.
|
|
256 |
*/
|
|
257 |
void CMDNSProbeManager::SendAnnouncementL()
|
|
258 |
{
|
|
259 |
__FLOG(_L8("CMDNSProbeManager::SendAnnouncementL - Entry"));
|
|
260 |
RPointerArray<CCacheEntry> entries;
|
|
261 |
|
|
262 |
|
|
263 |
//An API in Cache Interface that returns a list of all Authoritative records
|
|
264 |
iCache.AuthoritativeEntriesL(entries);
|
|
265 |
|
|
266 |
for(TInt index =0; index<entries.Count();index++)
|
|
267 |
{
|
|
268 |
CCacheEntry* entry = entries[index];
|
|
269 |
//Send Announcements for all the Services we have published, and entered in Cache
|
|
270 |
CDnsMessage* message = CDnsMessage::NewL(0,EFalse);
|
|
271 |
CleanupStack::PushL(message);
|
|
272 |
|
|
273 |
TDnsHeader header(message->Header());
|
|
274 |
header.SetAuthoritative(ETrue);
|
|
275 |
message->SetHeader(header);
|
|
276 |
|
|
277 |
if(entry->AddressRecord())
|
|
278 |
message->AppendAnswerL(entry->AddressRecord()->CloneL());
|
|
279 |
if(entry->ServiceRecord())
|
|
280 |
message->AppendAnswerL(entry->ServiceRecord()->CloneL());
|
|
281 |
if(entry->PtrRecord())
|
|
282 |
message->AppendAnswerL(entry->PtrRecord()->CloneL());
|
|
283 |
if(entry->TxtRecord())
|
|
284 |
message->AppendAnswerL(entry->TxtRecord()->CloneL());
|
|
285 |
|
|
286 |
//should've been a new API sendresponse
|
|
287 |
|
|
288 |
iMessageHandler.SendQueryL(message,*this);
|
|
289 |
|
|
290 |
CleanupStack::Pop();//message
|
|
291 |
entries.ResetAndDestroy();
|
|
292 |
entries.Close();
|
|
293 |
}
|
|
294 |
__FLOG(_L8("CMDNSProbeManager::SendAnnouncementL - Exit"));
|
|
295 |
}
|
|
296 |
|
|
297 |
/*
|
|
298 |
* Returns ture hostname exists in the cache.
|
|
299 |
* True means there is already a record in the network with the same name.
|
|
300 |
*/
|
|
301 |
TBool CMDNSProbeManager::DefensiveResponseL()
|
|
302 |
{
|
|
303 |
__FLOG(_L8("CMDNSProbeManager::DefensiveResponseL - Entry"));
|
|
304 |
TBool probeFailed(EFalse);
|
|
305 |
RPointerArray <CCacheEntry> entries;
|
|
306 |
CleanupStack::PushL(TCleanupItem(TCleanupOperation(&CleanUpCache),&entries));
|
|
307 |
|
|
308 |
_LIT8(KDot,".");
|
|
309 |
TBuf8 <KMaxLength> buffer;
|
|
310 |
|
|
311 |
buffer.Copy(iName);
|
|
312 |
buffer.Append(KDot);
|
|
313 |
|
|
314 |
iCache.FindServiceL(entries,buffer,EDnsQType_Any);
|
|
315 |
|
|
316 |
if(entries.Count()>0)
|
|
317 |
{
|
|
318 |
probeFailed = ETrue;
|
|
319 |
}
|
|
320 |
|
|
321 |
CleanupStack::PopAndDestroy();
|
|
322 |
entries.ResetAndDestroy();
|
|
323 |
entries.Close();
|
|
324 |
__FLOG(_L8("CMDNSProbeManager::DefensiveResponseL - Exit"));
|
|
325 |
return probeFailed;
|
|
326 |
}
|
|
327 |
|
|
328 |
TInt CMDNSProbeManager::StartNameProbeL(const TDesC8& aHostName,TInetAddr aAddr)
|
|
329 |
{
|
|
330 |
__FLOG(_L8("CMDNSProbeManager::StartNameProbeL - Entry"));
|
|
331 |
iName.Close();
|
|
332 |
iName.CreateL(aHostName);
|
|
333 |
iProbeName.Close();
|
|
334 |
iProbeName.CreateL(KMaxLength);
|
|
335 |
iProbeName.Append(iName);
|
|
336 |
iAddr = aAddr;
|
|
337 |
iCurrentProbeState = EStart;
|
|
338 |
iType = EDnsType_A;
|
|
339 |
iMessageHandler.SetStateHostProbing(ETrue);
|
|
340 |
Schedule();
|
|
341 |
__FLOG(_L8("CMDNSProbeManager::StartNameProbeL - Exit"));
|
|
342 |
return KErrNone;
|
|
343 |
}
|
|
344 |
|
|
345 |
/*
|
|
346 |
* Start probing the service.
|
|
347 |
*/
|
|
348 |
TInt CMDNSProbeManager::StartServiceProbeL(const TDesC8& aServiceName,const TDesC8& aTargetMachine,TUint16 aPort)
|
|
349 |
{
|
|
350 |
__FLOG(_L8("CMDNSProbeManager::StartServiceProbeL - Entry"));
|
|
351 |
iName.Close();
|
|
352 |
iName.CreateL(aServiceName);
|
|
353 |
|
|
354 |
iTarget.Close();
|
|
355 |
iTarget.CreateL(aTargetMachine);
|
|
356 |
|
|
357 |
iPort = aPort;
|
|
358 |
iType = EDnsType_SRV;
|
|
359 |
|
|
360 |
iCurrentProbeState = EStart;
|
|
361 |
|
|
362 |
Schedule();
|
|
363 |
__FLOG(_L8("CMDNSProbeManager::StartServiceProbeL - Exit"));
|
|
364 |
return KErrNone;
|
|
365 |
}
|
|
366 |
|
|
367 |
|
|
368 |
/*
|
|
369 |
* Callback method
|
|
370 |
* Will be notified on successfully sending a packet to the network .
|
|
371 |
* State will be EIdle when an address is successully announced twice.
|
|
372 |
*/
|
|
373 |
void CMDNSProbeManager::OnPacketSendL(TInt /*aError*/)
|
|
374 |
{
|
|
375 |
__FLOG(_L8("CMDNSProbeManager::OnPacketSendL - Entry"));
|
|
376 |
if( iCurrentProbeState != EIdle)
|
|
377 |
{
|
|
378 |
After(KProbeDelay*1000);//Give more delay than this
|
|
379 |
return;
|
|
380 |
}
|
|
381 |
iMessageHandler.SetStateHostProbing(EFalse);
|
|
382 |
__FLOG(_L8("CMDNSProbeManager::OnPacketSendL - Exit"));
|
|
383 |
}
|
|
384 |
|
|
385 |
|
|
386 |
/*
|
|
387 |
* Create an address record
|
|
388 |
* @return returns an address record created.
|
|
389 |
*/
|
|
390 |
CRdTypeA* CMDNSProbeManager::FormAddressRecordL()
|
|
391 |
{
|
|
392 |
__FLOG(_L8("CMDNSProbeManager::FormAddressRecordL - Entry"));
|
|
393 |
CRdTypeA* addRec = CRdTypeA::NewL();
|
|
394 |
CleanupStack::PushL(addRec);
|
|
395 |
|
|
396 |
TInt dataLength(4);
|
|
397 |
|
|
398 |
addRec->SetNameL(iName);
|
|
399 |
addRec->SetType(EDnsType_A);
|
|
400 |
addRec->SetClass(EDnsClass_IN);
|
|
401 |
addRec->SetFlushBit(EFalse);
|
|
402 |
addRec->SetAddr(iAddr);
|
|
403 |
addRec->SetTtl(120);
|
|
404 |
|
|
405 |
CleanupStack::Pop();//addRec
|
|
406 |
__FLOG(_L8("CMDNSProbeManager::FormAddressRecordL - Exit"));
|
|
407 |
return addRec;
|
|
408 |
}
|
|
409 |
|
|
410 |
/*
|
|
411 |
* Create a service record
|
|
412 |
* @return retrun the newly created service record.
|
|
413 |
*/
|
|
414 |
CRdTypeSrv* CMDNSProbeManager::FormServiceRecordL()
|
|
415 |
{
|
|
416 |
__FLOG(_L8("CMDNSProbeManager::FormServiceRecordL - Entry"));
|
|
417 |
CRdTypeSrv* srvRec = CRdTypeSrv::NewL();
|
|
418 |
CleanupStack::PushL(srvRec);
|
|
419 |
|
|
420 |
srvRec->SetClass(EDnsClass_IN);
|
|
421 |
srvRec->SetFlushBit(EFalse);
|
|
422 |
srvRec->SetNameL(iName);
|
|
423 |
srvRec->SetPort(iPort);
|
|
424 |
srvRec->SetPriority(/*Default Priority*/0 );
|
|
425 |
srvRec->SetTargetL(iTarget);
|
|
426 |
srvRec->SetTtl(120*60);
|
|
427 |
srvRec->SetType(EDnsType_SRV);
|
|
428 |
srvRec->SetWeight(/*Default Weight*/ 0);
|
|
429 |
|
|
430 |
|
|
431 |
CleanupStack::Pop();//srvRec
|
|
432 |
__FLOG(_L8("CMDNSProbeManager::FormServiceRecordL - Exit"));
|
|
433 |
return srvRec;
|
|
434 |
}
|
|
435 |
|
|
436 |
void CMDNSProbeManager::InsertInCache()
|
|
437 |
{
|
|
438 |
__FLOG(_L8("CMDNSProbeManager::InsertInCache - Entry"));
|
|
439 |
TBuf8<KMaxLength> name;
|
|
440 |
_LIT8(KDot,".");
|
|
441 |
|
|
442 |
CDnsResourceData* data = NULL;
|
|
443 |
|
|
444 |
switch(iType)
|
|
445 |
{
|
|
446 |
case EDnsType_A:
|
|
447 |
{
|
|
448 |
data = FormAddressRecordL();
|
|
449 |
}
|
|
450 |
break;
|
|
451 |
|
|
452 |
case EDnsType_SRV:
|
|
453 |
{
|
|
454 |
data = FormServiceRecordL();
|
|
455 |
}
|
|
456 |
break;
|
|
457 |
|
|
458 |
}
|
|
459 |
|
|
460 |
//Append a "." at the end of the name
|
|
461 |
name.Copy(iName);
|
|
462 |
name.Append(KDot);
|
|
463 |
data->SetNameL(name);
|
|
464 |
|
|
465 |
iCache.UpdateCacheL(*data,ETrue,0/*session Id*/);
|
|
466 |
|
|
467 |
delete data;
|
|
468 |
__FLOG(_L8("CMDNSProbeManager::InsertInCache - Exit"));
|
|
469 |
}
|
|
470 |
|
|
471 |
|
|
472 |
|
|
473 |
|
|
474 |
/*
|
|
475 |
* If autoresolve enable a non conflict name will be generated using this.
|
|
476 |
* @return returns the probecount.
|
|
477 |
*/
|
|
478 |
TInt CMDNSProbeManager::GenerateNonConflictingName()
|
|
479 |
{
|
|
480 |
/*
|
|
481 |
__FLOG(_L8("CMDNSProbeManager::GenerateNonConflictingName - Entry"));
|
|
482 |
_LIT8(KDot,".");
|
|
483 |
|
|
484 |
if(iProbeCounter)
|
|
485 |
{
|
|
486 |
//From 2nd time, chop the last 3 characters
|
|
487 |
iProbeName.SetLength(iProbeName.Length() - 3);
|
|
488 |
}
|
|
489 |
|
|
490 |
++iProbeCounter;
|
|
491 |
|
|
492 |
TBuf8 <KMaxLength> newName;
|
|
493 |
newName.Append(iProbeName);
|
|
494 |
|
|
495 |
_LIT8(KOpenBrace,"(");
|
|
496 |
newName.Append(KOpenBrace);
|
|
497 |
|
|
498 |
newName.AppendNum(iProbeCounter);
|
|
499 |
|
|
500 |
_LIT8(KCloseBrace,")");
|
|
501 |
newName.Append(KCloseBrace);
|
|
502 |
|
|
503 |
iProbeName.Close();
|
|
504 |
iProbeName.Create(KMaxNameLength);
|
|
505 |
iProbeName.Append(newName);
|
|
506 |
|
|
507 |
iName.Close();
|
|
508 |
iName.Create(KMaxLength);
|
|
509 |
iName.Append(iProbeName);
|
|
510 |
|
|
511 |
iName.Append(KDot);
|
|
512 |
iName.Append(iProbeType);
|
|
513 |
|
|
514 |
__FLOG(_L8("CMDNSProbeManager::GenerateNonConflictingName - Exit"));
|
|
515 |
return iProbeCounter;
|
|
516 |
*/
|
|
517 |
//-------------------------------------------------------
|
|
518 |
__FLOG(_L8("CMDNSProbeManager::GenerateNonConflictingName- Entry"));
|
|
519 |
_LIT8(KDot,".");
|
|
520 |
|
|
521 |
++iProbeCounter;
|
|
522 |
|
|
523 |
TBuf8 <KMaxLength> newName;
|
|
524 |
|
|
525 |
iName.Close();
|
|
526 |
iName.Create(KMaxLength);
|
|
527 |
iName.Append(iProbeName);
|
|
528 |
|
|
529 |
TInt pos = iName.Locate('.');
|
|
530 |
_LIT8(KOpenBrace,"(");
|
|
531 |
newName.Append(KOpenBrace);
|
|
532 |
newName.AppendNum(iProbeCounter);
|
|
533 |
_LIT8(KCloseBrace,")");
|
|
534 |
newName.Append(KCloseBrace);
|
|
535 |
iName.Insert(pos,newName);
|
|
536 |
//ChangeDomainL(iName);
|
|
537 |
|
|
538 |
__FLOG(_L8("CMDNSProbeManager::GenerateNonConflictingName- Exit"));
|
|
539 |
return iProbeCounter;
|
|
540 |
|
|
541 |
|
|
542 |
|
|
543 |
|
|
544 |
|
|
545 |
}
|
|
546 |
|
|
547 |
/*
|
|
548 |
* Self complete the request.
|
|
549 |
*/
|
|
550 |
|
|
551 |
void CMDNSProbeManager::Schedule()
|
|
552 |
{
|
|
553 |
__FLOG(_L8("CMDNSProbeManager::Schedule - Entry"));
|
|
554 |
TRequestStatus* status(&iStatus);
|
|
555 |
*status = KRequestPending;
|
|
556 |
SetActive();
|
|
557 |
User::RequestComplete(status, KErrNone);
|
|
558 |
__FLOG(_L8("CMDNSProbeManager::Schedule - Exit"));
|
|
559 |
}
|
|
560 |
|
|
561 |
|