Changes in uspace/srv/net/tl/icmp/icmp.c [14f1db0:849ed54] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
r14f1db0 r849ed54 51 51 #include <net_modules.h> 52 52 #include <packet/packet_client.h> 53 #include <packet_remote.h>54 53 #include <net_byteorder.h> 55 54 #include <net_checksum.h> … … 68 67 #include <socket_errno.h> 69 68 #include <tl_messages.h> 70 #include <tl_interface.h>71 #include <tl_local.h>72 69 #include <icmp_messages.h> 73 70 #include <icmp_header.h> … … 291 288 // TODO do not ask all the time 292 289 ERROR_PROPAGATE(ip_packet_size_req(icmp_globals.ip_phone, -1, &icmp_globals.packet_dimension)); 293 packet = packet_get_4 _remote(icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix);290 packet = packet_get_4(icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix); 294 291 if(! packet){ 295 292 return ENOMEM; … … 629 626 // compute the reply key 630 627 reply_key = ICMP_GET_REPLY_KEY(header->un.echo.identifier, header->un.echo.sequence_number); 631 pq_release _remote(icmp_globals.net_phone, packet_get_id(packet));628 pq_release(icmp_globals.net_phone, packet_get_id(packet)); 632 629 // lock the globals 633 630 fibril_rwlock_write_lock(&icmp_globals.lock); … … 644 641 } 645 642 646 int icmp_message _standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){643 int icmp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 647 644 ERROR_DECLARE; 648 645 … … 652 649 switch(IPC_GET_METHOD(*call)){ 653 650 case NET_TL_RECEIVED: 654 if(! ERROR_OCCURRED(packet_translate _remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){651 if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 655 652 ERROR_CODE = icmp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_ICMP, IPC_GET_ERROR(call)); 656 653 } … … 762 759 switch(IPC_GET_METHOD(*call)){ 763 760 case NET_ICMP_DEST_UNREACH: 764 if(! ERROR_OCCURRED(packet_translate _remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){761 if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 765 762 ERROR_CODE = icmp_destination_unreachable_msg(0, ICMP_GET_CODE(call), ICMP_GET_MTU(call), packet); 766 763 } 767 764 return ERROR_CODE; 768 765 case NET_ICMP_SOURCE_QUENCH: 769 if(! ERROR_OCCURRED(packet_translate _remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){766 if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 770 767 ERROR_CODE = icmp_source_quench_msg(0, packet); 771 768 } 772 769 return ERROR_CODE; 773 770 case NET_ICMP_TIME_EXCEEDED: 774 if(! ERROR_OCCURRED(packet_translate _remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){771 if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 775 772 ERROR_CODE = icmp_time_exceeded_msg(0, ICMP_GET_CODE(call), packet); 776 773 } 777 774 return ERROR_CODE; 778 775 case NET_ICMP_PARAMETERPROB: 779 if(! ERROR_OCCURRED(packet_translate _remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){776 if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 780 777 ERROR_CODE = icmp_parameter_problem_msg(0, ICMP_GET_CODE(call), ICMP_GET_POINTER(call), packet); 781 778 } … … 787 784 788 785 int icmp_release_and_return(packet_t packet, int result){ 789 pq_release _remote(icmp_globals.net_phone, packet_get_id(packet));786 pq_release(icmp_globals.net_phone, packet_get_id(packet)); 790 787 return result; 791 788 } … … 822 819 } 823 820 821 #ifdef CONFIG_NETWORKING_modular 822 823 #include <tl_standalone.h> 824 824 825 /** Default thread for new connections. 825 826 * … … 848 849 849 850 /* Process the message */ 850 int res = tl_module_message_standalone(callid, &call, &answer, 851 &answer_count); 851 int res = tl_module_message(callid, &call, &answer, &answer_count); 852 852 853 853 /* End if said to either by the message or the processing result */ … … 873 873 ERROR_DECLARE; 874 874 875 /* Print the module label */ 876 printf("Task %d - %s\n", task_get_id(), NAME); 877 875 878 /* Start the module */ 876 if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection))) 879 if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) { 880 printf(" - ERROR %i\n", ERROR_CODE); 877 881 return ERROR_CODE; 882 } 878 883 879 884 return EOK; 880 885 } 881 886 887 #endif /* CONFIG_NETWORKING_modular */ 888 882 889 /** @} 883 890 */
Note:
See TracChangeset
for help on using the changeset viewer.