Changes in uspace/srv/net/tl/udp/udp.c [fb04cba8:46d4d9f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp.c
rfb04cba8 r46d4d9f 97 97 * @param[in] client_connection The client connection processing function. The 98 98 * module skeleton propagates its own one. 99 * @return sEOK on success.100 * @return sENOMEM if there is not enough memory left.99 * @return EOK on success. 100 * @return ENOMEM if there is not enough memory left. 101 101 */ 102 102 int udp_initialize(async_client_conn_t client_connection) … … 112 112 } 113 113 }; 114 measured_string_ refconfiguration;114 measured_string_t *configuration; 115 115 size_t count = sizeof(names) / sizeof(measured_string_t); 116 116 char *data; … … 190 190 * @return The result parameter. 191 191 */ 192 static int udp_release_and_return(packet_t packet, int result)192 static int udp_release_and_return(packet_t *packet, int result) 193 193 { 194 194 pq_release_remote(udp_globals.net_phone, packet_get_id(packet)); … … 205 205 * @param[in] error The packet error reporting service. Prefixes the 206 206 * received packet. 207 * @return sEOK on success.208 * @return sEINVAL if the packet is not valid.209 * @return sEINVAL if the stored packet address is not the207 * @return EOK on success. 208 * @return EINVAL if the packet is not valid. 209 * @return EINVAL if the stored packet address is not the 210 210 * an_addr_t. 211 * @return sEINVAL if the packet does not contain any data.212 * @return sNO_DATA if the packet content is shorter than the user211 * @return EINVAL if the packet does not contain any data. 212 * @return NO_DATA if the packet content is shorter than the user 213 213 * datagram header. 214 * @return sENOMEM if there is not enough memory left.215 * @return sEADDRNOTAVAIL if the destination socket does not exist.216 * @return sOther error codes as defined for the214 * @return ENOMEM if there is not enough memory left. 215 * @return EADDRNOTAVAIL if the destination socket does not exist. 216 * @return Other error codes as defined for the 217 217 * ip_client_process_packet() function. 218 218 */ 219 static int udp_process_packet(device_id_t device_id, packet_t packet,219 static int udp_process_packet(device_id_t device_id, packet_t *packet, 220 220 services_t error) 221 221 { … … 223 223 size_t offset; 224 224 int result; 225 udp_header_ refheader;226 socket_core_ refsocket;227 packet_t next_packet;225 udp_header_t *header; 226 socket_core_t *socket; 227 packet_t *next_packet; 228 228 size_t total_length; 229 229 uint32_t checksum; 230 230 int fragments; 231 packet_t tmp_packet;231 packet_t *tmp_packet; 232 232 icmp_type_t type; 233 233 icmp_code_t code; … … 235 235 struct sockaddr *src; 236 236 struct sockaddr *dest; 237 packet_dimension_ refpacket_dimension;237 packet_dimension_t *packet_dimension; 238 238 int rc; 239 239 … … 277 277 278 278 /* Get UDP header */ 279 header = (udp_header_ ref) packet_get_data(packet);279 header = (udp_header_t *) packet_get_data(packet); 280 280 if (!header) 281 281 return udp_release_and_return(packet, NO_DATA); … … 409 409 * @param[in] error The packet error reporting service. Prefixes the 410 410 * received packet. 411 * @return sEOK on success.412 * @return sOther error codes as defined for the411 * @return EOK on success. 412 * @return Other error codes as defined for the 413 413 * udp_process_packet() function. 414 414 */ 415 static int udp_received_msg(device_id_t device_id, packet_t packet,415 static int udp_received_msg(device_id_t device_id, packet_t *packet, 416 416 services_t receiver, services_t error) 417 417 { … … 439 439 * @param[out] data_fragment_size The data fragment size in bytes. 440 440 * @param[in] flags Various send flags. 441 * @return sEOK on success.442 * @return sEAFNOTSUPPORT if the address family is not supported.443 * @return sENOTSOCK if the socket is not found.444 * @return sEINVAL if the address is invalid.445 * @return sENOTCONN if the sending socket is not and cannot be441 * @return EOK on success. 442 * @return EAFNOTSUPPORT if the address family is not supported. 443 * @return ENOTSOCK if the socket is not found. 444 * @return EINVAL if the address is invalid. 445 * @return ENOTCONN if the sending socket is not and cannot be 446 446 * bound. 447 * @return sENOMEM if there is not enough memory left.448 * @return sOther error codes as defined for the447 * @return ENOMEM if there is not enough memory left. 448 * @return Other error codes as defined for the 449 449 * socket_read_packet_data() function. 450 * @return sOther error codes as defined for the450 * @return Other error codes as defined for the 451 451 * ip_client_prepare_packet() function. 452 * @return sOther error codes as defined for the ip_send_msg()452 * @return Other error codes as defined for the ip_send_msg() 453 453 * function. 454 454 */ 455 static int udp_sendto_message(socket_cores_ reflocal_sockets, int socket_id,455 static int udp_sendto_message(socket_cores_t *local_sockets, int socket_id, 456 456 const struct sockaddr *addr, socklen_t addrlen, int fragments, 457 457 size_t *data_fragment_size, int flags) 458 458 { 459 socket_core_ refsocket;460 packet_t packet;461 packet_t next_packet;462 udp_header_ refheader;459 socket_core_t *socket; 460 packet_t *packet; 461 packet_t *next_packet; 462 udp_header_t *header; 463 463 int index; 464 464 size_t total_length; … … 469 469 size_t headerlen; 470 470 device_id_t device_id; 471 packet_dimension_ refpacket_dimension;471 packet_dimension_t *packet_dimension; 472 472 int rc; 473 473 … … 599 599 * @param[in] flags Various receive flags. 600 600 * @param[out] addrlen The source address length. 601 * @return sThe number of bytes received.602 * @return sENOTSOCK if the socket is not found.603 * @return sNO_DATA if there are no received packets or data.604 * @return sENOMEM if there is not enough memory left.605 * @return sEINVAL if the received address is not an IP address.606 * @return sOther error codes as defined for the packet_translate()601 * @return The number of bytes received. 602 * @return ENOTSOCK if the socket is not found. 603 * @return NO_DATA if there are no received packets or data. 604 * @return ENOMEM if there is not enough memory left. 605 * @return EINVAL if the received address is not an IP address. 606 * @return Other error codes as defined for the packet_translate() 607 607 * function. 608 * @return sOther error codes as defined for the data_reply()608 * @return Other error codes as defined for the data_reply() 609 609 * function. 610 610 */ 611 static int udp_recvfrom_message(socket_cores_ reflocal_sockets, int socket_id,611 static int udp_recvfrom_message(socket_cores_t *local_sockets, int socket_id, 612 612 int flags, size_t *addrlen) 613 613 { 614 socket_core_ refsocket;614 socket_core_t *socket; 615 615 int packet_id; 616 packet_t packet;617 udp_header_ refheader;616 packet_t *packet; 617 udp_header_t *header; 618 618 struct sockaddr *addr; 619 619 size_t length; … … 644 644 return udp_release_and_return(packet, NO_DATA); 645 645 } 646 header = (udp_header_ ref) data;646 header = (udp_header_t *) data; 647 647 648 648 /* Set the source address port */ … … 698 698 * @param[in] callid The message identifier. 699 699 * @param[in] call The message parameters. 700 * @return sEOK on success.700 * @return EOK on success. 701 701 * 702 702 * @see socket.h … … 714 714 ipc_call_t answer; 715 715 int answer_count; 716 packet_dimension_ refpacket_dimension;716 packet_dimension_t *packet_dimension; 717 717 718 718 /* … … 852 852 * @param[out] answer_count The last parameter for the actual answer in the 853 853 * answer parameter. 854 * @return sEOK on success.855 * @return sENOTSUP if the message is not known.854 * @return EOK on success. 855 * @return ENOTSUP if the message is not known. 856 856 * 857 857 * @see udp_interface.h … … 861 861 ipc_call_t *answer, int *answer_count) 862 862 { 863 packet_t packet;863 packet_t *packet; 864 864 int rc; 865 865 … … 924 924 /** Starts the module. 925 925 * 926 * @return sEOK on success.927 * @return sOther error codes as defined for each specific module926 * @return EOK on success. 927 * @return Other error codes as defined for each specific module 928 928 * start function. 929 929 */
Note:
See TracChangeset
for help on using the changeset viewer.