Changeset f4f866c in mainline for uspace/srv/net/tl/udp/udp.c
- Timestamp:
- 2010-04-23T21:42:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6c39a907
- Parents:
- 38aaacc2 (diff), 80badbe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp.c
r38aaacc2 rf4f866c 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 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 */ … … 753 753 ERROR_DECLARE; 754 754 755 /* Print the module label */756 printf("Task %d - %s\n", task_get_id(), NAME);757 758 755 /* Start the module */ 759 if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) { 760 printf(" - ERROR %i\n", ERROR_CODE); 756 if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection))) 761 757 return ERROR_CODE; 762 }763 758 764 759 return EOK; 765 760 } 766 761 767 #endif /* CONFIG_NETWORKING_modular */768 769 762 /** @} 770 763 */
Note:
See TracChangeset
for help on using the changeset viewer.