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