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 *************/
|
/************** Getter routines for some fields inside iperf_test *************/
|
||||||
|
|
||||||
|
int
|
||||||
|
iperf_get_control_socket( struct iperf_test* ipt )
|
||||||
|
{
|
||||||
|
return ipt->ctrl_sck;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
iperf_get_test_duration( struct iperf_test* ipt )
|
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 *************/
|
/************** 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
|
void
|
||||||
iperf_set_test_duration( struct iperf_test* ipt, int duration )
|
iperf_set_test_duration( struct iperf_test* ipt, int duration )
|
||||||
{
|
{
|
||||||
|
@ -44,6 +44,7 @@ struct iperf_stream;
|
|||||||
#define SERVER_ERROR (-2)
|
#define SERVER_ERROR (-2)
|
||||||
|
|
||||||
/* Getter routines for some fields inside iperf_test. */
|
/* 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 );
|
int iperf_get_test_duration( struct iperf_test* ipt );
|
||||||
char iperf_get_test_role( struct iperf_test* ipt );
|
char iperf_get_test_role( struct iperf_test* ipt );
|
||||||
int iperf_get_test_blksize( 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 );
|
int iperf_get_test_protocol_id( struct iperf_test* ipt );
|
||||||
|
|
||||||
/* Setter routines for some fields inside iperf_test. */
|
/* 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_duration( struct iperf_test* ipt, int duration );
|
||||||
void iperf_set_test_reporter_interval( struct iperf_test* ipt, double reporter_interval );
|
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 );
|
void iperf_set_test_stats_interval( struct iperf_test* ipt, double stats_interval );
|
||||||
|
@ -136,6 +136,7 @@ iperf_connect(struct iperf_test *test)
|
|||||||
make_cookie(test->cookie);
|
make_cookie(test->cookie);
|
||||||
|
|
||||||
/* Create and connect the control channel */
|
/* Create and connect the control channel */
|
||||||
|
if (test->ctrl_sck < 0)
|
||||||
test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->server_hostname, test->server_port);
|
test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->server_hostname, test->server_port);
|
||||||
if (test->ctrl_sck < 0) {
|
if (test->ctrl_sck < 0) {
|
||||||
i_errno = IECONNECT;
|
i_errno = IECONNECT;
|
||||||
|
@ -487,4 +487,3 @@ iperf_error(char *estr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -272,4 +272,3 @@ iperf_tcp_connect(struct iperf_test *test)
|
|||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,4 +44,3 @@ int iperf_tcp_connect(struct iperf_test *);
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -45,4 +45,3 @@ int iperf_udp_init(struct iperf_test *);
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -346,4 +346,3 @@ const char warn_invalid_report[] =
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* end extern "C" */
|
} /* end extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -139,4 +139,3 @@ iperf_run(struct iperf_test * test)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,4 +280,3 @@ setnonblocking(int sock)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,4 +49,3 @@ unsigned long long ntohll(unsigned long long);
|
|||||||
#define ntohll(n) NTOHLL(n)
|
#define ntohll(n) NTOHLL(n)
|
||||||
|
|
||||||
#endif
|
#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);
|
r->tcpInfo.tcpi_rcv_space, r->tcpInfo.tcpi_snd_ssthresh, r->tcpInfo.tcpi_rtt);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,4 +122,3 @@ get_tcp_windowsize(int sock, int dir)
|
|||||||
|
|
||||||
return bufsize;
|
return bufsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,4 +8,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define IPERF_VERSION "3.0-BETA5"
|
#define IPERF_VERSION "3.0-BETA5"
|
||||||
#define IPERF_VERSION_DATE "13 Nov 2012"
|
#define IPERF_VERSION_DATE "13 Dec 2012"
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user