Skip to content

Commit

Permalink
Towards issue 595 (esnet#762)
Browse files Browse the repository at this point in the history
* Add pacing timer, bytes and blocks functions to libiperf.

* Explicitly cast to uint64_t to match return type.
  • Loading branch information
samhookecc authored and bmah888 committed Jun 28, 2018
1 parent 1859fbc commit 02e16f6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,24 @@ iperf_get_test_fqrate(struct iperf_test *ipt)
return ipt->settings->fqrate;
}

int
iperf_get_test_pacing_timer(struct iperf_test *ipt)
{
return ipt->settings->pacing_timer;
}

uint64_t
iperf_get_test_bytes(struct iperf_test *ipt)
{
return (uint64_t) ipt->settings->bytes;
}

uint64_t
iperf_get_test_blocks(struct iperf_test *ipt)
{
return (uint64_t) ipt->settings->blocks;
}

int
iperf_get_test_burst(struct iperf_test *ipt)
{
Expand Down Expand Up @@ -365,6 +383,24 @@ iperf_set_test_fqrate(struct iperf_test *ipt, uint64_t fqrate)
ipt->settings->fqrate = fqrate;
}

void
iperf_set_test_pacing_timer(struct iperf_test *ipt, int pacing_timer)
{
ipt->settings->pacing_timer = pacing_timer;
}

void
iperf_set_test_bytes(struct iperf_test *ipt, uint64_t bytes)
{
ipt->settings->bytes = (iperf_size_t) bytes;
}

void
iperf_set_test_blocks(struct iperf_test *ipt, uint64_t blocks)
{
ipt->settings->blocks = (iperf_size_t) blocks;
}

void
iperf_set_test_burst(struct iperf_test *ipt, int burst)
{
Expand Down
6 changes: 6 additions & 0 deletions src/iperf_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ int iperf_get_test_reverse( struct iperf_test* ipt );
int iperf_get_test_blksize( struct iperf_test* ipt );
FILE* iperf_get_test_outfile( struct iperf_test* ipt );
uint64_t iperf_get_test_rate( struct iperf_test* ipt );
int iperf_get_test_pacing_timer( struct iperf_test* ipt );
uint64_t iperf_get_test_bytes( struct iperf_test* ipt );
uint64_t iperf_get_test_blocks( struct iperf_test* ipt );
int iperf_get_test_burst( struct iperf_test* ipt );
int iperf_get_test_socket_bufsize( struct iperf_test* ipt );
double iperf_get_test_reporter_interval( struct iperf_test* ipt );
Expand Down Expand Up @@ -130,6 +133,9 @@ void iperf_set_test_stats_interval( struct iperf_test* ipt, double stats_interva
void iperf_set_test_state( struct iperf_test* ipt, signed char state );
void iperf_set_test_blksize( struct iperf_test* ipt, int blksize );
void iperf_set_test_rate( struct iperf_test* ipt, uint64_t rate );
void iperf_set_test_pacing_timer( struct iperf_test* ipt, int pacing_timer );
void iperf_set_test_bytes( struct iperf_test* ipt, uint64_t bytes );
void iperf_set_test_blocks( struct iperf_test* ipt, uint64_t blocks );
void iperf_set_test_burst( struct iperf_test* ipt, int burst );
void iperf_set_test_server_port( struct iperf_test* ipt, int server_port );
void iperf_set_test_socket_bufsize( struct iperf_test* ipt, int socket_bufsize );
Expand Down

0 comments on commit 02e16f6

Please sign in to comment.