Class CICMPSocket::
SendICMP()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SendICMPNext page: SendInformation    Show member index
Protected Function Declared in:
ICMPSocket.h

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

BOOL SendICMP(
    LPICMPHeader lpHead,
    IP aDestinationAddress);

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

try
{
    //Our buffer to send
    char* pSendBuffer;

    //Size of the buffer to send
    int iSendSize;
    iSendSize=ICMPHeaderLength;

    //Do we have an external buffer ?
    if (!m_pSendBuffer)
        pSendBuffer=(char*)lpHead;
    else
    {
        iSendSize+=m_usBufferSendSize;
        pSendBuffer=new char[m_usBufferSendSize];

        //Copy the data
        memcpy(pSendBuffer,
               (char*)lpHead,
               ICMPHeaderLength);
        memcpy(pSendBuffer+ICMPHeaderLength,
               m_pSendBuffer,
               m_usBufferSendSize);
    }

    //Send to modify before send
    FinalICMPHeader((LPICMPHeader)pSendBuffer);

    //Send it
    int iResult;
    iResult=CSpoofSocket::Send(aDestinationAddress,
                               pSendBuffer,
                               iSendSize);

    if (m_pSendBuffer)
        delete [] pSendBuffer;

    //Done
    return iResult>0;
}
ERROR_HANDLER_RETURN("SendICMP",FALSE)

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

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