Annotation of embedaddon/iperf/src/iperf_api.h, revision 1.1.1.3

1.1       misho       1: /*
1.1.1.3 ! misho       2:  * iperf, Copyright (c) 2014-2022, The Regents of the University of
1.1       misho       3:  * California, through Lawrence Berkeley National Laboratory (subject
                      4:  * to receipt of any required approvals from the U.S. Dept. of
                      5:  * Energy).  All rights reserved.
                      6:  *
                      7:  * If you have questions about your rights to use or distribute this
                      8:  * software, please contact Berkeley Lab's Technology Transfer
                      9:  * Department at TTD@lbl.gov.
                     10:  *
                     11:  * NOTICE.  This software is owned by the U.S. Department of Energy.
                     12:  * As such, the U.S. Government has been granted for itself and others
                     13:  * acting on its behalf a paid-up, nonexclusive, irrevocable,
                     14:  * worldwide license in the Software to reproduce, prepare derivative
                     15:  * works, and perform publicly and display publicly.  Beginning five
                     16:  * (5) years after the date permission to assert copyright is obtained
                     17:  * from the U.S. Department of Energy, and subject to any subsequent
                     18:  * five (5) year renewals, the U.S. Government is granted for itself
                     19:  * and others acting on its behalf a paid-up, nonexclusive,
                     20:  * irrevocable, worldwide license in the Software to reproduce,
                     21:  * prepare derivative works, distribute copies to the public, perform
                     22:  * publicly and display publicly, and to permit others to do so.
                     23:  *
                     24:  * This code is distributed under a BSD style license, see the LICENSE
                     25:  * file for complete information.
                     26:  */
                     27: #ifndef        __IPERF_API_H
                     28: #define        __IPERF_API_H
                     29: 
1.1.1.2   misho      30: #include <sys/socket.h>
1.1       misho      31: #include <sys/time.h>
                     32: #include <setjmp.h>
