Class CTCPCrafter::
ConstructTCPHeader()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ConstructIPHeaderNext page: CTCPCrafter    Show member index
Protected Function Declared in:
TCPCrafter.h

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

virtual LPTCPHeader ConstructTCPHeader(
    int iSourcePort,
    int iDestinationPort,
    int iHeaderLength);

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

Create the TCP header

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

try
{
    //Create the initial header
    LPTCPHeader lpHead;
    lpHead=CTCPSocket::ConstructTCPHeader(iSourcePort,iDestinationPort,iHeaderLength);

    if (!lpHead)
        return NULL;

    //Overide some data
    lpHead->Windows=htons(m_Window);

    //Set the packet number
    lpHead->AcknowledgeNumber=htonl(m_AcknowledgeNumber);

    //And the sequence
    lpHead->SequenceNumber=htonl(m_SequenceNumber);

    //Data offset
    lpHead->DataOffset=m_DataOffset << 4;

    //Flags
    lpHead->Flags=m_Flags;

    //Urgent pointer
    lpHead->UrgentPointer=htons(m_UrgentPointer);

    //Return it to the user
    return lpHead;
}
ERROR_HANDLER_AMBIG_RETURN(CSpoofSocket,"ConstructTCPHeader",NULL)

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

Class Overview Class Overview  |  Public base class CTCPSocket  |  Public base class CIPCrafter  |  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 © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.