Allow API client to provide an fd for the client-side control socket.
Этот коммит содержится в:
родитель
5cd3317d98
Коммит
d7613a8e9f
@ -79,6 +79,12 @@ void warning(char *str)
|
||||
|
||||
/************** Getter routines for some fields inside iperf_test *************/
|
||||
|
||||
int
|
||||
iperf_get_control_socket( struct iperf_test* ipt )
|
||||
{
|
||||
return ipt->ctrl_sck;
|
||||
}
|
||||
|
||||
int
|
||||
iperf_get_test_duration( struct iperf_test* ipt )
|
||||
{
|
||||
@ -147,6 +153,12 @@ iperf_get_test_protocol_id( struct iperf_test* ipt )
|
||||
|
||||
/************** Setter routines for some fields inside iperf_test *************/
|
||||
|
||||
void
|
||||
iperf_set_control_socket( struct iperf_test* ipt, int ctrl_sck )
|
||||
{
|
||||
ipt->ctrl_sck = ctrl_sck;
|
||||
}
|
||||
|
||||
void
|
||||
iperf_set_test_duration( struct iperf_test* ipt, int duration )
|
||||
{
|
||||
|
@ -44,6 +44,7 @@ struct iperf_stream;
|
||||
#define SERVER_ERROR (-2)
|
||||
|
||||
/* Getter routines for some fields inside iperf_test. */
|
||||
int iperf_get_control_socket( struct iperf_test* ipt );
|
||||
int iperf_get_test_duration( struct iperf_test* ipt );
|
||||
char iperf_get_test_role( struct iperf_test* ipt );
|
||||
int iperf_get_test_blksize( struct iperf_test* ipt );
|
||||
@ -57,6 +58,7 @@ char* iperf_get_test_server_hostname( struct iperf_test* ipt );
|
||||
int iperf_get_test_protocol_id( struct iperf_test* ipt );
|
||||
|
||||
/* Setter routines for some fields inside iperf_test. */
|
||||
void iperf_set_control_socket( struct iperf_test* ipt, int ctrl_sck );
|
||||
void iperf_set_test_duration( struct iperf_test* ipt, int duration );
|
||||
void iperf_set_test_reporter_interval( struct iperf_test* ipt, double reporter_interval );
|
||||
void iperf_set_test_stats_interval( struct iperf_test* ipt, double stats_interval );
|
||||
|
@ -136,7 +136,8 @@ iperf_connect(struct iperf_test *test)
|
||||
make_cookie(test->cookie);
|
||||
|
||||
/* Create and connect the control channel */
|
||||
test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->server_hostname, test->server_port);
|
||||
if (test->ctrl_sck < 0)
|
||||
test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->server_hostname, test->server_port);
|
||||
if (test->ctrl_sck < 0) {
|
||||
i_errno = IECONNECT;
|
||||
return -1;
|
||||
|
@ -487,4 +487,3 @@ iperf_error(char *estr)
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
@ -272,4 +272,3 @@ iperf_tcp_connect(struct iperf_test *test)
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -44,4 +44,3 @@ int iperf_tcp_connect(struct iperf_test *);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -45,4 +45,3 @@ int iperf_udp_init(struct iperf_test *);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -346,4 +346,3 @@ const char warn_invalid_report[] =
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
|
@ -139,4 +139,3 @@ iperf_run(struct iperf_test * test)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -280,4 +280,3 @@ setnonblocking(int sock)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -49,4 +49,3 @@ unsigned long long ntohll(unsigned long long);
|
||||
#define ntohll(n) NTOHLL(n)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -144,4 +144,3 @@ build_tcpinfo_message(struct iperf_interval_results *r, char *message)
|
||||
r->tcpInfo.tcpi_rcv_space, r->tcpInfo.tcpi_snd_ssthresh, r->tcpInfo.tcpi_rtt);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -122,4 +122,3 @@ get_tcp_windowsize(int sock, int dir)
|
||||
|
||||
return bufsize;
|
||||
}
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
*/
|
||||
|
||||
#define IPERF_VERSION "3.0-BETA5"
|
||||
#define IPERF_VERSION_DATE "13 Nov 2012"
|
||||
#define IPERF_VERSION_DATE "13 Dec 2012"
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user