Skip to content

Commit

Permalink
API interface for setting/getting congestion control (esnet#1036) (es…
Browse files Browse the repository at this point in the history
…net#1112)

Same restrictions/compatibility applies as
the CLI -C/--congestion options.
(Linux and FreeBSD only)

Fixes esnet#1036
  • Loading branch information
hanvari committed Jul 3, 2021
1 parent ff93e56 commit c98e8f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ iperf_get_test_idle_timeout(struct iperf_test *ipt)
return ipt->settings->idle_timeout;
}

char*
iperf_get_test_congestion_control(struct iperf_test* ipt)
{
return ipt->congestion;
}

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

void
Expand Down Expand Up @@ -731,6 +737,12 @@ iperf_set_test_idle_timeout(struct iperf_test* ipt, int to)
ipt->settings->idle_timeout = to;
}

void
iperf_set_test_congestion_control(struct iperf_test* ipt, char* cc)
{
ipt->congestion = strdup(cc);
}


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

Expand Down
2 changes: 2 additions & 0 deletions src/iperf_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ char* iperf_get_extra_data( struct iperf_test* ipt );
char* iperf_get_iperf_version(void);
int iperf_get_test_no_delay( struct iperf_test* ipt );
int iperf_get_test_connect_timeout( struct iperf_test* ipt );
char* iperf_get_test_congestion_control(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 @@ -177,6 +178,7 @@ void iperf_set_test_tos( struct iperf_test* ipt, int tos );
void iperf_set_test_extra_data( struct iperf_test* ipt, const char *dat );
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_test_congestion_control(struct iperf_test* ipt, char* cc);

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

0 comments on commit c98e8f9

Please sign in to comment.