Class CSpoofSocket::
ConstructStaticIPHeader()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ConstructIPHeaderNext page: Create    Show member index
Public Function Declared in:
SpoofSocket.h

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

static LPIpHeader ConstructStaticIPHeader(
    unsigned char ucProtocol,
    unsigned short usFragmentationFlags,
    unsigned char ucTTL,
    unsigned short usIdentification,
    unsigned char ucHeaderLength);

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

Create an IP header

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

try
{
    //Need to construct the IP header
    LPIpHeader lpHead=new _IpHeader;

    //Header length (in 32 bits)
    lpHead->ucHeaderLength_Version=(ucHeaderLength >> 2) |
                                   (IpVersion << 4);

    //Protocol
    lpHead->ucProtocol=ucProtocol;

    //Fragmentation flags
    lpHead->usFragmentationFlags=htons(usFragmentationFlags);

    //Time to live
    lpHead->ucTTL=ucTTL;

    //Checksum - set to 0
    lpHead->usChecksum=0;

    //Identification
    lpHead->usIdentification=htons(usIdentification);

    //Precedence
    lpHead->ucTypeOfService=IpService_ROUTINE;

    //Return IP to user
    return lpHead;
}
ERROR_HANDLER_STATIC_RETURN(CSpoofSocket_LOGNAME,"ConstructIPHeader",NULL)

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

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