Skip to content

Commit

Permalink
API functions added for -F, -r, -a, -K, sent-bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
hanvari committed Jul 3, 2021
1 parent e3b3440 commit 844ba8c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,12 @@ iperf_get_test_congestion_control(struct iperf_test* ipt)
return ipt->congestion;
}

uint64_t
iperf_get_test_bytes_sent(struct iperf_test* ipt)
{
return ipt->bytes_sent;
}

/************** Setter routines for some fields inside iperf_test *************/

void
Expand Down Expand Up @@ -767,6 +773,30 @@ iperf_set_test_congestion_control(struct iperf_test* ipt, char* cc)
ipt->congestion = strdup(cc);
}

void
iperf_set_test_file(struct iperf_test* ipt, char* file)
{
ipt->diskfile_name = strdup(file);
}

void
iperf_set_test_snd_fileseek(struct iperf_test* ipt, int seek)
{
ipt->diskfile_seek = seek;
}

void
iperf_set_test_rcv_fileappend(struct iperf_test* ipt, int append)
{
ipt->diskfile_append = append;
}

void
iperf_set_test_rcv_reliable(struct iperf_test* ipt, int reliable)
{
ipt->reliable_receive_in_full = reliable;
}


/********************** Get/set test protocol structure ***********************/

Expand Down
5 changes: 5 additions & 0 deletions src/iperf_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ int iperf_get_test_no_delay( struct iperf_test* ipt );
int iperf_get_test_connect_timeout( struct iperf_test* ipt );
int iperf_get_dont_fragment( struct iperf_test* ipt );
char* iperf_get_test_congestion_control(struct iperf_test* ipt);
uint64_t iperf_get_test_bytes_sent(struct iperf_test* ipt);

/* Setter routines for some fields inside iperf_test. */
void iperf_set_verbose( struct iperf_test* ipt, int verbose );
Expand Down Expand Up @@ -186,6 +187,10 @@ void iperf_set_test_bidirectional( struct iperf_test* ipt, int bidirectional)
void iperf_set_test_no_delay( struct iperf_test* ipt, int no_delay);
void iperf_set_dont_fragment( struct iperf_test* ipt, int dont_fragment );
void iperf_set_test_congestion_control(struct iperf_test* ipt, char* cc);
void iperf_set_test_file(struct iperf_test* ipt, char* file);
void iperf_set_test_snd_fileseek(struct iperf_test* ipt, int seek);
void iperf_set_test_rcv_fileappend(struct iperf_test* ipt, int append);
void iperf_set_test_rcv_reliable(struct iperf_test* ipt, int reliable);

#if defined(HAVE_SSL)
void iperf_set_test_client_username(struct iperf_test *ipt, const char *client_username);
Expand Down

0 comments on commit 844ba8c

Please sign in to comment.