Changes in uspace/srv/net/tl/udp/udp.c [348c589:014dd57b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp.c
r348c589 r014dd57b 40 40 #include <malloc.h> 41 41 #include <stdio.h> 42 #include <ipc/ipc.h> 42 43 #include <ipc/services.h> 43 44 #include <ipc/net.h> … … 60 61 #include <ip_interface.h> 61 62 #include <icmp_client.h> 62 #include <icmp_ remote.h>63 #include <icmp_interface.h> 63 64 #include <net_interface.h> 64 65 #include <socket_core.h> … … 353 354 SERVICE_UDP, IPC_GET_ERROR(*icall)); 354 355 355 async_answer_0(iid, (sysarg_t) rc);356 ipc_answer_0(iid, (sysarg_t) rc); 356 357 break; 357 358 default: 358 async_answer_0(iid, (sysarg_t) ENOTSUP);359 ipc_answer_0(iid, (sysarg_t) ENOTSUP); 359 360 } 360 361 … … 392 393 udp_globals.net_phone = net_phone; 393 394 394 udp_globals.icmp_phone = icmp_connect_module(ICMP_CONNECT_TIMEOUT); 395 udp_globals.icmp_phone = icmp_connect_module(SERVICE_ICMP, 396 ICMP_CONNECT_TIMEOUT); 395 397 396 398 udp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_UDP, … … 417 419 rc = packet_dimensions_initialize(&udp_globals.dimensions); 418 420 if (rc != EOK) { 419 socket_ports_destroy(&udp_globals.sockets , free);421 socket_ports_destroy(&udp_globals.sockets); 420 422 fibril_rwlock_write_unlock(&udp_globals.lock); 421 423 return rc; … … 434 436 &data); 435 437 if (rc != EOK) { 436 socket_ports_destroy(&udp_globals.sockets , free);438 socket_ports_destroy(&udp_globals.sockets); 437 439 fibril_rwlock_write_unlock(&udp_globals.lock); 438 440 return rc; … … 499 501 device_id_t device_id; 500 502 packet_dimension_t *packet_dimension; 501 size_t size;502 503 int rc; 503 504 /* In case of error, do not update the data fragment size. */505 *data_fragment_size = 0;506 504 507 505 rc = tl_get_address_port(addr, addrlen, &dest_port); … … 543 541 packet_dimension = &udp_globals.packet_dimension; 544 542 // } 545 546 /*547 * Update the data fragment size based on what the lower layers can548 * handle without fragmentation, but not more than the maximum allowed549 * for UDP.550 */551 size = MAX_UDP_FRAGMENT_SIZE;552 if (packet_dimension->content < size)553 size = packet_dimension->content;554 *data_fragment_size = size;555 543 556 544 /* Read the first packet fragment */ … … 800 788 break; 801 789 802 size = MAX_UDP_FRAGMENT_SIZE;803 790 if (tl_get_ip_packet_dimension(udp_globals.ip_phone, 804 791 &udp_globals.dimensions, DEVICE_INVALID_ID, 805 792 &packet_dimension) == EOK) { 806 if (packet_dimension->content < size)807 size = packet_dimension->content;793 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, 794 packet_dimension->content); 808 795 } 809 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size); 796 797 // SOCKET_SET_DATA_FRAGMENT_SIZE(answer, 798 // MAX_UDP_FRAGMENT_SIZE); 810 799 SOCKET_SET_HEADER_SIZE(answer, UDP_HEADER_SIZE); 811 800 answer_count = 3; … … 880 869 881 870 /* Release the application phone */ 882 async_hangup(app_phone);871 ipc_hangup(app_phone); 883 872 884 873 /* Release all local sockets */ … … 887 876 888 877 return res; 889 }890 891 /** Per-connection initialization892 *893 */894 void tl_connection(void)895 {896 878 } 897 879 … … 909 891 * @see IS_NET_UDP_MESSAGE() 910 892 */ 911 int tl_m essage(ipc_callid_t callid, ipc_call_t *call,893 int tl_module_message(ipc_callid_t callid, ipc_call_t *call, 912 894 ipc_call_t *answer, size_t *answer_count) 913 895 {
Note:
See TracChangeset
for help on using the changeset viewer.