149,11 → 149,6 |
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 ] ){ |
173,7 → 168,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 ){ |
226,7 → 221,7 |
addrlen = sizeof( struct sockaddr_in6 ); |
break; |
default: |
fprintf( stderr, "Address family is not supported\n" ); |
fprintf( stderr, "Protocol family is not supported\n" ); |
return EAFNOSUPPORT; |
} |
|
235,7 → 230,6 |
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 ); |