Ignore:
File:
1 edited

Legend:

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

    r6b82009 r79ae36dd  
    3939#include <net/modules.h>
    4040#include <packet_client.h>
     41
     42#include <async.h>
     43#include <async_obsolete.h>
     44#include <errno.h>
    4145#include <ipc/services.h>
    4246#include <ipc/icmp.h>
    4347#include <sys/types.h>
    44 #include <async.h>
    45 #include <errno.h>
    4648
    47 /** Send the Destination Unreachable error notification packet.
     49/** Sends the Destination Unreachable error notification packet.
    4850 *
    4951 * Beginning of the packet is sent as the notification packet data.
     
    5153 * packet.
    5254 *
    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  *
     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.
    6262 */
    63 int icmp_destination_unreachable_msg(async_sess_t *sess, icmp_code_t code,
     63int
     64icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code,
    6465    icmp_param_t mtu, packet_t *packet)
    6566{
    66         async_exch_t *exch = async_exchange_begin(sess);
    67         async_msg_3(exch, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
     67        async_obsolete_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
    6868            (sysarg_t) packet_get_id(packet), (sysarg_t) mtu);
    69         async_exchange_end(exch);
    70        
    7169        return EOK;
    7270}
    7371
    74 /** Send the Source Quench error notification packet.
     72/** Sends the Source Quench error notification packet.
    7573 *
    7674 * Beginning of the packet is sent as the notification packet data.
     
    7876 * packet.
    7977 *
    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  *
     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.
    8783 */
    88 int icmp_source_quench_msg(async_sess_t *sess, packet_t *packet)
     84int icmp_source_quench_msg(int icmp_phone, packet_t *packet)
    8985{
    90         async_exch_t *exch = async_exchange_begin(sess);
    91         async_msg_2(exch, NET_ICMP_SOURCE_QUENCH, 0,
     86        async_obsolete_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
    9287            (sysarg_t) packet_get_id(packet));
    93         async_exchange_end(exch);
    94        
    9588        return EOK;
    9689}
    9790
    98 /** Send the Time Exceeded error notification packet.
     91/** Sends the Time Exceeded error notification packet.
    9992 *
    10093 * Beginning of the packet is sent as the notification packet data.
     
    10295 * packet.
    10396 *
    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  *
     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.
    112103 */
    113 int icmp_time_exceeded_msg(async_sess_t *sess, icmp_code_t code,
    114     packet_t *packet)
     104int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
    115105{
    116         async_exch_t *exch = async_exchange_begin(sess);
    117         async_msg_2(exch, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
     106        async_obsolete_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
    118107            (sysarg_t) packet_get_id(packet));
    119         async_exchange_end(exch);
    120        
    121108        return EOK;
    122109}
    123110
    124 /** Send the Parameter Problem error notification packet.
     111/** Sends the Parameter Problem error notification packet.
    125112 *
    126113 * Beginning of the packet is sent as the notification packet data.
     
    128115 * packet.
    129116 *
    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  *
     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.
    139124 */
    140 int icmp_parameter_problem_msg(async_sess_t *sess, icmp_code_t code,
     125int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
    141126    icmp_param_t pointer, packet_t *packet)
    142127{
    143         async_exch_t *exch = async_exchange_begin(sess);
    144         async_msg_3(exch, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
     128        async_obsolete_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
    145129            (sysarg_t) packet_get_id(packet), (sysarg_t) pointer);
    146         async_exchange_end(exch);
    147        
    148130        return EOK;
    149131}
     
    151133/** @}
    152134 */
     135
Note: See TracChangeset for help on using the changeset viewer.