return destination_ipv4_address;
}
+uint16_t TcpPinger::get_source_port() const
+{
+ uint16_t source_port = static_cast<uint16_t>( ( random() % 16383 ) + 49152 ); // same as random() % 65536;
+
+ return source_port;
+}
+
uint16_t TcpPinger::get_destination_port() const
{
return DestinationEndpoint.port();
++SequenceNumber;
// Create an TCP header for an ACK request.
- uint16_t source_port = static_cast<uint16_t>( ( random() % 16383 ) + 49152 ); // same as random() % 65536;
+ uint16_t source_port = get_source_address();
uint16_t destination_port = get_destination_port();
TcpHeader tcp_header = create_ack_request(
source_port,
uint32_t get_source_address();
uint32_t get_destination_address() const;
+ uint16_t get_source_port() const;
uint16_t get_destination_port() const;
void set_destination_endpoint(
/// the timer of TCP segment receive, triggers the timeout to avoid infinite
/// wait
boost::asio::deadline_timer TcpSegmentReceiveTimer;
- /// ICMP packet identifier
+ /// TCP packet identifier
uint16_t Identifier;
- /// ICMP packet sequence_number
+ /// TCP packet sequence_number
uint16_t SequenceNumber;
/// the time when the last ICMP packet was sent
boost::posix_time::ptime TimeSent;