Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/udp/udp.c

    r46d4d9f rfb04cba8  
    9797 * @param[in] client_connection The client connection processing function. The
    9898 *                      module skeleton propagates its own one.
    99  * @return              EOK on success.
    100  * @return              ENOMEM if there is not enough memory left.
     99 * @returns             EOK on success.
     100 * @returns             ENOMEM if there is not enough memory left.
    101101 */
    102102int udp_initialize(async_client_conn_t client_connection)
     
    112112                }
    113113        };
    114         measured_string_t *configuration;
     114        measured_string_ref configuration;
    115115        size_t count = sizeof(names) / sizeof(measured_string_t);
    116116        char *data;
     
    190190 * @return              The result parameter.
    191191 */
    192 static int udp_release_and_return(packet_t *packet, int result)
     192static int udp_release_and_return(packet_t packet, int result)
    193193{
    194194        pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
     
    205205 * @param[in] error     The packet error reporting service. Prefixes the
    206206 *                      received packet.
    207  * @return              EOK on success.
    208  * @return              EINVAL if the packet is not valid.
    209  * @return              EINVAL if the stored packet address is not the
     207 * @returns             EOK on success.
     208 * @returns             EINVAL if the packet is not valid.
     209 * @returns             EINVAL if the stored packet address is not the
    210210 *                      an_addr_t.
    211  * @return              EINVAL if the packet does not contain any data.
    212  * @return              NO_DATA if the packet content is shorter than the user
     211 * @returns             EINVAL if the packet does not contain any data.
     212 * @returns             NO_DATA if the packet content is shorter than the user
    213213 *                      datagram header.
    214  * @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
     214 * @returns             ENOMEM if there is not enough memory left.
     215 * @returns             EADDRNOTAVAIL if the destination socket does not exist.
     216 * @returns             Other error codes as defined for the
    217217 *                      ip_client_process_packet() function.
    218218 */
    219 static int udp_process_packet(device_id_t device_id, packet_t *packet,
     219static int udp_process_packet(device_id_t device_id, packet_t packet,
    220220    services_t error)
    221221{
     
    223223        size_t offset;
    224224        int result;
    225         udp_header_t *header;
    226         socket_core_t *socket;
    227         packet_t *next_packet;
     225        udp_header_ref header;
     226        socket_core_ref socket;
     227        packet_t next_packet;
    228228        size_t total_length;
    229229        uint32_t checksum;
    230230        int fragments;
    231         packet_t *tmp_packet;
     231        packet_t tmp_packet;
    232232        icmp_type_t type;
    233233        icmp_code_t code;
     
    235235        struct sockaddr *src;
    236236        struct sockaddr *dest;
    237         packet_dimension_t *packet_dimension;
     237        packet_dimension_ref packet_dimension;
    238238        int rc;
    239239
     
    277277
    278278        /* Get UDP header */
    279         header = (udp_header_t *) packet_get_data(packet);
     279        header = (udp_header_ref) packet_get_data(packet);
    280280        if (!header)
    281281                return udp_release_and_return(packet, NO_DATA);
     
    409409 * @param[in] error     The packet error reporting service. Prefixes the
    410410 *                      received packet.
    411  * @return              EOK on success.
    412  * @return              Other error codes as defined for the
     411 * @returns             EOK on success.
     412 * @returns             Other error codes as defined for the
    413413 *                      udp_process_packet() function.
    414414 */
    415 static int udp_received_msg(device_id_t device_id, packet_t *packet,
     415static int udp_received_msg(device_id_t device_id, packet_t packet,
    416416    services_t receiver, services_t error)
    417417{
     
    439439 * @param[out] data_fragment_size The data fragment size in bytes.
    440440 * @param[in] flags     Various send flags.
    441  * @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
     441 * @returns             EOK on success.
     442 * @returns             EAFNOTSUPPORT if the address family is not supported.
     443 * @returns             ENOTSOCK if the socket is not found.
     444 * @returns             EINVAL if the address is invalid.
     445 * @returns             ENOTCONN if the sending socket is not and cannot be
    446446 *                      bound.
    447  * @return              ENOMEM if there is not enough memory left.
    448  * @return              Other error codes as defined for the
     447 * @returns             ENOMEM if there is not enough memory left.
     448 * @returns             Other error codes as defined for the
    449449 *                      socket_read_packet_data() function.
    450  * @return              Other error codes as defined for the
     450 * @returns             Other error codes as defined for the
    451451 *                      ip_client_prepare_packet() function.
    452  * @return              Other error codes as defined for the ip_send_msg()
     452 * @returns             Other error codes as defined for the ip_send_msg()
    453453 *                      function.
    454454 */
    455 static int udp_sendto_message(socket_cores_t *local_sockets, int socket_id,
     455static int udp_sendto_message(socket_cores_ref local_sockets, int socket_id,
    456456    const struct sockaddr *addr, socklen_t addrlen, int fragments,
    457457    size_t *data_fragment_size, int flags)
    458458{
    459         socket_core_t *socket;
    460         packet_t *packet;
    461         packet_t *next_packet;
    462         udp_header_t *header;
     459        socket_core_ref socket;
     460        packet_t packet;
     461        packet_t next_packet;
     462        udp_header_ref header;
    463463        int index;
    464464        size_t total_length;
     
    469469        size_t headerlen;
    470470        device_id_t device_id;
    471         packet_dimension_t *packet_dimension;
     471        packet_dimension_ref packet_dimension;
    472472        int rc;
    473473       
     
    599599 * @param[in] flags     Various receive flags.
    600600 * @param[out] addrlen  The source address length.
    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()
     601 * @returns             The number of bytes received.
     602 * @returns             ENOTSOCK if the socket is not found.
     603 * @returns             NO_DATA if there are no received packets or data.
     604 * @returns             ENOMEM if there is not enough memory left.
     605 * @returns             EINVAL if the received address is not an IP address.
     606 * @returns             Other error codes as defined for the packet_translate()
    607607 *                      function.
    608  * @return              Other error codes as defined for the data_reply()
     608 * @returns             Other error codes as defined for the data_reply()
    609609 *                      function.
    610610 */
    611 static int udp_recvfrom_message(socket_cores_t *local_sockets, int socket_id,
     611static int udp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
    612612    int flags, size_t *addrlen)
    613613{
    614         socket_core_t *socket;
     614        socket_core_ref socket;
    615615        int packet_id;
    616         packet_t *packet;
    617         udp_header_t *header;
     616        packet_t packet;
     617        udp_header_ref header;
    618618        struct sockaddr *addr;
    619619        size_t length;
     
    644644                return udp_release_and_return(packet, NO_DATA);
    645645        }
    646         header = (udp_header_t *) data;
     646        header = (udp_header_ref) data;
    647647
    648648        /* Set the source address port */
     
    698698 * @param[in] callid    The message identifier.
    699699 * @param[in] call      The message parameters.
    700  * @return              EOK on success.
     700 * @returns             EOK on success.
    701701 *
    702702 * @see socket.h
     
    714714        ipc_call_t answer;
    715715        int answer_count;
    716         packet_dimension_t *packet_dimension;
     716        packet_dimension_ref packet_dimension;
    717717
    718718        /*
     
    852852 * @param[out] answer_count The last parameter for the actual answer in the
    853853 *                      answer parameter.
    854  * @return              EOK on success.
    855  * @return              ENOTSUP if the message is not known.
     854 * @returns             EOK on success.
     855 * @returns             ENOTSUP if the message is not known.
    856856 *
    857857 * @see udp_interface.h
     
    861861    ipc_call_t *answer, int *answer_count)
    862862{
    863         packet_t *packet;
     863        packet_t packet;
    864864        int rc;
    865865
     
    924924/** Starts the module.
    925925 *
    926  * @return              EOK on success.
    927  * @return              Other error codes as defined for each specific module
     926 * @returns             EOK on success.
     927 * @returns             Other error codes as defined for each specific module
    928928 *                      start function.
    929929 */
Note: See TracChangeset for help on using the changeset viewer.