Lines Matching refs:opt
133 } opt; variable
151 opt.server_addr = DFL_SERVER_ADDR; in get_options()
152 opt.server_port = DFL_SERVER_PORT; in get_options()
153 opt.listen_addr = DFL_LISTEN_ADDR; in get_options()
154 opt.listen_port = DFL_LISTEN_PORT; in get_options()
165 opt.server_addr = q; in get_options()
167 opt.server_port = q; in get_options()
169 opt.listen_addr = q; in get_options()
171 opt.listen_port = q; in get_options()
174 opt.duplicate = atoi( q ); in get_options()
175 if( opt.duplicate < 0 || opt.duplicate > 20 ) in get_options()
180 opt.delay = atoi( q ); in get_options()
181 if( opt.delay < 0 || opt.delay > 20 || opt.delay == 1 ) in get_options()
186 opt.delay_ccs = atoi( q ); in get_options()
187 if( opt.delay_ccs < 0 || opt.delay_ccs > 1 ) in get_options()
192 opt.drop = atoi( q ); in get_options()
193 if( opt.drop < 0 || opt.drop > 20 || opt.drop == 1 ) in get_options()
198 opt.mtu = atoi( q ); in get_options()
199 if( opt.mtu < 0 || opt.mtu > MAX_MSG_SIZE ) in get_options()
204 opt.bad_ad = atoi( q ); in get_options()
205 if( opt.bad_ad < 0 || opt.bad_ad > 1 ) in get_options()
210 opt.protect_hvr = atoi( q ); in get_options()
211 if( opt.protect_hvr < 0 || opt.protect_hvr > 1 ) in get_options()
216 opt.protect_len = atoi( q ); in get_options()
217 if( opt.protect_len < 0 ) in get_options()
222 opt.seed = atoi( q ); in get_options()
223 if( opt.seed == 0 ) in get_options()
318 if( opt.bad_ad && in send_packet()
341 if( opt.duplicate != 0 && in send_packet()
343 rand() % opt.duplicate == 0 ) in send_packet()
425 if( ( opt.mtu != 0 && in handle_message()
426 cur.len > (unsigned) opt.mtu ) || in handle_message()
427 ( opt.drop != 0 && in handle_message()
429 ! ( opt.protect_hvr && in handle_message()
431 cur.len != (size_t) opt.protect_len && in handle_message()
433 rand() % opt.drop == 0 ) ) in handle_message()
437 else if( ( opt.delay_ccs == 1 && in handle_message()
439 ( opt.delay != 0 && in handle_message()
441 ! ( opt.protect_hvr && in handle_message()
444 cur.len != (size_t) opt.protect_len && in handle_message()
446 rand() % opt.delay == 0 ) ) in handle_message()
492 if( opt.seed == 0 ) in main()
494 opt.seed = (unsigned int) time( NULL ); in main()
495 mbedtls_printf( " . Pseudo-random seed: %u\n", opt.seed ); in main()
498 srand( opt.seed ); in main()
504 opt.server_addr, opt.server_port ); in main()
507 if( ( ret = mbedtls_net_connect( &server_fd, opt.server_addr, opt.server_port, in main()
520 opt.listen_addr, opt.listen_port ); in main()
523 if( ( ret = mbedtls_net_bind( &listen_fd, opt.listen_addr, opt.listen_port, in main()