aboutsummaryrefslogtreecommitdiff
path: root/src/tcp_info.c
diff options
context:
space:
mode:
authorBrian Tierney <bltierney@es.net>2009-11-16 01:58:22 +0000
committerBrian Tierney <bltierney@es.net>2009-11-16 01:58:22 +0000
commit01a5081d5156eacb420c4385c5cd006c7c80278b (patch)
treeac527d06044680cec19a79f6a4954bff6b6c0436 /src/tcp_info.c
parent5ed85b8fa1f77135eae55f29b3669c6342972ee6 (diff)
downloadiperf3-01a5081d5156eacb420c4385c5cd006c7c80278b.tar.gz
working on fixing TCP_INFO, in progress
Diffstat (limited to 'src/tcp_info.c')
-rw-r--r--src/tcp_info.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tcp_info.c b/src/tcp_info.c
index 33b35c1..1fdce5c 100644
--- a/src/tcp_info.c
+++ b/src/tcp_info.c
@@ -34,20 +34,16 @@ get_tcpinfo(struct iperf_test *test, struct iperf_interval_results *rp)
{
#if defined(linux) || defined(__FreeBSD__)
socklen_t tcp_info_length;
- struct tcp_info tcpInfo;
struct iperf_stream *sp = test->streams;
- tcp_info_length = sizeof(tcpInfo);
- memset((char *)&tcpInfo, 0, tcp_info_length);
+ tcp_info_length = sizeof(struct tcp_info);
//printf("getting TCP_INFO for socket %d \n", sp->socket);
- if (getsockopt(sp->socket, IPPROTO_TCP, TCP_INFO, (void *)&tcpInfo, &tcp_info_length) < 0) {
+ if (getsockopt(sp->socket, IPPROTO_TCP, TCP_INFO, (void *)&rp->tcpInfo, &tcp_info_length) < 0) {
perror("getsockopt");
}
- memcpy(&(rp->tcpInfo), &tcpInfo, sizeof(tcpInfo));
- /* for debugging
+ /* for debugging */
printf(" got TCP_INFO: %d, %d, %d, %d\n", rp->tcpInfo.tcpi_snd_cwnd,
rp->tcpInfo.tcpi_snd_ssthresh, rp->tcpInfo.tcpi_rcv_space, rp->tcpInfo.tcpi_rtt);
- */
return;
#else
return;
@@ -75,6 +71,7 @@ print_tcpinfo(struct iperf_interval_results *r)
void
build_tcpinfo_message(struct iperf_interval_results *r, char *message)
{
+ printf("in build_tcpinfo_message \n");
#if defined(linux)
sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, r->tcpInfo.tcpi_snd_ssthresh,
r->tcpInfo.tcpi_rcv_ssthresh, r->tcpInfo.tcpi_unacked, r->tcpInfo.tcpi_sacked,
@@ -87,3 +84,4 @@ build_tcpinfo_message(struct iperf_interval_results *r, char *message)
#endif
}
+