Changes in uspace/srv/net/tl/icmp/icmp.c [753bca3:0a866eeb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
r753bca3 r0a866eeb 44 44 #include <ipc/ipc.h> 45 45 #include <ipc/services.h> 46 #include <ipc/icmp.h>47 46 #include <sys/time.h> 48 47 #include <sys/types.h> … … 60 59 #include <packet_remote.h> 61 60 #include <net_checksum.h> 62 #include < net/icmp_api.h>61 #include <icmp_api.h> 63 62 #include <icmp_client.h> 64 #include < net/icmp_codes.h>65 #include < net/icmp_common.h>63 #include <icmp_codes.h> 64 #include <icmp_common.h> 66 65 #include <icmp_interface.h> 67 66 #include <il_interface.h> … … 72 71 #include <tl_interface.h> 73 72 #include <tl_local.h> 73 #include <icmp_messages.h> 74 74 #include <icmp_header.h> 75 75 … … 449 449 } 450 450 451 int icmp_connect_module(services_t service, suseconds_t timeout){ 452 icmp_echo_ref echo_data; 453 icmp_param_t id; 454 int index; 455 456 echo_data = (icmp_echo_ref) malloc(sizeof(*echo_data)); 457 if(! echo_data){ 458 return ENOMEM; 459 } 460 // assign a new identifier 461 fibril_rwlock_write_lock(&icmp_globals.lock); 462 index = icmp_bind_free_id(echo_data); 463 if(index < 0){ 464 free(echo_data); 465 fibril_rwlock_write_unlock(&icmp_globals.lock); 466 return index; 467 }else{ 468 id = echo_data->identifier; 469 fibril_rwlock_write_unlock(&icmp_globals.lock); 470 // return the echo data identifier as the ICMP phone 471 return id; 472 } 473 } 474 451 475 int icmp_initialize(async_client_conn_t client_connection){ 452 476 ERROR_DECLARE; … … 461 485 icmp_replies_initialize(&icmp_globals.replies); 462 486 icmp_echo_data_initialize(&icmp_globals.echo_data); 463 icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection );487 icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection, icmp_received_msg); 464 488 if(icmp_globals.ip_phone < 0){ 465 489 return icmp_globals.ip_phone;
Note:
See TracChangeset
for help on using the changeset viewer.