Changes in uspace/srv/net/tl/icmp/icmp.c [9539be6:8e3a65c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
r9539be6 r8e3a65c 44 44 #include <ipc/ipc.h> 45 45 #include <ipc/services.h> 46 #include <ipc/net.h> 47 #include <ipc/tl.h> 48 #include <ipc/icmp.h> 46 49 #include <sys/time.h> 47 50 #include <sys/types.h> 48 49 #include <net_err.h> 50 #include <net_messages.h> 51 #include <net_modules.h> 52 #include <packet/packet_client.h> 51 #include <byteorder.h> 52 #include <errno.h> 53 #include <err.h> 54 55 #include <net/socket_codes.h> 56 #include <net/ip_protocols.h> 57 #include <net/inet.h> 58 59 #include <net/modules.h> 60 #include <packet_client.h> 53 61 #include <packet_remote.h> 54 #include <net_byteorder.h>55 62 #include <net_checksum.h> 56 #include < icmp_api.h>63 #include <net/icmp_api.h> 57 64 #include <icmp_client.h> 58 #include < icmp_codes.h>59 #include < icmp_common.h>65 #include <net/icmp_codes.h> 66 #include <net/icmp_common.h> 60 67 #include <icmp_interface.h> 61 68 #include <il_interface.h> 62 #include <inet.h>63 69 #include <ip_client.h> 64 70 #include <ip_interface.h> 65 #include <ip_protocols.h>66 71 #include <net_interface.h> 67 #include <socket_codes.h>68 #include <socket_errno.h>69 #include <tl_messages.h>70 72 #include <tl_interface.h> 71 73 #include <tl_local.h> 72 #include <icmp_messages.h>73 74 #include <icmp_header.h> 74 75 … … 448 449 } 449 450 450 int icmp_connect_module(services_t service, suseconds_t timeout){451 icmp_echo_ref echo_data;452 icmp_param_t id;453 int index;454 455 echo_data = (icmp_echo_ref) malloc(sizeof(*echo_data));456 if(! echo_data){457 return ENOMEM;458 }459 // assign a new identifier460 fibril_rwlock_write_lock(&icmp_globals.lock);461 index = icmp_bind_free_id(echo_data);462 if(index < 0){463 free(echo_data);464 fibril_rwlock_write_unlock(&icmp_globals.lock);465 return index;466 }else{467 id = echo_data->identifier;468 fibril_rwlock_write_unlock(&icmp_globals.lock);469 // return the echo data identifier as the ICMP phone470 return id;471 }472 }473 474 451 int icmp_initialize(async_client_conn_t client_connection){ 475 452 ERROR_DECLARE; … … 484 461 icmp_replies_initialize(&icmp_globals.replies); 485 462 icmp_echo_data_initialize(&icmp_globals.echo_data); 486 icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection , icmp_received_msg);463 icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection); 487 464 if(icmp_globals.ip_phone < 0){ 488 465 return icmp_globals.ip_phone;
Note:
See TracChangeset
for help on using the changeset viewer.