1.1.1.2   misho      33: #include <stdio.h>
                     34: #ifdef HAVE_STDINT_H
                     35: #include <stdint.h>
                     36: #endif
                     37: #ifdef __cplusplus
                     38: extern "C" { /* open extern "C" */
                     39: #endif
                     40: 
1.1       misho      41: 
                     42: struct iperf_test;
                     43: struct iperf_stream_result;
                     44: struct iperf_interval_results;
                     45: struct iperf_stream;
1.1.1.2   misho      46: struct iperf_time;
                     47: 
                     48: #if !defined(__IPERF_H)
                     49: typedef uint64_t iperf_size_t;
                     50: #endif // __IPERF_H
1.1       misho      51: 
                     52: /* default settings */
                     53: #define Ptcp SOCK_STREAM
                     54: #define Pudp SOCK_DGRAM
                     55: #define Psctp 12
1.1.1.2   misho      56: #define DEFAULT_UDP_BLKSIZE 1460 /* default is dynamically set, else this */
1.1       misho      57: #define DEFAULT_TCP_BLKSIZE (128 * 1024)  /* default read/write block size */
                     58: #define DEFAULT_SCTP_BLKSIZE (64 * 1024)
1.1.1.3 ! misho      59: #define DEFAULT_PACING_TIMER 1000
        !            60: #define DEFAULT_NO_MSG_RCVD_TIMEOUT 120000
        !            61: #define MIN_NO_MSG_RCVD_TIMEOUT 100
        !            62: 
        !            63: #define WARN_STR_LEN 128
1.1       misho      64: 
                     65: /* short option equivalents, used to support options that only have long form */
                     66: #define OPT_SCTP 1
                     67: #define OPT_LOGFILE 2
                     68: #define OPT_GET_SERVER_OUTPUT 3
                     69: #define OPT_UDP_COUNTERS_64BIT 4
                     70: #define OPT_CLIENT_PORT 5
                     71: #define OPT_NUMSTREAMS 6
1.1.1.2   misho      72: #define OPT_FORCEFLUSH 7
                     73: #define OPT_NO_FQ_SOCKET_PACING 9 /* UNUSED */
                     74: #define OPT_FQ_RATE 10
                     75: #define OPT_DSCP 11
                     76: #define OPT_CLIENT_USERNAME 12
                     77: #define OPT_CLIENT_RSA_PUBLIC_KEY 13
                     78: #define OPT_SERVER_RSA_PRIVATE_KEY 14
                     79: #define OPT_SERVER_AUTHORIZED_USERS 15
                     80: #define OPT_PACING_TIMER 16
                     81: #define OPT_CONNECT_TIMEOUT 17
                     82: #define OPT_REPEATING_PAYLOAD 18
                     83: #define OPT_EXTRA_DATA 19
                     84: #define OPT_BIDIRECTIONAL 20
                     85: #define OPT_SERVER_BITRATE_LIMIT 21
                     86: #define OPT_TIMESTAMPS 22
1.1.1.3 ! misho      87: #define OPT_SERVER_SKEW_THRESHOLD 23
        !            88: #define OPT_BIND_DEV 24
        !            89: #define OPT_IDLE_TIMEOUT 25
        !            90: #define OPT_DONT_FRAGMENT 26
        !            91: #define OPT_RCV_TIMEOUT 27
        !            92: #define OPT_SND_TIMEOUT 28
1.1       misho      93: 
                     94: /* states */
                     95: #define TEST_START 1
                     96: #define TEST_RUNNING 2
1.1.1.2   misho      97: #define RESULT_REQUEST 3 /* not used */
1.1       misho      98: #define TEST_END 4
1.1.1.2   misho      99: #define STREAM_BEGIN 5 /* not used */
                    100: #define STREAM_RUNNING 6 /* not used */
                    101: #define STREAM_END 7 /* not used */
                    102: #define ALL_STREAMS_END 8 /* not used */
1.1       misho     103: #define PARAM_EXCHANGE 9
                    104: #define CREATE_STREAMS 10
                    105: #define SERVER_TERMINATE 11
                    106: #define CLIENT_TERMINATE 12
                    107: #define EXCHANGE_RESULTS 13
                    108: #define DISPLAY_RESULTS 14
                    109: #define IPERF_START 15
                    110: #define IPERF_DONE 16
                    111: #define ACCESS_DENIED (-1)
                    112: #define SERVER_ERROR (-2)
                    113: 
                    114: /* Getter routines for some fields inside iperf_test. */
                    115: int    iperf_get_verbose( struct iperf_test* ipt );
                    116: int    iperf_get_control_socket( struct iperf_test* ipt );
                    117: int    iperf_get_test_omit( struct iperf_test* ipt );
                    118: int    iperf_get_test_duration( struct iperf_test* ipt );
                    119: char   iperf_get_test_role( struct iperf_test* ipt );
                    120: int    iperf_get_test_reverse( struct iperf_test* ipt );
1.1.1.3 ! misho     121: int    iperf_get_test_bidirectional( struct iperf_test* ipt );
1.1       misho     122: int    iperf_get_test_blksize( struct iperf_test* ipt );
                    123: FILE*  iperf_get_test_outfile( struct iperf_test* ipt );
                    124: uint64_t iperf_get_test_rate( struct iperf_test* ipt );
1.1.1.2   misho     125: int iperf_get_test_pacing_timer( struct iperf_test* ipt );
                    126: uint64_t iperf_get_test_bytes( struct iperf_test* ipt );
                    127: uint64_t iperf_get_test_blocks( struct iperf_test* ipt );
1.1       misho     128: int     iperf_get_test_burst( struct iperf_test* ipt );
                    129: int    iperf_get_test_socket_bufsize( struct iperf_test* ipt );
                    130: double iperf_get_test_reporter_interval( struct iperf_test* ipt );
                    131: double iperf_get_test_stats_interval( struct iperf_test* ipt );
                    132: int    iperf_get_test_num_streams( struct iperf_test* ipt );
1.1.1.2   misho     133: int    iperf_get_test_repeating_payload( struct iperf_test* ipt );
                    134: int    iperf_get_test_timestamps( struct iperf_test* ipt );
                    135: const char* iperf_get_test_timestamp_format( struct iperf_test* ipt );
1.1.1.3 ! misho     136: int    iperf_get_test_bind_port( struct iperf_test* ipt );
1.1       misho     137: int    iperf_get_test_server_port( struct iperf_test* ipt );
                    138: char*  iperf_get_test_server_hostname( struct iperf_test* ipt );
                    139: char*  iperf_get_test_template( struct iperf_test* ipt );
                    140: int    iperf_get_test_protocol_id( struct iperf_test* ipt );
                    141: int    iperf_get_test_json_output( struct iperf_test* ipt );
                    142: char*  iperf_get_test_json_output_string ( struct iperf_test* ipt );
                    143: int    iperf_get_test_zerocopy( struct iperf_test* ipt );
                    144: int    iperf_get_test_get_server_output( struct iperf_test* ipt );
1.1.1.3 ! misho     145: char   iperf_get_test_unit_format(struct iperf_test *ipt);
1.1       misho     146: char*  iperf_get_test_bind_address ( struct iperf_test* ipt );
1.1.1.3 ! misho     147: char*   iperf_get_test_bind_dev(struct iperf_test *ipt);
1.1       misho     148: int    iperf_get_test_udp_counters_64bit( struct iperf_test* ipt );
                    149: int    iperf_get_test_one_off( struct iperf_test* ipt );
1.1.1.2   misho     150: int iperf_get_test_tos( struct iperf_test* ipt );
                    151: char*  iperf_get_extra_data( struct iperf_test* ipt );
                    152: char*  iperf_get_iperf_version(void);
                    153: int    iperf_get_test_no_delay( struct iperf_test* ipt );
                    154: int    iperf_get_test_connect_timeout( struct iperf_test* ipt );
1.1.1.3 ! misho     155: int    iperf_get_dont_fragment( struct iperf_test* ipt );
        !           156: char*   iperf_get_test_congestion_control(struct iperf_test* ipt);
        !           157: int iperf_get_test_mss(struct iperf_test* ipt);
        !           158: int     iperf_get_mapped_v4(struct iperf_test* ipt);
1.1       misho     159: 
                    160: /* Setter routines for some fields inside iperf_test. */
                    161: void   iperf_set_verbose( struct iperf_test* ipt, int verbose );
                    162: void   iperf_set_control_socket( struct iperf_test* ipt, int ctrl_sck );
                    163: void   iperf_set_test_omit( struct iperf_test* ipt, int omit );
                    164: void   iperf_set_test_duration( struct iperf_test* ipt, int duration );
                    165: void   iperf_set_test_reporter_interval( struct iperf_test* ipt, double reporter_interval );
                    166: void   iperf_set_test_stats_interval( struct iperf_test* ipt, double stats_interval );
                    167: void   iperf_set_test_state( struct iperf_test* ipt, signed char state );
                    168: void   iperf_set_test_blksize( struct iperf_test* ipt, int blksize );
1.1.1.2   misho     169: void   iperf_set_test_logfile( struct iperf_test* ipt, const char *logfile );
1.1       misho     170: void   iperf_set_test_rate( struct iperf_test* ipt, uint64_t rate );
1.1.1.2   misho     171: void    iperf_set_test_pacing_timer( struct iperf_test* ipt, int pacing_timer );
                    172: void    iperf_set_test_bytes( struct iperf_test* ipt, uint64_t bytes );
                    173: void    iperf_set_test_blocks( struct iperf_test* ipt, uint64_t blocks );
1.1       misho     174: void   iperf_set_test_burst( struct iperf_test* ipt, int burst );
1.1.1.3 ! misho     175: void   iperf_set_test_bind_port( struct iperf_test* ipt, int bind_port );
1.1       misho     176: void   iperf_set_test_server_port( struct iperf_test* ipt, int server_port );
                    177: void   iperf_set_test_socket_bufsize( struct iperf_test* ipt, int socket_bufsize );
                    178: void   iperf_set_test_num_streams( struct iperf_test* ipt, int num_streams );
1.1.1.2   misho     179: void   iperf_set_test_repeating_payload( struct iperf_test* ipt, int repeating_payload );
                    180: void   iperf_set_test_timestamps( struct iperf_test* ipt, int timestamps );
                    181: void   iperf_set_test_timestamp_format( struct iperf_test*, const char *tf );
1.1       misho     182: void   iperf_set_test_role( struct iperf_test* ipt, char role );
1.1.1.2   misho     183: void   iperf_set_test_server_hostname( struct iperf_test* ipt, const char* server_hostname );
                    184: void    iperf_set_test_template( struct iperf_test *ipt, const char *tmp_template );
1.1       misho     185: void   iperf_set_test_reverse( struct iperf_test* ipt, int reverse );
                    186: void   iperf_set_test_json_output( struct iperf_test* ipt, int json_output );
                    187: int    iperf_has_zerocopy( void );
                    188: void   iperf_set_test_zerocopy( struct iperf_test* ipt, int zerocopy );
                    189: void   iperf_set_test_get_server_output( struct iperf_test* ipt, int get_server_output );
1.1.1.3 ! misho     190: void   iperf_set_test_unit_format(struct iperf_test *ipt, char unit_format);
1.1.1.2   misho     191: void   iperf_set_test_bind_address( struct iperf_test* ipt, const char *bind_address );
1.1.1.3 ! misho     192: void    iperf_set_test_bind_dev(struct iperf_test *ipt, const char *bnd_dev);
1.1       misho     193: void   iperf_set_test_udp_counters_64bit( struct iperf_test* ipt, int udp_counters_64bit );
                    194: void   iperf_set_test_one_off( struct iperf_test* ipt, int one_off );
1.1.1.2   misho     195: void    iperf_set_test_tos( struct iperf_test* ipt, int tos );
                    196: void   iperf_set_test_extra_data( struct iperf_test* ipt, const char *dat );
                    197: void    iperf_set_test_bidirectional( struct iperf_test* ipt, int bidirectional);
                    198: void    iperf_set_test_no_delay( struct iperf_test* ipt, int no_delay);
1.1.1.3 ! misho     199: void    iperf_set_dont_fragment( struct iperf_test* ipt, int dont_fragment );
        !           200: void    iperf_set_test_congestion_control(struct iperf_test* ipt, char* cc);
        !           201: void    iperf_set_test_mss(struct iperf_test* ipt, int mss);
        !           202: void    iperf_set_mapped_v4(struct iperf_test* ipt, const int val);
        !           203: void    iperf_set_on_new_stream_callback(struct iperf_test* ipt, void (*callback)());
        !           204: void    iperf_set_on_test_start_callback(struct iperf_test* ipt, void (*callback)());
        !           205: void    iperf_set_on_test_connect_callback(struct iperf_test* ipt, void (*callback)());
        !           206: void    iperf_set_on_test_finish_callback(struct iperf_test* ipt, void (*callback)());
1.1.1.2   misho     207: 
                    208: #if defined(HAVE_SSL)
                    209: void    iperf_set_test_client_username(struct iperf_test *ipt, const char *client_username);
                    210: void    iperf_set_test_client_password(struct iperf_test *ipt, const char *client_password);
                    211: void    iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_pubkey_base64);
                    212: void    iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users);
