itpp::TCP_Packet Class Reference

`#include <itpp/protocol/tcp.h>`

Inheritance diagram for itpp::TCP_Packet:

## Classes

struct | TDebugInfo
| ADD DOCUMENTATION HERE. More...

## Public Member Functions

| TCP_Packet ()
| ADD DOCUMENTATION HERE.
| TCP_Packet (const TCP_Packet &packet)
| ADD DOCUMENTATION HERE.
virtual | ~TCP_Packet ()
| ADD DOCUMENTATION HERE.
virtual TCP_Packet & | clone () const
| ADD DOCUMENTATION HERE.
void | set_segment (const TCP_Segment &seg)
| ADD DOCUMENTATION HERE.
TCP_Segment | get_segment () const
| ADD DOCUMENTATION HERE.
void | set_wnd (unsigned val)
| ADD DOCUMENTATION HERE.
unsigned | get_wnd () const
| ADD DOCUMENTATION HERE.
void | set_ACK (Sequence_Number val)
| ADD DOCUMENTATION HERE.
Sequence_Number | get_ACK () const
| ADD DOCUMENTATION HERE.
void | set_session_id (int val)
| ADD DOCUMENTATION HERE.
int | get_session_id () const
| ADD DOCUMENTATION HERE.
void | set_destination_port (unsigned val)
| ADD DOCUMENTATION HERE.
unsigned | get_destination_port () const
| ADD DOCUMENTATION HERE.
void | set_source_port (unsigned val)
| ADD DOCUMENTATION HERE.
unsigned | get_source_port () const
| ADD DOCUMENTATION HERE.
void | set_info (unsigned ssThresh, unsigned recWnd, unsigned cWnd, double estRTT, Sequence_Number sndUna, Sequence_Number sndNxt, bool isRtx)
| ADD DOCUMENTATION HERE.
virtual void | print_header (std::ostream &) const
| ADD DOCUMENTATION HERE.
void | set_bit_size (int packet_size)
| set size of packet in bits
int | bit_size ()
| get size of packet in bits

## Protected Attributes

unsigned | fDestinationPort
| ADD DOCUMENTATION HERE.
unsigned | fSourcePort
| ADD DOCUMENTATION HERE.
TCP_Segment | fSegment
| data segment to be transmitted
Sequence_Number | fACK
| acknowledgment (next expected sn)
unsigned | fWnd
| window size (advertised by receiver)
int | fSessionId
| session identifier
TDebugInfo * | fInfo
| ADD DOCUMENTATION HERE.

## Friends

std::ostream & | operator<< (std::ostream &, TCP_Packet &)
| ADD DOCUMENTATION HERE.

## Detailed Description

TCP_Packet is an IP packet with additional TCP header fields. Messages of this type are used for communication between TCP sender and receiver (data and ACKs).

The class contains a segment of type TCP_Segment with sequence numbers for begin and end of the segment. This is only used in data packets (i.e. from sender to receiver) while there are also fields containing sequence number for the next expected segment (used to ACK data packets, i.e. from receiver to sender) and for the advertised receiver window.

TCP_Packet has an additional field for the session id which my be compared with the pair (source port, destination port) in a real world TCP/IP packet.

Furthermore, some debug info containing state information for TCP sender or receiver may be attached to the message.

See also
  TCP_Segment
  TCP_Packet::TDebugInfo

Author
  Grevent
  Lorang
  Bodamer

Definition at line 211 of file tcp.h.

## Member Function Documentation

## set_segment()

void itpp::TCP_Packet::set_segment | ( | const TCP_Segment & | seg | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 225 of file tcp.h.

References fSegment.

## get_segment()

TCP_Segment itpp::TCP_Packet::get_segment | ( |  | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 227 of file tcp.h.

References fSegment.

## set_wnd()

void itpp::TCP_Packet::set_wnd | ( | unsigned | val | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 229 of file tcp.h.

References fWnd.

## get_wnd()

unsigned itpp::TCP_Packet::get_wnd | ( |  | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 231 of file tcp.h.

References fWnd.

## set_ACK()

void itpp::TCP_Packet::set_ACK | ( | Sequence_Number | val | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 233 of file tcp.h.

References fACK.

## get_ACK()

Sequence_Number itpp::TCP_Packet::get_ACK | ( |  | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 235 of file tcp.h.

References fACK.

## set_session_id()

void itpp::TCP_Packet::set_session_id | ( | int | val | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 239 of file tcp.h.

References fSessionId.

## get_session_id()

int itpp::TCP_Packet::get_session_id | ( |  | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 241 of file tcp.h.

References fSessionId.

## set_destination_port()

void itpp::TCP_Packet::set_destination_port | ( | unsigned | val | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 245 of file tcp.h.

References fDestinationPort.

## get_destination_port()

unsigned itpp::TCP_Packet::get_destination_port | ( |  | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 247 of file tcp.h.

References fDestinationPort.

## set_source_port()

void itpp::TCP_Packet::set_source_port | ( | unsigned | val | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 249 of file tcp.h.

References fSourcePort.

## get_source_port()

unsigned itpp::TCP_Packet::get_source_port | ( |  | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 251 of file tcp.h.

References fSourcePort.

## set_bit_size()

void itpp::Packet::set_bit_size | ( | int | packet_size | ) |

inlineinherited

set size of packet in bits

Definition at line 64 of file packet.h.

References it_assert.

Referenced by itpp::Packet::Packet().

## bit_size()

int itpp::Packet::bit_size | ( |  | ) |

inlineinherited

get size of packet in bits

Definition at line 67 of file packet.h.

## Member Data Documentation

## fDestinationPort

unsigned itpp::TCP_Packet::fDestinationPort

protected

ADD DOCUMENTATION HERE.

Definition at line 259 of file tcp.h.

Referenced by get_destination_port(), and set_destination_port().

## fSourcePort

unsigned itpp::TCP_Packet::fSourcePort

protected

ADD DOCUMENTATION HERE.

Definition at line 261 of file tcp.h.

Referenced by get_source_port(), and set_source_port().

## fSegment

TCP_Segment itpp::TCP_Packet::fSegment

protected

data segment to be transmitted

Definition at line 263 of file tcp.h.

Referenced by get_segment(), and set_segment().

## fACK

Sequence_Number itpp::TCP_Packet::fACK

protected

acknowledgment (next expected sn)

Definition at line 264 of file tcp.h.

Referenced by get_ACK(), and set_ACK().

## fWnd

unsigned itpp::TCP_Packet::fWnd

protected

window size (advertised by receiver)

Definition at line 265 of file tcp.h.

Referenced by get_wnd(), and set_wnd().

## fSessionId

int itpp::TCP_Packet::fSessionId

protected

session identifier

Definition at line 266 of file tcp.h.

Referenced by get_session_id(), and set_session_id().

## fInfo

TDebugInfo* itpp::TCP_Packet::fInfo

protected

ADD DOCUMENTATION HERE.

Definition at line 282 of file tcp.h.

The documentation for this class was generated from the following file:

- itpp/protocol/tcp.h

Generated on Mon Jun 10 2024 11:49:41 for IT++ by Doxygen 1.9.8