int thrulay_get_setup(int tid, int sid, void * setup);
typedef struct _thrulay_setup_tcp {
int fd_tcp; /* Socket fd of TCP connection. */
int window_size_local; /* Local TCP window size. */
int window_size_remote; /* Server side TCP window size. */
int block_size; /* Negotiated TCP block size. */
int mtu; /* Path MTU of the current socket. */
int mss; /* Maximum segment size for outgoing TCP packets. */
} thrulay_setup_tcp_t;
If the test was registered as an UDP test, setup should be a pointer to the thrulay_setup_udp_t structure:
typedef struct
_thrulay_setup_udp {
int fd_tcp; /* Socket fd of the TCP channel.*/
int fd_udp; /* Socket fd of the UDP channel.*/
int port_udp_server; /* Server side UDP port number. */
int packet_size; /* Negotiated UDP pacet size, in bytes. */
double ps; /* Sending rate of pacekts per second. */
u_int64_t npackets; /* Negotiated number of packet to send. */
char nonce[8]; /* Passport for packets to be accepted. */
} thrulay_setup_udp_t;
int tid, mss,
rc;
thrulay_setting_tcp_t setting_tcp;
thrulay_setup_tcp_t setup_tcp;
thrulay_init();
setting_tcp.server_name = "nmsa-aami.internet2.edu";
setting_tcp.port = 5003;
setting_tcp.test_duration = 5;
setting_tcp.report_interval = 1;
setting_tcp.nstream = 3;
tid = thrulay_open(THRULAY_TCP, &setting_tcp);
if (tid > 0) {
rc = thrulay_get_setup(tid, &setup_tcp);
if (rc == 0) mss = setup_tcp.mss;
}