Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4731 → Rev 4732

/branches/network/uspace/srv/net/app/ping/ping.c
149,6 → 149,11
printf( "Task %d - ", task_get_id());
printf( "%s\n", NAME );
 
if( argc <= 1 ){
print_help();
return EINVAL;
}
 
for( index = 1; ( index < argc - 1 ) || (( index == argc ) && ( argv[ index ][ 0 ] == '-' )); ++ index ){
if( argv[ index ][ 0 ] == '-' ){
switch( argv[ index ][ 1 ] ){
168,7 → 173,7
case 'v': verbose = 1;
break;
case '-': if( str_lcmp( argv[ index ] + 2, "count=", 6 ) == 0 ){
ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & count, "received count", 8 ))
ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & count, "received count", 8 ));
}else if( str_lcmp( argv[ index ] + 2, "dont_fragment", 13 ) == 0 ){
dont_fragment = 1;
}else if( str_lcmp( argv[ index ] + 2, "family=", 7 ) == 0 ){
221,7 → 226,7
addrlen = sizeof( struct sockaddr_in6 );
break;
default:
fprintf( stderr, "Protocol family is not supported\n" );
fprintf( stderr, "Address family is not supported\n" );
return EAFNOSUPPORT;
}
 
230,6 → 235,7
return ERROR_CODE;
}
 
// TODO timeout?
icmp_phone = icmp_connect_module( SERVICE_ICMP );
if( icmp_phone < 0 ){
fprintf( stderr, "ICMP connect error %d\n", icmp_phone );