Class CUDPScanner::
CSniffingSocket::OnSocketReceive()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: CSniffingSocket::CSniffingSocketNext page: CSniffingSocket::~CSniffingSocket    Show member index
Private Function
(Not Declared)
Declared in:
UDPScanner.h

'Declaration' icon -- Shortcut to top of page. Declaration

BOOL CSniffingSocket::OnSocketReceive(
    int iErrorCode);

'Description' icon -- Shortcut to top of page. Description

CSniffingSocket end

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    //First check if no error code
    if (iErrorCode)
        return TRUE;

    //Let parent proccess
    if (CICMPSocketAsync::OnSocketReceive(iErrorCode))
        //Check that this is the correct responce
        if (GetLastICMPHeader()->ucICMPType==ICMP_Unreachable &&
            GetLastIPHeader()->ulSourceAddress==m_pFather->GetTarget())
        {
            //Get the destination port
            UDPHeader aHeader;
            memcpy(&aHeader,
                   GetLastData(),
                   ICMP_DATA_SIZE);

            //Get the port
            unsigned short usPort;
            usPort=htons(aHeader.usDestinationPort);

            //Remove from list
            m_pFather->RemovePort(usPort);

            //Indicate status
            m_pFather->SocketDone(usPort,
                                  FALSE);
            //Done
            return TRUE;
        }

    //Done
    return TRUE;
}
ERROR_HANDLER_RETURN("OnSocketReceive",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CTCPPortScannerStealth  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.