Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/tl/icmp_remote.c

    r79ae36dd r6b82009  
    3939#include <net/modules.h>
    4040#include <packet_client.h>
    41 
    42 #include <async.h>
    43 #include <async_obsolete.h>
    44 #include <errno.h>
    4541#include <ipc/services.h>
    4642#include <ipc/icmp.h>
    4743#include <sys/types.h>
     44#include <async.h>
     45#include <errno.h>
    4846
    49 /** Sends the Destination Unreachable error notification packet.
     47/** Send the Destination Unreachable error notification packet.
    5048 *
    5149 * Beginning of the packet is sent as the notification packet data.
     
    5351 * packet.
    5452 *
    55  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    56  * @param[in] code      The error specific code.
    57  * @param[in] mtu       The error MTU value.
    58  * @param[in] packet    The original packet.
    59  * @return              EOK on success.
    60  * @return              EPERM if the ICMP error notifications are disabled.
    61  * @return              ENOMEM if there is not enough memory left.
     53 * @param[in] sess   ICMP module session.
     54 * @param[in] code   Error specific code.
     55 * @param[in] mtu    Error MTU value.
     56 * @param[in] packet Original packet.
     57 *
     58 * @return EOK on success.
     59 * @return EPERM if the ICMP error notifications are disabled.
     60 * @return ENOMEM if there is not enough memory left.
     61 *
    6262 */
    63 int
    64 icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code,
     63int icmp_destination_unreachable_msg(async_sess_t *sess, icmp_code_t code,
    6564    icmp_param_t mtu, packet_t *packet)
    6665{
    67         async_obsolete_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
     66        async_exch_t *exch = async_exchange_begin(sess);
     67        async_msg_3(exch, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
    6868            (sysarg_t) packet_get_id(packet), (sysarg_t) mtu);
     69        async_exchange_end(exch);
     70       
    6971        return EOK;
    7072}
    7173
    72 /** Sends the Source Quench error notification packet.
     74/** Send the Source Quench error notification packet.
    7375 *
    7476 * Beginning of the packet is sent as the notification packet data.
     
    7678 * packet.
    7779 *
    78  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    79  * @param[in] packet    The original packet.
    80  * @return              EOK on success.
    81  * @return              EPERM if the ICMP error notifications are disabled.
    82  * @return              ENOMEM if there is not enough memory left.
     80 * @param[in] sess   ICMP module session.
     81 * @param[in] packet Original packet.
     82 *
     83 * @return EOK on success.
     84 * @return EPERM if the ICMP error notifications are disabled.
     85 * @return ENOMEM if there is not enough memory left.
     86 *
    8387 */
    84 int icmp_source_quench_msg(int icmp_phone, packet_t *packet)
     88int icmp_source_quench_msg(async_sess_t *sess, packet_t *packet)
    8589{
    86         async_obsolete_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
     90        async_exch_t *exch = async_exchange_begin(sess);
     91        async_msg_2(exch, NET_ICMP_SOURCE_QUENCH, 0,
    8792            (sysarg_t) packet_get_id(packet));
     93        async_exchange_end(exch);
     94       
    8895        return EOK;
    8996}
    9097
    91 /** Sends the Time Exceeded error notification packet.
     98/** Send the Time Exceeded error notification packet.
    9299 *
    93100 * Beginning of the packet is sent as the notification packet data.
     
    95102 * packet.
    96103 *
    97  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    98  * @param[in] code      The error specific code.
    99  * @param[in] packet    The original packet.
    100  * @return              EOK on success.
    101  * @return              EPERM if the ICMP error notifications are disabled.
    102  * @return              ENOMEM if there is not enough memory left.
     104 * @param[in] sess   ICMP module session.
     105 * @param[in] code   Error specific code.
     106 * @param[in] packet Original packet.
     107 *
     108 * @return EOK on success.
     109 * @return EPERM if the ICMP error notifications are disabled.
     110 * @return ENOMEM if there is not enough memory left.
     111 *
    103112 */
    104 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
     113int icmp_time_exceeded_msg(async_sess_t *sess, icmp_code_t code,
     114    packet_t *packet)
    105115{
    106         async_obsolete_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
     116        async_exch_t *exch = async_exchange_begin(sess);
     117        async_msg_2(exch, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
    107118            (sysarg_t) packet_get_id(packet));
     119        async_exchange_end(exch);
     120       
    108121        return EOK;
    109122}
    110123
    111 /** Sends the Parameter Problem error notification packet.
     124/** Send the Parameter Problem error notification packet.
    112125 *
    113126 * Beginning of the packet is sent as the notification packet data.
     
    115128 * packet.
    116129 *
    117  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    118  * @param[in] code      The error specific code.
    119  * @param[in] pointer   The problematic parameter offset.
    120  * @param[in] packet    The original packet.
    121  * @return              EOK on success.
    122  * @return              EPERM if the ICMP error notifications are disabled.
    123  * @return              ENOMEM if there is not enough memory left.
     130 * @param[in] sess    ICMP module session.
     131 * @param[in] code    Error specific code.
     132 * @param[in] pointer Problematic parameter offset.
     133 * @param[in] packet  Original packet.
     134 *
     135 * @return EOK on success.
     136 * @return EPERM if the ICMP error notifications are disabled.
     137 * @return ENOMEM if there is not enough memory left.
     138 *
    124139 */
    125 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
     140int icmp_parameter_problem_msg(async_sess_t *sess, icmp_code_t code,
    126141    icmp_param_t pointer, packet_t *packet)
    127142{
    128         async_obsolete_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
     143        async_exch_t *exch = async_exchange_begin(sess);
     144        async_msg_3(exch, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
    129145            (sysarg_t) packet_get_id(packet), (sysarg_t) pointer);
     146        async_exchange_end(exch);
     147       
    130148        return EOK;
    131149}
     
    133151/** @}
    134152 */
    135 
Note: See TracChangeset for help on using the changeset viewer.