![]() |
ConstructTCPHeader() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Protected Function |
Declared in: TCPCrafter.h |
Declaration
virtual LPTCPHeader ConstructTCPHeader(
unsigned short usSourcePort,
unsigned short usDestinationPort,
unsigned char ucHeaderLength) const;
DescriptionCreate the TCP header
Function Body
try
{
//Create the initial header
LPTCPHeader lpHead;
lpHead=CTCPSocket::ConstructTCPHeader(usSourcePort,
usDestinationPort,
ucHeaderLength);
if (!lpHead)
{
//Report it
ReportError("ConstructTCPHeader","Received null TCP header!");
//Exit
return NULL;
}
//Overide some data
lpHead->usWindows=htons(m_usWindow);
//Set the packet number
lpHead->ulAcknowledgeNumber=htonl(m_uiAcknowledgeNumber);
//And the sequence
lpHead->ulSequenceNumber=htonl(m_uiSequenceNumber);
//Data offset
lpHead->ucDataOffset=m_ucDataOffset << 4;
//Flags
lpHead->ucFlags=m_ucFlags;
//Urgent pointer
lpHead->usUrgentPointer=htons(m_usUrgentPointer);
//Return it to the user
return lpHead;
}
ERROR_HANDLER_RETURN("ConstructTCPHeader",NULL)
See Also
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. |