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

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

BOOL CSniffingSocket::OnSocketReceive(
    int iErrorCode);

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

try
{
    char cBuffer[2000];

    //First receive the packet
    int iReceive;
    iReceive=Receive(cBuffer,
                     sizeof(cBuffer));

    //Are we stopped
    if (m_bStop)
        return FALSE;

    if (iReceive==GetErrorCode())
        return FALSE;

    //Copy the header
    IpHeader aHeader;
    memcpy(&aHeader,
           cBuffer,
           IpHeaderLength);

    //Check the data is not from us (altough someone may want to save this data)
    if (aHeader.ucProtocol==IPPROTO_TCP &&
        aHeader.ulDestinationAddress==m_pFather->GetBindInterface() &&
        aHeader.ulSourceAddress==m_pFather->GetTarget())
    {
        //Find the size of IP header (may have options)
        unsigned long ulHeaderSize;
        ulHeaderSize=(aHeader.ucHeaderLength_Version & 0x0f) << 2;

        //And check is it the scan ?
        AnalyzeTCP(cBuffer+ulHeaderSize);
    }

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

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

Class Overview Class Overview  |  Public base class CTCPPortScanner  |  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.