Class CICMPCrafter::
CreateFinal()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ConstructIPHeaderNext page: CreateFinal    Show member index
Private Function Declared in:
ICMPCrafter.h

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

char * CreateFinal(
    unsigned char cICMP,
    unsigned char cType,
    unsigned short& usTotalSize) const;

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

Created the memory

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

try
{
    //Generic ICMP send
    LPICMPHeader lpHead;
    lpHead=ConstructICMP();

    if (!lpHead)
    {
        ReportError("CreateFinal","Failed to construct ICMP header!");
        return NULL;
    }

    //Protect it
    std::auto_ptr<ICMPHeader> pProtection(lpHead);

    //Set the data
    lpHead->ucICMPType=cICMP;
    lpHead->ucICMPCode=cType;

    //And the checksum
    lpHead->usICMPChecksum=CalculateChecksum((unsigned short*)lpHead,ICMPHeaderLength);

    //Call the final modifier
    FinalICMPHeader(lpHead);

    //And construct higher level
    return CIPCrafter::GetCraftedPacket(this,
                                        m_aDestinationAddress,
                                        (char*)lpHead,
                                        ICMPHeaderLength,
                                        usTotalSize);
}
ERROR_HANDLER_RETURN("CreateFinal",NULL)

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

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