1.1.1.3 ! misho     213: void    iperf_set_test_server_skew_threshold(struct iperf_test *ipt, int server_skew_threshold);
1.1.1.2   misho     214: void    iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa_privkey_base64);
                    215: #endif // HAVE_SSL
                    216: 
                    217: void   iperf_set_test_connect_timeout(struct iperf_test *ipt, int ct);
1.1       misho     218: 
                    219: /**
                    220:  * exchange_parameters - handles the param_Exchange part for client
                    221:  *
                    222:  */
                    223: int      iperf_exchange_parameters(struct iperf_test * test);
                    224: 
                    225: /**
                    226:  * add_to_interval_list -- adds new interval to the interval_list
                    227:  *
                    228:  */
                    229: void      add_to_interval_list(struct iperf_stream_result * rp, struct iperf_interval_results *temp);
                    230: 
                    231: /**
                    232:  * connect_msg -- displays connection message
                    233:  * denoting senfer/receiver details
                    234:  *
                    235:  */
                    236: void      connect_msg(struct iperf_stream * sp);
                    237: 
                    238: /**
                    239:  * iperf_stats_callback -- handles the statistic gathering
                    240:  *
                    241:  */
                    242: void     iperf_stats_callback(struct iperf_test * test);
                    243: 
                    244: /**
                    245:  * iperf_reporter_callback -- handles the report printing
                    246:  *
                    247:  */
                    248: void     iperf_reporter_callback(struct iperf_test * test);
                    249: 
                    250: /**
                    251:  * iperf_new_test -- return a new iperf_test with default values
                    252:  *
                    253:  * returns NULL on failure
                    254:  *
                    255:  */
