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

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

BOOL SendInformation(
    IP aDestinationAddress,
    BOOL bReply,
    unsigned short usIdentifier,
    unsigned short usSequence);

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

try
{
    //Create the header
    LPICMPHeader lpHead;
    lpHead=ConstructICMP();

    if (!lpHead)
    {
        //Report it
        ReportError("SendInformation","Failed to construct ICMP header!");

        //Exit
        return FALSE;
    }

    //Check if echo or reply
    if (bReply)
        lpHead->ucICMPType=ICMP_Information_Reply;
    else
        lpHead->ucICMPType=ICMP_Information;

    lpHead->ucICMPCode=0;
    lpHead->sICMP.sUS.us1=htons(usIdentifier);
    lpHead->sICMP.sUS.us2=htons(usSequence);

    //And the checksum
    //Using only first 8 bytes
    lpHead->usICMPChecksum=CalculateChecksum((unsigned short*)lpHead,
                                             ICMP_Information_SIZE);

    //Send it
    BOOL bSend;
    bSend=SendICMP(lpHead,
                   aDestinationAddress);

    //Exit
    return bSend;
}
ERROR_HANDLER_RETURN("SendInformation",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.