Skip to content

Commit

Permalink
Add ToS Byte to iperf API (esnet#719)
Browse files Browse the repository at this point in the history
* Add ToS byte to iperf API

* Add function prototype to manual page
  • Loading branch information
quartoxuna authored and bmah888 committed Mar 23, 2018
1 parent 4fe72e1 commit c0a4417
Show file tree
Hide file tree
Showing 3 changed files with 15 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 @@ -290,6 +290,12 @@ iperf_get_test_one_off(struct iperf_test *ipt)
return ipt->one_off;
}

int
iperf_get_test_tos(struct iperf_test *ipt)
{
return ipt->settings->tos;
}

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

void
Expand Down Expand Up @@ -467,6 +473,12 @@ iperf_set_test_one_off(struct iperf_test *ipt, int one_off)
ipt->one_off = one_off;
}

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

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

struct protocol *
Expand Down
2 changes: 2 additions & 0 deletions src/iperf_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ int iperf_get_test_get_server_output( struct iperf_test* ipt );
char* iperf_get_test_bind_address ( struct iperf_test* ipt );
int iperf_get_test_udp_counters_64bit( struct iperf_test* ipt );
int iperf_get_test_one_off( struct iperf_test* ipt );
int iperf_get_test_tos( struct iperf_test* ipt );

/* Setter routines for some fields inside iperf_test. */
void iperf_set_verbose( struct iperf_test* ipt, int verbose );
Expand All @@ -141,6 +142,7 @@ void iperf_set_test_get_server_output( struct iperf_test* ipt, int get_server_ou
void iperf_set_test_bind_address( struct iperf_test* ipt, char *bind_address );
void iperf_set_test_udp_counters_64bit( struct iperf_test* ipt, int udp_counters_64bit );
void iperf_set_test_one_off( struct iperf_test* ipt, int one_off );
void iperf_set_test_tos( struct iperf_test* ipt, int tos );

/**
* exchange_parameters - handles the param_Exchange part for client
Expand Down
1 change: 1 addition & 0 deletions src/libiperf.3
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Setting test parameters:
void iperf_set_test_json_output( struct iperf_test *t, int json_output );
int iperf_has_zerocopy( void );
void iperf_set_test_zerocopy( struct iperf_test* t, int zerocopy );
void iperf_set_test_tos( struct iperf_test* t, int tos );
.fi
Running a test:
.nf
Expand Down

0 comments on commit c0a4417

Please sign in to comment.