1.1.1.2   misho     256: struct iperf_test *iperf_new_test(void);
1.1       misho     257: 
                    258: int      iperf_defaults(struct iperf_test * testp);
                    259: 
                    260: /**
                    261:  * iperf_free_test -- free resources used by test, calls iperf_free_stream to
                    262:  * free streams
                    263:  *
                    264:  */
                    265: void      iperf_free_test(struct iperf_test * testp);
                    266: 
                    267: /**
                    268:  * iperf_new_stream -- return a net iperf_stream with default values
                    269:  *
                    270:  * returns NULL on failure
                    271:  *
                    272:  */
1.1.1.2   misho     273: struct iperf_stream *iperf_new_stream(struct iperf_test *, int, int);
1.1       misho     274: 
                    275: /**
                    276:  * iperf_add_stream -- add a stream to a test
                    277:  *
                    278:  */
                    279: void      iperf_add_stream(struct iperf_test * test, struct iperf_stream * stream);
                    280: 
                    281: /**
                    282:  * iperf_init_stream -- init resources associated with test
                    283:  *
                    284:  */
                    285: int       iperf_init_stream(struct iperf_stream *, struct iperf_test *);
                    286: 
                    287: /**
                    288:  * iperf_free_stream -- free resources associated with test
                    289:  *
                    290:  */
                    291: void      iperf_free_stream(struct iperf_stream * sp);
                    292: 
