aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/hiperf.cc
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2021-04-30 12:26:57 +0200
committerAngelo Mantellini <angelo.mantellini@cisco.com>2021-04-30 14:54:00 +0200
commit07133ac060c2af721941f7b47c52c075df3168ba (patch)
treea3a618442fc9f1adb5f1cf2e3d442c70fd787d2b /utils/src/hiperf.cc
parent39e15ebb3805efb6c71a1dd16f18061cd86487cf (diff)
[HICN-703] Update windows-sdk and hicn code
Signed-off-by: Angelo Mantellini <@ngelo.mantellini@cisco.com> Change-Id: I05e4c92ce7de3640f0272afae127e1377862bd3e Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Diffstat (limited to 'utils/src/hiperf.cc')
-rw-r--r--utils/src/hiperf.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index 203c2acb9..9a1cf6236 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -65,14 +65,14 @@ inline uint64_t _ntohll(const uint64_t *input) {
uint64_t return_val;
uint8_t *tmp = (uint8_t *)&return_val;
- tmp[0] = *input >> 56;
- tmp[1] = *input >> 48;
- tmp[2] = *input >> 40;
- tmp[3] = *input >> 32;
- tmp[4] = *input >> 24;
- tmp[5] = *input >> 16;
- tmp[6] = *input >> 8;
- tmp[7] = *input >> 0;
+ tmp[0] = (uint8_t)(*input >> 56);
+ tmp[1] = (uint8_t)(*input >> 48);
+ tmp[2] = (uint8_t)(*input >> 40);
+ tmp[3] = (uint8_t)(*input >> 32);
+ tmp[4] = (uint8_t)(*input >> 24);
+ tmp[5] = (uint8_t)(*input >> 16);
+ tmp[6] = (uint8_t)(*input >> 8);
+ tmp[7] = (uint8_t)(*input >> 0);
return return_val;
}
@@ -302,7 +302,7 @@ class HIperfClient {
return;
}
- received_bytes_ += (payload->length() - 12);
+ received_bytes_ += (uint32_t)(payload->length() - 12);
received_data_pkt_++;
// collecting delay stats. Just for performance testing
@@ -479,8 +479,8 @@ class HIperfClient {
old_bytes_recovered_value_ = stats.getBytesRecoveredData();
old_fec_interest_tx_value_ = stats.getInterestFecTxCount();
old_fec_data_rx_value_ = stats.getBytesFecRecv();
- old_retx_value_ = stats.getRetxCount();
- old_sent_int_value_ = stats.getInterestTx();
+ old_retx_value_ = (uint32_t)stats.getRetxCount();
+ old_sent_int_value_ = (uint32_t)stats.getInterestTx();
old_received_nacks_value_ = stats.getReceivedNacks();
delay_sample_ = 0;
avg_data_delay_ = 0;
@@ -1127,7 +1127,7 @@ class HIperfServer {
std::memcpy(payload->writableData(), &now, sizeof(uint64_t));
- if (packet_len > payload->length()) packet_len = payload->length();
+ if (packet_len > payload->length()) packet_len = (uint32_t)payload->length();
if (packet_len > 1400) packet_len = 1400;
producer_socket_->produceDatagram(flow_name_, payload->data(), packet_len);
@@ -1268,8 +1268,9 @@ class HIperfServer {
asio::posix::stream_descriptor input_;
asio::streambuf input_buffer_;
bool rtc_running_;
- core::Name flow_name_;
+
#endif
+ core::Name flow_name_;
}; // namespace interface
void usage() {