| CSpoofSocket:: ConstructStaticIPHeader() |

Public Function | Declared in: SpoofSocket.h

## Declaration

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

## Description

Create an IP header

## Function Body

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

        //Header length (in 32 bits)
        lpHead->HeaderLength_Version=ucHeaderLength/4 + IpVersion*16;

        //Protocol
        lpHead->Protocol=ucProtocol;

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

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

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

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

        //Precedence
        lpHead->TypeOfService=IpService_ROUTINE;

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

## See Also

Class Overview | CSpoofBase | Hierarchy Chart

This web site was generated using Surveyor V4.50.811.1. Click here for more information. | Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.