1.1.1.3 ! misho     293: /**
        !           294:  * iperf_common_sockopts -- init stream socket with common socket options
        !           295:  *
        !           296:  */
        !           297: int       iperf_common_sockopts(struct iperf_test *, int s);
        !           298: 
1.1       misho     299: int has_tcpinfo(void);
                    300: int has_tcpinfo_retransmits(void);
                    301: void save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp);
                    302: long get_total_retransmits(struct iperf_interval_results *irp);
                    303: long get_snd_cwnd(struct iperf_interval_results *irp);
1.1.1.3 ! misho     304: long get_snd_wnd(struct iperf_interval_results *irp);
1.1       misho     305: long get_rtt(struct iperf_interval_results *irp);
1.1.1.2   misho     306: long get_rttvar(struct iperf_interval_results *irp);
                    307: long get_pmtu(struct iperf_interval_results *irp);
1.1       misho     308: void print_tcpinfo(struct iperf_test *test);
                    309: void build_tcpinfo_message(struct iperf_interval_results *r, char *message);
                    310: 
                    311: int iperf_set_send_state(struct iperf_test *test, signed char state);
1.1.1.2   misho     312: void iperf_check_throttle(struct iperf_stream *sp, struct iperf_time *nowP);
1.1       misho     313: int iperf_send(struct iperf_test *, fd_set *) /* __attribute__((hot)) */;
                    314: int iperf_recv(struct iperf_test *, fd_set *);
                    315: void iperf_catch_sigend(void (*handler)(int));
                    316: void iperf_got_sigend(struct iperf_test *test) __attribute__ ((noreturn));
