Changeset 14f1db0 in mainline for uspace/srv/net/tl
- Timestamp:
- 2010-04-09T12:54:57Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1caa3c2
- Parents:
- 24ab58b3
- Location:
- uspace/srv/net/tl
- Files:
-
- 10 edited
-
icmp/icmp.c (modified) (12 diffs)
-
icmp/icmp_module.c (modified) (3 diffs)
-
icmp/icmp_module.h (modified) (1 diff)
-
tcp/tcp.c (modified) (32 diffs)
-
tcp/tcp.h (modified) (1 diff)
-
tcp/tcp_module.c (modified) (3 diffs)
-
tcp/tcp_module.h (modified) (1 diff)
-
udp/udp.c (modified) (16 diffs)
-
udp/udp_module.c (modified) (3 diffs)
-
udp/udp_module.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
r24ab58b3 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 */ … … 874 874 875 875 /* Start the module */ 876 if (ERROR_OCCURRED(tl_module_start (tl_client_connection)))876 if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection))) 877 877 return ERROR_CODE; 878 878 … … 880 880 } 881 881 882 #endif /* CONFIG_NETWORKING_modular */883 884 882 /** @} 885 883 */ -
uspace/srv/net/tl/icmp/icmp_module.c
r24ab58b3 r14f1db0 47 47 #include <packet/packet.h> 48 48 #include <net_interface.h> 49 #include <tl_ standalone.h>49 #include <tl_local.h> 50 50 51 51 #include "icmp.h" … … 63 63 * @returns Other error codes as defined for the REGISTER_ME() macro function. 64 64 */ 65 int tl_module_start (async_client_conn_t client_connection){65 int tl_module_start_standalone(async_client_conn_t client_connection){ 66 66 ERROR_DECLARE; 67 67 … … 94 94 * @returns Other error codes as defined for the icmp_message() function. 95 95 */ 96 int tl_module_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){97 return icmp_message (callid, call, answer, answer_count);96 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 97 return icmp_message_standalone(callid, call, answer, answer_count); 98 98 } 99 99 -
uspace/srv/net/tl/icmp/icmp_module.h
r24ab58b3 r14f1db0 59 59 * @see IS_NET_ICMP_MESSAGE() 60 60 */ 61 int icmp_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);61 int icmp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 62 62 63 63 #endif -
uspace/srv/net/tl/tcp/tcp.c
r24ab58b3 r14f1db0 51 51 #include <adt/dynamic_fifo.h> 52 52 #include <packet/packet_client.h> 53 #include <packet_remote.h> 53 54 #include <net_checksum.h> 54 55 #include <in.h> … … 68 69 #include <tl_common.h> 69 70 #include <tl_messages.h> 71 #include <tl_local.h> 72 #include <tl_interface.h> 70 73 71 74 #include "tcp.h" … … 421 424 break; 422 425 default: 423 pq_release (tcp_globals.net_phone, packet_get_id(packet));426 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 424 427 } 425 428 … … 473 476 // release the acknowledged packets 474 477 next_packet = pq_next(packet); 475 pq_release (tcp_globals.net_phone, packet_get_id(packet));478 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 476 479 packet = next_packet; 477 480 offset -= length; … … 517 520 next_packet = pq_next(next_packet); 518 521 pq_insert_after(tmp_packet, next_packet); 519 pq_release (tcp_globals.net_phone, packet_get_id(tmp_packet));522 pq_release_remote(tcp_globals.net_phone, packet_get_id(tmp_packet)); 520 523 } 521 524 assert(new_sequence_number + total_length == socket_data->next_incoming + socket_data->window); … … 548 551 socket_data->incoming = next_packet; 549 552 } 550 pq_release (tcp_globals.net_phone, packet_get_id(packet));553 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 551 554 packet = next_packet; 552 555 continue; … … 568 571 if(length <= 0){ 569 572 // remove the empty packet 570 pq_release (tcp_globals.net_phone, packet_get_id(packet));573 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 571 574 packet = next_packet; 572 575 continue; … … 595 598 } 596 599 // remove the duplicit or corrupted packet 597 pq_release (tcp_globals.net_phone, packet_get_id(packet));600 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 598 601 packet = next_packet; 599 602 continue; … … 617 620 if(ERROR_OCCURRED(pq_add(&socket_data->incoming, packet, new_sequence_number, length))){ 618 621 // remove the corrupted packets 619 pq_release (tcp_globals.net_phone, packet_get_id(packet));620 pq_release (tcp_globals.net_phone, packet_get_id(next_packet));622 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 623 pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet)); 621 624 }else{ 622 625 while(next_packet){ … … 626 629 if(ERROR_OCCURRED(pq_set_order(next_packet, new_sequence_number, length)) 627 630 || ERROR_OCCURRED(pq_insert_after(packet, next_packet))){ 628 pq_release (tcp_globals.net_phone, packet_get_id(next_packet));631 pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet)); 629 632 } 630 633 next_packet = tmp_packet; … … 634 637 printf("unexpected\n"); 635 638 // release duplicite or restricted 636 pq_release (tcp_globals.net_phone, packet_get_id(packet));639 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 637 640 } 638 641 … … 679 682 // queue the received packet 680 683 if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE)) 681 || ERROR_OCCURRED(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension))){684 || ERROR_OCCURRED(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension))){ 682 685 return tcp_release_and_return(packet, ERROR_CODE); 683 686 } … … 710 713 next_packet = pq_detach(packet); 711 714 if(next_packet){ 712 pq_release (tcp_globals.net_phone, packet_get_id(next_packet));715 pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet)); 713 716 } 714 717 // trim if longer than the header … … 780 783 free(socket_data->addr); 781 784 free(socket_data); 782 pq_release (tcp_globals.net_phone, packet_get_id(packet));785 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 783 786 return ERROR_CODE; 784 787 } … … 846 849 next_packet = pq_detach(packet); 847 850 if(next_packet){ 848 pq_release (tcp_globals.net_phone, packet_get_id(next_packet));851 pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet)); 849 852 } 850 853 // trim if longer than the header … … 895 898 896 899 socket_data->next_incoming = ntohl(header->sequence_number);// + 1; 897 pq_release (tcp_globals.net_phone, packet_get_id(packet));900 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 898 901 socket_data->state = TCP_SOCKET_ESTABLISHED; 899 902 listening_socket = socket_cores_find(socket_data->local_sockets, socket_data->listening_socket_id); … … 981 984 // add to acknowledged or release 982 985 if(pq_add(&acknowledged, packet, 0, 0) != EOK){ 983 pq_release (tcp_globals.net_phone, packet_get_id(packet));986 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 984 987 } 985 988 packet = next; … … 990 993 // release acknowledged 991 994 if(acknowledged){ 992 pq_release (tcp_globals.net_phone, packet_get_id(acknowledged));995 pq_release_remote(tcp_globals.net_phone, packet_get_id(acknowledged)); 993 996 } 994 997 return; … … 1006 1009 } 1007 1010 1008 int tcp_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){1011 int tcp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 1009 1012 ERROR_DECLARE; 1010 1013 … … 1019 1022 case NET_TL_RECEIVED: 1020 1023 //fibril_rwlock_read_lock(&tcp_globals.lock); 1021 if(! ERROR_OCCURRED(packet_translate (tcp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){1024 if(! ERROR_OCCURRED(packet_translate_remote(tcp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 1022 1025 ERROR_CODE = tcp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_TCP, IPC_GET_ERROR(call)); 1023 1026 } … … 1111 1114 fibril_rwlock_write_unlock(&lock); 1112 1115 if(res == EOK){ 1113 if (tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){1116 if (tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){ 1114 1117 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size)); 1115 1118 } … … 1565 1568 }else{ 1566 1569 if(ERROR_OCCURRED(pq_insert_after(previous, copy))){ 1567 pq_release (tcp_globals.net_phone, packet_get_id(copy));1570 pq_release_remote(tcp_globals.net_phone, packet_get_id(copy)); 1568 1571 return sending; 1569 1572 } … … 1597 1600 // adjust the pseudo header 1598 1601 if(ERROR_OCCURRED(ip_client_set_pseudo_header_data_length(socket_data->pseudo_header, socket_data->headerlen, packet_get_data_length(packet)))){ 1599 pq_release (tcp_globals.net_phone, packet_get_id(packet));1602 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 1600 1603 return NULL; 1601 1604 } … … 1604 1607 header = (tcp_header_ref) packet_get_data(packet); 1605 1608 if(! header){ 1606 pq_release (tcp_globals.net_phone, packet_get_id(packet));1609 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 1607 1610 return NULL; 1608 1611 } … … 1625 1628 // prepare the timeout 1626 1629 || ERROR_OCCURRED(tcp_prepare_timeout(tcp_timeout, socket, socket_data, sequence_number, socket_data->state, socket_data->timeout, true))){ 1627 pq_release (tcp_globals.net_phone, packet_get_id(packet));1630 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 1628 1631 return NULL; 1629 1632 } … … 1750 1753 return NO_DATA; 1751 1754 } 1752 ERROR_PROPAGATE(packet_translate (tcp_globals.net_phone, &packet, packet_id));1755 ERROR_PROPAGATE(packet_translate_remote(tcp_globals.net_phone, &packet, packet_id)); 1753 1756 1754 1757 // reply the packets … … 1757 1760 // release the packet 1758 1761 dyn_fifo_pop(&socket->received); 1759 pq_release (tcp_globals.net_phone, packet_get_id(packet));1762 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 1760 1763 // return the total length 1761 1764 return (int) length; … … 1889 1892 ERROR_PROPAGATE(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension)); 1890 1893 // get a new packet 1891 *packet = packet_get_4 (tcp_globals.net_phone, TCP_HEADER_SIZE, packet_dimension->addr_len, packet_dimension->prefix, packet_dimension->suffix);1894 *packet = packet_get_4_remote(tcp_globals.net_phone, TCP_HEADER_SIZE, packet_dimension->addr_len, packet_dimension->prefix, packet_dimension->suffix); 1892 1895 if(! * packet){ 1893 1896 return ENOMEM; … … 1993 1996 1994 1997 int tcp_release_and_return(packet_t packet, int result){ 1995 pq_release (tcp_globals.net_phone, packet_get_id(packet));1998 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); 1996 1999 return result; 1997 2000 } 1998 1999 #ifdef CONFIG_NETWORKING_modular2000 2001 #include <tl_standalone.h>2002 2001 2003 2002 /** Default thread for new connections. … … 2027 2026 2028 2027 /* Process the message */ 2029 int res = tl_module_message(callid, &call, &answer, &answer_count); 2028 int res = tl_module_message_standalone(callid, &call, &answer, 2029 &answer_count); 2030 2030 2031 2031 /* End if said to either by the message or the processing result */ … … 2052 2052 2053 2053 /* Start the module */ 2054 if (ERROR_OCCURRED(tl_module_start (tl_client_connection)))2054 if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection))) 2055 2055 return ERROR_CODE; 2056 2056 … … 2058 2058 } 2059 2059 2060 #endif /* CONFIG_NETWORKING_modular */2061 2062 2060 /** @} 2063 2061 */ -
uspace/srv/net/tl/tcp/tcp.h
r24ab58b3 r14f1db0 232 232 /** IP pseudo header. 233 233 */ 234 ip_pseudo_header_refpseudo_header;234 void *pseudo_header; 235 235 /** IP pseudo header length. 236 236 */ -
uspace/srv/net/tl/tcp/tcp_module.c
r24ab58b3 r14f1db0 49 49 #include <ip_protocols.h> 50 50 #include <ip_interface.h> 51 #include <tl_ standalone.h>51 #include <tl_local.h> 52 52 53 53 #include "tcp.h" … … 65 65 * @returns Other error codes as defined for the REGISTER_ME() macro function. 66 66 */ 67 int tl_module_start(async_client_conn_t client_connection){ 67 int tl_module_start_standalone(async_client_conn_t client_connection) 68 { 68 69 ERROR_DECLARE; 69 70 ipcarg_t phonehash; 71 70 72 71 async_set_client_connection(client_connection); 73 72 tcp_globals.net_phone = net_connect_module(SERVICE_NETWORKING); 74 73 ERROR_PROPAGATE(pm_init()); 75 if(ERROR_OCCURRED(tcp_initialize(client_connection)) 76 || ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))){ 74 75 ipcarg_t phonehash; 76 if (ERROR_OCCURRED(tcp_initialize(client_connection)) 77 || ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))) { 77 78 pm_destroy(); 78 79 return ERROR_CODE; 79 80 } 80 81 81 82 async_manager(); 82 83 83 84 pm_destroy(); 84 85 return EOK; … … 93 94 * @returns Other error codes as defined for the tcp_message() function. 94 95 */ 95 int tl_module_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){96 return tcp_message (callid, call, answer, answer_count);96 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 97 return tcp_message_standalone(callid, call, answer, answer_count); 97 98 } 98 99 -
uspace/srv/net/tl/tcp/tcp_module.h
r24ab58b3 r14f1db0 59 59 * @see IS_NET_TCP_MESSAGE() 60 60 */ 61 extern int tcp_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);61 extern int tcp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 62 62 63 63 #endif -
uspace/srv/net/tl/udp/udp.c
r24ab58b3 r14f1db0 48 48 #include <adt/dynamic_fifo.h> 49 49 #include <packet/packet_client.h> 50 #include <packet_remote.h> 50 51 #include <net_checksum.h> 51 52 #include <in.h> … … 63 64 #include <socket_messages.h> 64 65 #include <tl_common.h> 66 #include <tl_local.h> 67 #include <tl_interface.h> 65 68 #include <tl_messages.h> 66 69 … … 258 261 icmp_type_t type; 259 262 icmp_code_t code; 260 ip_pseudo_header_refip_header;263 void *ip_header; 261 264 struct sockaddr * src; 262 265 struct sockaddr * dest; … … 356 359 while(tmp_packet){ 357 360 next_packet = pq_detach(tmp_packet); 358 pq_release (udp_globals.net_phone, packet_get_id(tmp_packet));361 pq_release_remote(udp_globals.net_phone, packet_get_id(tmp_packet)); 359 362 tmp_packet = next_packet; 360 363 } … … 382 385 // queue the received packet 383 386 if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE)) 384 || ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){387 || ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){ 385 388 return udp_release_and_return(packet, ERROR_CODE); 386 389 } … … 392 395 } 393 396 394 int udp_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){397 int udp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 395 398 ERROR_DECLARE; 396 399 … … 400 403 switch(IPC_GET_METHOD(*call)){ 401 404 case NET_TL_RECEIVED: 402 if(! ERROR_OCCURRED(packet_translate (udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){405 if(! ERROR_OCCURRED(packet_translate_remote(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 403 406 ERROR_CODE = udp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_UDP, IPC_GET_ERROR(call)); 404 407 } … … 457 460 458 461 if(res == EOK){ 459 if (tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){462 if (tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){ 460 463 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, packet_dimension->content); 461 464 } … … 533 536 uint16_t dest_port; 534 537 uint32_t checksum; 535 ip_pseudo_header_refip_header;538 void *ip_header; 536 539 size_t headerlen; 537 540 device_id_t device_id; … … 662 665 return NO_DATA; 663 666 } 664 ERROR_PROPAGATE(packet_translate (udp_globals.net_phone, &packet, packet_id));667 ERROR_PROPAGATE(packet_translate_remote(udp_globals.net_phone, &packet, packet_id)); 665 668 // get udp header 666 669 data = packet_get_data(packet); 667 670 if(! data){ 668 pq_release (udp_globals.net_phone, packet_id);671 pq_release_remote(udp_globals.net_phone, packet_id); 669 672 return NO_DATA; 670 673 } … … 674 677 result = packet_get_addr(packet, (uint8_t **) &addr, NULL); 675 678 if(ERROR_OCCURRED(tl_set_address_port(addr, result, ntohs(header->source_port)))){ 676 pq_release (udp_globals.net_phone, packet_id);679 pq_release_remote(udp_globals.net_phone, packet_id); 677 680 return ERROR_CODE; 678 681 } … … 689 692 // release the packet 690 693 dyn_fifo_pop(&socket->received); 691 pq_release (udp_globals.net_phone, packet_get_id(packet));694 pq_release_remote(udp_globals.net_phone, packet_get_id(packet)); 692 695 // return the total length 693 696 return (int) length; … … 695 698 696 699 int udp_release_and_return(packet_t packet, int result){ 697 pq_release (udp_globals.net_phone, packet_get_id(packet));700 pq_release_remote(udp_globals.net_phone, packet_get_id(packet)); 698 701 return result; 699 702 } 700 701 #ifdef CONFIG_NETWORKING_modular702 703 #include <tl_standalone.h>704 703 705 704 /** Default thread for new connections. … … 729 728 730 729 /* Process the message */ 731 int res = tl_module_message(callid, &call, &answer, &answer_count); 730 int res = tl_module_message_standalone(callid, &call, &answer, 731 &answer_count); 732 732 733 733 /* End if said to either by the message or the processing result */ … … 754 754 755 755 /* Start the module */ 756 if (ERROR_OCCURRED(tl_module_start (tl_client_connection)))756 if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection))) 757 757 return ERROR_CODE; 758 758 … … 760 760 } 761 761 762 #endif /* CONFIG_NETWORKING_modular */763 764 762 /** @} 765 763 */ -
uspace/srv/net/tl/udp/udp_module.c
r24ab58b3 r14f1db0 47 47 #include <packet/packet.h> 48 48 #include <net_interface.h> 49 #include <tl_ standalone.h>49 #include <tl_local.h> 50 50 51 51 #include "udp.h" … … 63 63 * @returns Other error codes as defined for the REGISTER_ME() macro function. 64 64 */ 65 int tl_module_start (async_client_conn_t client_connection){65 int tl_module_start_standalone(async_client_conn_t client_connection){ 66 66 ERROR_DECLARE; 67 67 … … 94 94 * @returns Other error codes as defined for the udp_message() function. 95 95 */ 96 int tl_module_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){97 return udp_message (callid, call, answer, answer_count);96 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 97 return udp_message_standalone(callid, call, answer, answer_count); 98 98 } 99 99 -
uspace/srv/net/tl/udp/udp_module.h
r24ab58b3 r14f1db0 59 59 * @see IS_NET_UDP_MESSAGE() 60 60 */ 61 extern int udp_message (ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);61 extern int udp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 62 62 63 63 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
