Changes in uspace/srv/net/tl/udp/udp.c [14f1db0:849ed54] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp.c
r14f1db0 r849ed54 48 48 #include <adt/dynamic_fifo.h> 49 49 #include <packet/packet_client.h> 50 #include <packet_remote.h>51 50 #include <net_checksum.h> 52 51 #include <in.h> … … 64 63 #include <socket_messages.h> 65 64 #include <tl_common.h> 66 #include <tl_local.h>67 #include <tl_interface.h>68 65 #include <tl_messages.h> 69 66 … … 261 258 icmp_type_t type; 262 259 icmp_code_t code; 263 void *ip_header;260 ip_pseudo_header_ref ip_header; 264 261 struct sockaddr * src; 265 262 struct sockaddr * dest; … … 359 356 while(tmp_packet){ 360 357 next_packet = pq_detach(tmp_packet); 361 pq_release _remote(udp_globals.net_phone, packet_get_id(tmp_packet));358 pq_release(udp_globals.net_phone, packet_get_id(tmp_packet)); 362 359 tmp_packet = next_packet; 363 360 } … … 385 382 // queue the received packet 386 383 if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE)) 387 384 || ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){ 388 385 return udp_release_and_return(packet, ERROR_CODE); 389 386 } … … 395 392 } 396 393 397 int udp_message _standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){394 int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 398 395 ERROR_DECLARE; 399 396 … … 403 400 switch(IPC_GET_METHOD(*call)){ 404 401 case NET_TL_RECEIVED: 405 if(! ERROR_OCCURRED(packet_translate _remote(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){402 if(! ERROR_OCCURRED(packet_translate(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){ 406 403 ERROR_CODE = udp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_UDP, IPC_GET_ERROR(call)); 407 404 } … … 460 457 461 458 if(res == EOK){ 462 if 459 if(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){ 463 460 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, packet_dimension->content); 464 461 } … … 536 533 uint16_t dest_port; 537 534 uint32_t checksum; 538 void *ip_header;535 ip_pseudo_header_ref ip_header; 539 536 size_t headerlen; 540 537 device_id_t device_id; … … 665 662 return NO_DATA; 666 663 } 667 ERROR_PROPAGATE(packet_translate _remote(udp_globals.net_phone, &packet, packet_id));664 ERROR_PROPAGATE(packet_translate(udp_globals.net_phone, &packet, packet_id)); 668 665 // get udp header 669 666 data = packet_get_data(packet); 670 667 if(! data){ 671 pq_release _remote(udp_globals.net_phone, packet_id);668 pq_release(udp_globals.net_phone, packet_id); 672 669 return NO_DATA; 673 670 } … … 677 674 result = packet_get_addr(packet, (uint8_t **) &addr, NULL); 678 675 if(ERROR_OCCURRED(tl_set_address_port(addr, result, ntohs(header->source_port)))){ 679 pq_release _remote(udp_globals.net_phone, packet_id);676 pq_release(udp_globals.net_phone, packet_id); 680 677 return ERROR_CODE; 681 678 } … … 692 689 // release the packet 693 690 dyn_fifo_pop(&socket->received); 694 pq_release _remote(udp_globals.net_phone, packet_get_id(packet));691 pq_release(udp_globals.net_phone, packet_get_id(packet)); 695 692 // return the total length 696 693 return (int) length; … … 698 695 699 696 int udp_release_and_return(packet_t packet, int result){ 700 pq_release _remote(udp_globals.net_phone, packet_get_id(packet));697 pq_release(udp_globals.net_phone, packet_get_id(packet)); 701 698 return result; 702 699 } 700 701 #ifdef CONFIG_NETWORKING_modular 702 703 #include <tl_standalone.h> 703 704 704 705 /** Default thread for new connections. … … 728 729 729 730 /* Process the message */ 730 int res = tl_module_message_standalone(callid, &call, &answer, 731 &answer_count); 731 int res = tl_module_message(callid, &call, &answer, &answer_count); 732 732 733 733 /* End if said to either by the message or the processing result */ … … 753 753 ERROR_DECLARE; 754 754 755 /* Print the module label */ 756 printf("Task %d - %s\n", task_get_id(), NAME); 757 755 758 /* Start the module */ 756 if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection))) 759 if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) { 760 printf(" - ERROR %i\n", ERROR_CODE); 757 761 return ERROR_CODE; 762 } 758 763 759 764 return EOK; 760 765 } 761 766 767 #endif /* CONFIG_NETWORKING_modular */ 768 762 769 /** @} 763 770 */
Note:
See TracChangeset
for help on using the changeset viewer.