75,6 → 75,14 |
#include "icmp_messages.h" |
#include "icmp_module.h" |
|
/** Default ICMP error reporting. |
*/ |
#define NET_DEFAULT_ICMP_ERROR_REPORTING true |
|
/** Default ICMP echo replying. |
*/ |
#define NET_DEFAULT_ICMP_ECHO_REPLYING true |
|
/** Original datagram length in bytes transfered to the error notification message. |
*/ |
#define ICMP_KEEP_LENGTH 8 |
500,12 → 508,14 |
index = icmp_bind_free_id( echo_data ); |
if( index < 0 ){ |
free( echo_data ); |
fibril_rwlock_write_unlock( & icmp_globals.lock ); |
return index; |
}else{ |
id = echo_data->id; |
fibril_rwlock_write_unlock( & icmp_globals.lock ); |
// return the echo data identifier as the ICMP phone |
return id; |
} |
fibril_rwlock_write_unlock( & icmp_globals.lock ); |
// return the echo data identifier as the ICMP phone |
return id; |
} |
|
int icmp_initialize( async_client_conn_t client_connection ){ |
527,12 → 537,18 |
ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.addr_len, & icmp_globals.prefix, & icmp_globals.content, & icmp_globals.suffix )); |
icmp_globals.prefix += sizeof( icmp_header_t ); |
icmp_globals.content -= sizeof( icmp_header_t ); |
// get configuration |
icmp_globals.error_reporting = NET_DEFAULT_ICMP_ERROR_REPORTING; |
icmp_globals.echo_replying = NET_DEFAULT_ICMP_ECHO_REPLYING; |
configuration = & names[ 0 ]; |
// get configuration |
ERROR_PROPAGATE( net_get_conf_req( icmp_globals.net_phone, & configuration, count, & data )); |
if( configuration ){ |
icmp_globals.error_reporting = configuration[ 0 ].value && ( configuration[ 0 ].value[ 0 ] == 'y' ); |
icmp_globals.echo_replying = configuration[ 1 ].value && ( configuration[ 1 ].value[ 0 ] == 'y' ); |
if( configuration[ 0 ].value ){ |
icmp_globals.error_reporting = ( configuration[ 0 ].value[ 0 ] == 'y' ); |
} |
if( configuration[ 1 ].value ){ |
icmp_globals.echo_replying = ( configuration[ 1 ].value[ 0 ] == 'y' ); |
} |
net_free_settings( configuration, data ); |
} |
fibril_rwlock_write_unlock( & icmp_globals.lock ); |