![]() |
TraceRoute() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: RealTimeTraceRouteSocket.h |
virtual BOOL TraceRoute( IP aDestinationAddress, DWORD dwTimeout);
try { if (!m_bTraceDone || !m_bInitialized || m_bFinishing || m_bPartialDone) return FALSE; //Trace not done m_bTraceDone=FALSE; m_bPartialDone=FALSE; m_bFinishing=FALSE; //Save the address m_aTracedAddress=aDestinationAddress; //Clear the data for (int iCounter=0;iCounter<=mhMaxHops;++iCounter) { //Clear the data m_aData[iCounter].aReplyingAddress=0; m_aData[iCounter].ucTTL=0; m_aData[iCounter].dwElapsedTime=0; m_aData[iCounter].pDNS=m_pManager; m_aData[iCounter].bResolved=FALSE; m_aData[iCounter].bTarget=FALSE; m_aData[iCounter].bFinal=FALSE; m_aData[iCounter].lpUserData=NULL; //The CSection std::auto_ptr<CGenericCriticalSection> pProtection(COSManager::CreateCriticalSection()); //Save it m_aData[iCounter].pCSection=pProtection; } m_ucMaxHOP=0; m_ucMinHOP=mhMaxHops; //Set the last hops data //Do we have DNS m_aData[mhMaxHops].bTarget=TRUE; //No resolvers m_ulResolvers=0; //We need our port start m_usPortStart=GetPortStart(); //Send the pings for (int iPings=0;iPings<3;++iPings) for (int iCounter=1; iCounter<=mhMaxHops; ++iCounter) { //Set the TTL SetTTL(iCounter); //Set the ID SetID(iCounter); //Set the sequence SetSequence(m_usPortStart); //And ping if (!Ping(aDestinationAddress, 0)) { //Indicate we are done m_bTraceDone=TRUE; //Call user TraceDone(TRUE); //Exit return FALSE; } } //Set the timeout SetTimeout(dwTimeout); //Do we have DNS if (m_bResolveIPs) { //Set the resolvers AdjustResolvers(1); //Create the data ResolveThreadData* pThreadData; pThreadData=new ResolveThreadData; //Populate it pThreadData->pClass=this; pThreadData->pData=&m_aData[mhMaxHops]; //DNS lookup for the host //Add the reverse DNS m_pManager->GetThreadManager()->SubmitJob(ResolveData,(LPVOID)pThreadData); } //Done return TRUE; } ERROR_HANDLER_RETURN("TraceRoute",FALSE)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |