Lines Matching refs:p
149 char *p, *q; in get_options() local
159 p = argv[i]; in get_options()
160 if( ( q = strchr( p, '=' ) ) == NULL ) in get_options()
161 exit_usage( p, NULL ); in get_options()
164 if( strcmp( p, "server_addr" ) == 0 ) in get_options()
166 else if( strcmp( p, "server_port" ) == 0 ) in get_options()
168 else if( strcmp( p, "listen_addr" ) == 0 ) in get_options()
170 else if( strcmp( p, "listen_port" ) == 0 ) in get_options()
172 else if( strcmp( p, "duplicate" ) == 0 ) in get_options()
176 exit_usage( p, q ); in get_options()
178 else if( strcmp( p, "delay" ) == 0 ) in get_options()
182 exit_usage( p, q ); in get_options()
184 else if( strcmp( p, "delay_ccs" ) == 0 ) in get_options()
188 exit_usage( p, q ); in get_options()
190 else if( strcmp( p, "drop" ) == 0 ) in get_options()
194 exit_usage( p, q ); in get_options()
196 else if( strcmp( p, "mtu" ) == 0 ) in get_options()
200 exit_usage( p, q ); in get_options()
202 else if( strcmp( p, "bad_ad" ) == 0 ) in get_options()
206 exit_usage( p, q ); in get_options()
208 else if( strcmp( p, "protect_hvr" ) == 0 ) in get_options()
212 exit_usage( p, q ); in get_options()
214 else if( strcmp( p, "protect_len" ) == 0 ) in get_options()
218 exit_usage( p, q ); in get_options()
220 else if( strcmp( p, "seed" ) == 0 ) in get_options()
224 exit_usage( p, q ); in get_options()
227 exit_usage( p, NULL ); in get_options()
301 void print_packet( const packet *p, const char *why ) in print_packet() argument
305 ellapsed_time(), p->way, p->type, p->len ); in print_packet()
308 p->way, p->type, p->len, why ); in print_packet()
312 int send_packet( const packet *p, const char *why ) in send_packet() argument
315 mbedtls_net_context *dst = p->dst; in send_packet()
319 strcmp( p->type, "ApplicationData" ) == 0 ) in send_packet()
322 memcpy( buf, p->buf, p->len ); in send_packet()
323 ++buf[p->len - 1]; in send_packet()
325 print_packet( p, "corrupted" ); in send_packet()
326 if( ( ret = mbedtls_net_send( dst, buf, p->len ) ) <= 0 ) in send_packet()
333 print_packet( p, why ); in send_packet()
334 if( ( ret = mbedtls_net_send( dst, p->buf, p->len ) ) <= 0 ) in send_packet()
342 strcmp( p->type, "ApplicationData" ) != 0 && in send_packet()
345 print_packet( p, "duplicated" ); in send_packet()
347 if( ( ret = mbedtls_net_send( dst, p->buf, p->len ) ) <= 0 ) in send_packet()
377 void update_dropped( const packet *p ) in update_dropped() argument
379 size_t id = p->len % sizeof( dropped ); in update_dropped()
380 const unsigned char *end = p->buf + p->len; in update_dropped()
381 const unsigned char *cur = p->buf; in update_dropped()
387 if( len == p->len ) in update_dropped()