Logo Search packages:      
Sourcecode: paris-traceroute version File versions  Download package

void TCPHeader::pack ( uint8 *  data,
int  length,
int  offset 
) [virtual]

Copy this TCP header at offset offset in the array data.

data The destination array
length The length of the destination array (in bytes).
offset The offset where the header has to be copied
TrException There isn't enough place in the array data to hold the header

Implements Header.

Definition at line 274 of file TCPHeader.cc.

  uint8* ptr = data + offset;

  // Check if the data structure can contain the TCP header
  if (offset + 20 > length)
    throw TrException(str_log(ERROR, "Not enough space in data array"));

  // Copy the header
  memcpy(ptr, header, 20);

Generated by  Doxygen 1.6.0   Back to index