Table of Contents

Name

thrulay_open - setup a thrulay test.

Synopsis

#include <thrulay.h>

int thrulay_open(thrulay_traffic_type_t traffic, void * setting);

Description

thrulay_open registers a TCP or UDP thrulay test in the global registry. Connections between the client and server are also setup. thrulay_get_setup can be called later to get setup information of a stream. traffic is the intended test traffic type:

THRULAY_TCP
Run a thrulay test by sending TCP traffic between the client and server. setting should be a pointer to the thrulay_setting_tcp_t structure:

typedef struct _thrulay_setting_tcp {
    char *server_name; /* Where to send test traffic. */
    int server_port; /* Server listen port number. */
    int test_duration; /* For how long to send packet. */
    int report_interval; /* How often to report progress. */
    int window_size; /* TCP Window size, in bytes. */
    int block_size; /* TCP send block size, in bytes.*/
    int nstream; /* Number of paralle streams. */
    int tos; /* Type of service setting. */
} thrulay_setting_tcp_t;

THRULAY_UDP
Run a thrulay test by sending UDP traffic from the client to the server. setting should be a pointer to the thrulay_setting_udp_t structure:

typedef struct _thrulay_setting_udp {
    char *server_name; /* Where to send test traffic. */
    int server_port; /* Server listen port number. */
    int test_duration; /* For how long to send packet. */
    int udp_buffer_size; /* Size of client UDP send buffer.*/
    int packet_size; /* Size of a single UDP packet. */
    int nstream; /* Number of paralle test streams.*/
    int tos; /* Type of service setting. */
    u_int64_t rate; /* For how fast to send a packet. */
    thrulay_wait_type_t wt; /* How to wait before sending. */
} thrulay_setting_udp_t;

Return Values

On success, it returns a positive integer, test id (tid), which is an index to the corresponding registry entry. Otherwise, an error code is returned.

Examples

Setup a TCP test.

int tid;
thrulay_setting_tcp_t setting_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 = 2;

tid = thrulay_open(THRULAY_TCP, &setting_tcp);

Bugs

Please send bug reports to <huadongliu@gmail.com>.

Author

Huadong Liu <huadongliu@gmail.com>

Homepage

http://thrulay-hd.sourceforge.net/

See Also

thrulay_close(3) thrulay_get_setup(3)


Table of Contents