Lines Matching refs:opt

171 } opt;  variable
189 opt.server_addr = DFL_SERVER_ADDR; in get_options()
190 opt.server_port = DFL_SERVER_PORT; in get_options()
191 opt.listen_addr = DFL_LISTEN_ADDR; in get_options()
192 opt.listen_port = DFL_LISTEN_PORT; in get_options()
193 opt.pack = DFL_PACK; in get_options()
196 opt.delay_cli_cnt = 0; in get_options()
197 opt.delay_srv_cnt = 0; in get_options()
198 memset( opt.delay_cli, 0, sizeof( opt.delay_cli ) ); in get_options()
199 memset( opt.delay_srv, 0, sizeof( opt.delay_srv ) ); in get_options()
209 opt.server_addr = q; in get_options()
211 opt.server_port = q; in get_options()
213 opt.listen_addr = q; in get_options()
215 opt.listen_port = q; in get_options()
218 opt.duplicate = atoi( q ); in get_options()
219 if( opt.duplicate < 0 || opt.duplicate > 20 ) in get_options()
224 opt.delay = atoi( q ); in get_options()
225 if( opt.delay < 0 || opt.delay > 20 || opt.delay == 1 ) in get_options()
230 opt.delay_ccs = atoi( q ); in get_options()
231 if( opt.delay_ccs < 0 || opt.delay_ccs > 1 ) in get_options()
244 delay_cnt = &opt.delay_cli_cnt; in get_options()
245 delay_list = opt.delay_cli; in get_options()
249 delay_cnt = &opt.delay_srv_cnt; in get_options()
250 delay_list = opt.delay_srv; in get_options()
273 opt.drop = atoi( q ); in get_options()
274 if( opt.drop < 0 || opt.drop > 20 || opt.drop == 1 ) in get_options()
280 opt.pack = (unsigned) atoi( q ); in get_options()
288 opt.mtu = atoi( q ); in get_options()
289 if( opt.mtu < 0 || opt.mtu > MAX_MSG_SIZE ) in get_options()
294 opt.bad_ad = atoi( q ); in get_options()
295 if( opt.bad_ad < 0 || opt.bad_ad > 1 ) in get_options()
301 opt.bad_cid = (unsigned) atoi( q ); in get_options()
306 opt.protect_hvr = atoi( q ); in get_options()
307 if( opt.protect_hvr < 0 || opt.protect_hvr > 1 ) in get_options()
312 opt.protect_len = atoi( q ); in get_options()
313 if( opt.protect_len < 0 ) in get_options()
318 opt.inject_clihlo = atoi( q ); in get_options()
319 if( opt.inject_clihlo < 0 || opt.inject_clihlo > 1 ) in get_options()
324 opt.seed = atoi( q ); in get_options()
325 if( opt.seed == 0 ) in get_options()
430 if( cur_time - buf->packet_lifetime >= opt.pack ) in ctx_buffer_time_remaining()
433 return( opt.pack - ( cur_time - buf->packet_lifetime ) ); in ctx_buffer_time_remaining()
478 if( opt.pack > 0 ) in dispatch_data()
558 if( opt.inject_clihlo != 0 && in send_packet()
567 if( opt.bad_cid != 0 && in send_packet()
569 ( rand() % opt.bad_cid ) == 0 ) in send_packet()
586 if( opt.bad_ad && in send_packet()
617 if( opt.duplicate != 0 && in send_packet()
619 rand() % opt.duplicate == 0 ) in send_packet()
631 if( opt.inject_clihlo != 0 && in send_packet()
729 delay_list = opt.delay_cli; in handle_message()
730 delay_list_len = opt.delay_cli_cnt; in handle_message()
734 delay_list = opt.delay_srv; in handle_message()
735 delay_list_len = opt.delay_srv_cnt; in handle_message()
759 if( ( opt.mtu != 0 && in handle_message()
760 cur.len > (unsigned) opt.mtu ) || in handle_message()
761 ( opt.drop != 0 && in handle_message()
764 ! ( opt.protect_hvr && in handle_message()
766 cur.len != (size_t) opt.protect_len && in handle_message()
768 rand() % opt.drop == 0 ) ) in handle_message()
772 else if( ( opt.delay_ccs == 1 && in handle_message()
774 ( opt.delay != 0 && in handle_message()
777 ! ( opt.protect_hvr && in handle_message()
779 cur.len != (size_t) opt.protect_len && in handle_message()
781 rand() % opt.delay == 0 ) ) in handle_message()
832 if( opt.seed == 0 ) in main()
834 opt.seed = (unsigned int) time( NULL ); in main()
835 mbedtls_printf( " . Pseudo-random seed: %u\n", opt.seed ); in main()
838 srand( opt.seed ); in main()
844 opt.server_addr, opt.server_port ); in main()
847 if( ( ret = mbedtls_net_connect( &server_fd, opt.server_addr, opt.server_port, in main()
860 opt.listen_addr, opt.listen_port ); in main()
863 if( ( ret = mbedtls_net_bind( &listen_fd, opt.listen_addr, opt.listen_port, in main()
904 if( opt.pack > 0 ) in main()
921 if( opt.pack > 0 ) in main()
1002 mbedtls_free( opt.delay_cli[delay_idx] ); in main()
1003 mbedtls_free( opt.delay_srv[delay_idx] ); in main()