BOOST_ASSERT( 1 <= resolved_ip_count );
- return static_cast<int> ( resolved_ip_count );
+ return static_cast<int>( resolved_ip_count );
}
/**
int TimeToLive::get_updated_value() const
{
ptime now = microsec_clock::universal_time();
- int elapsed_seconds = static_cast<int> (
+ int elapsed_seconds = static_cast<int>(
(now - TtlSetTime).total_seconds()
);
int original_ttl = get_value();
Iterator body_iter = BodyBegin;
while ( body_iter != BodyEnd )
{
- sum += (static_cast<uint8_t> ( *body_iter++ ) << 8);
+ sum += (static_cast<uint8_t>( *body_iter++ ) << 8);
if ( body_iter != BodyEnd )
- sum += static_cast<uint8_t> ( *body_iter++ );
+ sum += static_cast<uint8_t>( *body_iter++ );
}
sum = (sum >> 16) + (sum & 0xFFFF);
sum += (sum >> 16);
- uint16_t checksum = static_cast<uint16_t> ( ~sum );
+ uint16_t checksum = static_cast<uint16_t>( ~sum );
return checksum;
}
IcmpType IcmpDestinationUnreachableMessage::get_type() const
{
- IcmpType type = static_cast<IcmpType> ( Payload[ 0 ] );
+ IcmpType type = static_cast<IcmpType>( Payload[ 0 ] );
return type;
}
void IcmpDestinationUnreachableMessage::set_type( IcmpType type )
{
- uint8_t n = static_cast<uint8_t> ( type );
+ uint8_t n = static_cast<uint8_t>( type );
Payload[ 0 ] = n;
}
IcmpType IcmpEchoReplyMessage::get_type() const
{
- IcmpType type = static_cast<IcmpType> ( Payload[ 0 ] );
+ IcmpType type = static_cast<IcmpType>( Payload[ 0 ] );
return type;
}
void IcmpEchoReplyMessage::set_type( IcmpType type )
{
- uint8_t n = static_cast<uint8_t> ( type );
+ uint8_t n = static_cast<uint8_t>( type );
Payload[ 0 ] = n;
}
IcmpType IcmpEchoRequestMessage::get_type() const
{
- IcmpType type = static_cast<IcmpType> ( Payload[ 0 ] );
+ IcmpType type = static_cast<IcmpType>( Payload[ 0 ] );
return type;
}
void IcmpEchoRequestMessage::set_type( IcmpType type )
{
- uint8_t n = static_cast<uint8_t> ( type );
+ uint8_t n = static_cast<uint8_t>( type );
Payload[ 0 ] = n;
}
(void) is.putback( first_byte );
// now select the message format for the given type
- IcmpType header_type = static_cast<IcmpType> ( first_byte );
+ IcmpType header_type = static_cast<IcmpType>( first_byte );
set_icmp_message_format( header_type );
}
uint16_t Ipv4Header::get_header_length() const
{
- return static_cast<uint16_t> ( (Payload[ 0 ] & 0xF) * 4 );
+ return static_cast<uint16_t>( (Payload[ 0 ] & 0xF) * 4 );
}
uint8_t Ipv4Header::get_type_of_service() const
BOOST_ASSERT( value <= numeric_limits<uint16_t>::max() );
- return static_cast<uint16_t> ( value );
+ return static_cast<uint16_t>( value );
}
bool LinkStatusAnalyzer::exceeded_host_down_limit() const
{
- int host_down_count = static_cast<int> ( HostsDownList.size() );
+ int host_down_count = static_cast<int>( HostsDownList.size() );
return ( host_down_count > HostsDownLimit );
}
++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 = static_cast<uint16_t>( ( random() % 16383 ) + 49152 ); // same as random() % 65536;
uint16_t destination_port = 80;
TcpHeader tcp_header = create_ack_request(
source_port,