1.1.1.2   misho     317: void usage(void);
                    318: void usage_long(FILE * f);
                    319: void warning(const char *);
1.1       misho     320: int iperf_exchange_results(struct iperf_test *);
                    321: int iperf_init_test(struct iperf_test *);
                    322: int iperf_create_send_timers(struct iperf_test *);
                    323: int iperf_parse_arguments(struct iperf_test *, int, char **);
1.1.1.2   misho     324: int iperf_open_logfile(struct iperf_test *);
1.1.1.3 ! misho     325: void iperf_close_logfile(struct iperf_test *);
1.1       misho     326: void iperf_reset_test(struct iperf_test *);
                    327: void iperf_reset_stats(struct iperf_test * test);
                    328: 
                    329: struct protocol *get_protocol(struct iperf_test *, int);
                    330: int set_protocol(struct iperf_test *, int);
                    331: 
                    332: void iperf_on_new_stream(struct iperf_stream *);
                    333: void iperf_on_test_start(struct iperf_test *);
                    334: void iperf_on_connect(struct iperf_test *);
                    335: void iperf_on_test_finish(struct iperf_test *);
                    336: 
                    337: extern jmp_buf env;
                    338: 
                    339: /* Client routines. */
                    340: int iperf_run_client(struct iperf_test *);
                    341: int iperf_connect(struct iperf_test *);
1.1.1.2   misho     342: int iperf_create_streams(struct iperf_test *, int sender);
1.1       misho     343: int iperf_handle_message_client(struct iperf_test *);
                    344: int iperf_client_end(struct iperf_test *);
                    345: 
                    346: /* Server routines. */
                    347: int iperf_run_server(struct iperf_test *);
                    348: int iperf_server_listen(struct iperf_test *);
                    349: int iperf_accept(struct iperf_test *);
                    350: int iperf_handle_message_server(struct iperf_test *);
                    351: int iperf_create_pidfile(struct iperf_test *);
                    352: int iperf_delete_pidfile(struct iperf_test *);
1.1.1.2   misho     353: void iperf_check_total_rate(struct iperf_test *, iperf_size_t);
1.1       misho     354: 
                    355: /* JSON output routines. */
                    356: int iperf_json_start(struct iperf_test *);
                    357: int iperf_json_finish(struct iperf_test *);
                    358: 
                    359: /* CPU affinity routines */
                    360: int iperf_setaffinity(struct iperf_test *, int affinity);
                    361: int iperf_clearaffinity(struct iperf_test *);
                    362: 
                    363: /* Custom printf routine. */
1.1.1.2   misho     364: int iperf_printf(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3)));
1.1       misho     365: int iflush(struct iperf_test *test);
                    366: 
                    367: /* Error routines. */
                    368: void iperf_err(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3)));
                    369: void iperf_errexit(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3),noreturn));
                    370: char *iperf_strerror(int);
                    371: extern int i_errno;
                    372: enum {
                    373:     IENONE = 0,             // No error
                    374:     /* Parameter errors */
                    375:     IESERVCLIENT = 1,       // Iperf cannot be both server and client
                    376:     IENOROLE = 2,           // Iperf must either be a client (-c) or server (-s)
                    377:     IESERVERONLY = 3,       // This option is server only
                    378:     IECLIENTONLY = 4,       // This option is client only
                    379:     IEDURATION = 5,         // test duration too long. Maximum value = %dMAX_TIME
                    380:     IENUMSTREAMS = 6,       // Number of parallel streams too large. Maximum value = %dMAX_STREAMS
                    381:     IEBLOCKSIZE = 7,        // Block size too large. Maximum value = %dMAX_BLOCKSIZE
                    382:     IEBUFSIZE = 8,          // Socket buffer size too large. Maximum value = %dMAX_TCP_BUFFER
                    383:     IEINTERVAL = 9,         // Invalid report interval (min = %gMIN_INTERVAL, max = %gMAX_INTERVAL seconds)
                    384:     IEMSS = 10,             // MSS too large. Maximum value = %dMAX_MSS
                    385:     IENOSENDFILE = 11,      // This OS does not support sendfile
                    386:     IEOMIT = 12,            // Bogus value for --omit
                    387:     IEUNIMP = 13,           // Not implemented yet
                    388:     IEFILE = 14,            // -F file couldn't be opened
                    389:     IEBURST = 15,           // Invalid burst count. Maximum value = %dMAX_BURST
                    390:     IEENDCONDITIONS = 16,   // Only one test end condition (-t, -n, -k) may be specified
                    391:     IELOGFILE = 17,        // Can't open log file
                    392:     IENOSCTP = 18,         // No SCTP support available
1.1.1.2   misho     393:     IEBIND = 19,           // UNUSED:  Local port specified with no local bind option
                    394:     IEUDPBLOCKSIZE = 20,    // Block size invalid
1.1       misho     395:     IEBADTOS = 21,         // Bad TOS value
1.1.1.2   misho     396:     IESETCLIENTAUTH = 22,   // Bad configuration of client authentication
                    397:     IESETSERVERAUTH = 23,   // Bad configuration of server authentication
                    398:     IEBADFORMAT = 24,      // Bad format argument to -f
                    399:     IEREVERSEBIDIR = 25,    // Iperf cannot be both reverse and bidirectional
                    400:     IEBADPORT = 26,        // Bad port number
                    401:     IETOTALRATE = 27,       // Total required bandwidth is larger than server's limit
                    402:     IETOTALINTERVAL = 28,   // Invalid time interval for calculating average data rate
1.1.1.3 ! misho     403:     IESKEWTHRESHOLD = 29,   // Invalid value specified as skew threshold
        !           404:     IEIDLETIMEOUT = 30,     // Invalid value specified as idle state timeout
        !           405:     IERCVTIMEOUT = 31,      // Illegal message receive timeout
        !           406:     IERVRSONLYRCVTIMEOUT = 32,  // Client receive timeout is valid only in reverse mode
        !           407:     IESNDTIMEOUT = 33,      // Illegal message send timeout
        !           408:     IEUDPFILETRANSFER = 34, // Cannot transfer file using UDP
1.1       misho     409:     /* Test errors */
                    410:     IENEWTEST = 100,        // Unable to create a new test (check perror)
                    411:     IEINITTEST = 101,       // Test initialization failed (check perror)
                    412:     IELISTEN = 102,         // Unable to listen for connections (check perror)
                    413:     IECONNECT = 103,        // Unable to connect to server (check herror/perror) [from netdial]
                    414:     IEACCEPT = 104,         // Unable to accept connection from client (check herror/perror)
                    415:     IESENDCOOKIE = 105,     // Unable to send cookie to server (check perror)
                    416:     IERECVCOOKIE = 106,     // Unable to receive cookie from client (check perror)
                    417:     IECTRLWRITE = 107,      // Unable to write to the control socket (check perror)
                    418:     IECTRLREAD = 108,       // Unable to read from the control socket (check perror)
                    419:     IECTRLCLOSE = 109,      // Control socket has closed unexpectedly
                    420:     IEMESSAGE = 110,        // Received an unknown message
                    421:     IESENDMESSAGE = 111,    // Unable to send control message to client/server (check perror)
                    422:     IERECVMESSAGE = 112,    // Unable to receive control message from client/server (check perror)
                    423:     IESENDPARAMS = 113,     // Unable to send parameters to server (check perror)
                    424:     IERECVPARAMS = 114,     // Unable to receive parameters from client (check perror)
                    425:     IEPACKAGERESULTS = 115, // Unable to package results (check perror)
                    426:     IESENDRESULTS = 116,    // Unable to send results to client/server (check perror)
                    427:     IERECVRESULTS = 117,    // Unable to receive results from client/server (check perror)
                    428:     IESELECT = 118,         // Select failed (check perror)
                    429:     IECLIENTTERM = 119,     // The client has terminated
                    430:     IESERVERTERM = 120,     // The server has terminated
                    431:     IEACCESSDENIED = 121,   // The server is busy running a test. Try again later.
                    432:     IESETNODELAY = 122,     // Unable to set TCP/SCTP NODELAY (check perror)
                    433:     IESETMSS = 123,         // Unable to set TCP/SCTP MSS (check perror)
                    434:     IESETBUF = 124,         // Unable to set socket buffer size (check perror)
                    435:     IESETTOS = 125,         // Unable to set IP TOS (check perror)
                    436:     IESETCOS = 126,         // Unable to set IPv6 traffic class (check perror)
                    437:     IESETFLOW = 127,        // Unable to set IPv6 flow label
                    438:     IEREUSEADDR = 128,      // Unable to set reuse address on socket (check perror)
                    439:     IENONBLOCKING = 129,    // Unable to set socket to non-blocking (check perror)
                    440:     IESETWINDOWSIZE = 130,  // Unable to set socket window size (check perror)
                    441:     IEPROTOCOL = 131,       // Protocol does not exist
                    442:     IEAFFINITY = 132,       // Unable to set CPU affinity (check perror)
                    443:     IEDAEMON = 133,        // Unable to become a daemon process
                    444:     IESETCONGESTION = 134,  // Unable to set TCP_CONGESTION
                    445:     IEPIDFILE = 135,       // Unable to write PID file
                    446:     IEV6ONLY = 136,        // Unable to set/unset IPV6_V6ONLY (check perror)
                    447:     IESETSCTPDISABLEFRAG = 137, // Unable to set SCTP Fragmentation (check perror)
                    448:     IESETSCTPNSTREAM= 138,  //  Unable to set SCTP number of streams (check perror)
                    449:     IESETSCTPBINDX= 139,    // Unable to process sctp_bindx() parameters
                    450:     IESETPACING= 140,       // Unable to set socket pacing rate
1.1.1.2   misho     451:     IESETBUF2= 141,        // Socket buffer size incorrect (written value != read value)
                    452:     IEAUTHTEST = 142,       // Test authorization failed
1.1.1.3 ! misho     453:     IEBINDDEV = 143,        // Unable to bind-to-device (check perror, maybe permissions?)
        !           454:     IENOMSG = 144,          // No message was received for NO_MSG_RCVD_TIMEOUT time period
        !           455:     IESETDONTFRAGMENT = 145,   // Unable to set IP Do-Not-Fragment
        !           456:     IEBINDDEVNOSUPPORT = 146,  // `ip%%dev` is not supported as system does not support bind to device
        !           457:     IEHOSTDEV = 147,        // host device name (ip%%<dev>) is supported (and required) only for IPv6 link-local address
        !           458:     IESETUSERTIMEOUT = 148, // Unable to set TCP USER_TIMEOUT (check perror)
1.1       misho     459:     /* Stream errors */
                    460:     IECREATESTREAM = 200,   // Unable to create a new stream (check herror/perror)
                    461:     IEINITSTREAM = 201,     // Unable to initialize stream (check herror/perror)
1.1.1.3 ! misho     462:     IESTREAMLISTEN = 202,   // Unable to start stream listener (check perror)
1.1       misho     463:     IESTREAMCONNECT = 203,  // Unable to connect stream (check herror/perror)
                    464:     IESTREAMACCEPT = 204,   // Unable to accepte stream connection (check perror)
                    465:     IESTREAMWRITE = 205,    // Unable to write to stream socket (check perror)
                    466:     IESTREAMREAD = 206,     // Unable to read from stream (check perror)
                    467:     IESTREAMCLOSE = 207,    // Stream has closed unexpectedly
                    468:     IESTREAMID = 208,       // Stream has invalid ID
                    469:     /* Timer errors */
                    470:     IENEWTIMER = 300,       // Unable to create new timer (check perror)
                    471:     IEUPDATETIMER = 301,    // Unable to update timer (check perror)
                    472: };
                    473: 
1.1.1.2   misho     474: 
                    475: #ifdef __cplusplus
                    476: } /* close extern "C" */
                    477: #endif
                    478: 
                    479: 
1.1       misho     480: #endif /* !__IPERF_API_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>