Changeset 89c57b6 in mainline for uspace/lib/net/tl/icmp_remote.c


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup icmp
     29/** @addtogroup libnet
    3030 *  @{
    3131 */
    3232
    3333/** @file
    34  *  ICMP interface implementation for remote modules.
    35  *  @see icmp_interface.h
     34 * ICMP interface implementation for remote modules.
     35 * @see icmp_remote.h
    3636 */
     37
     38#include <icmp_remote.h>
     39#include <net/modules.h>
     40#include <packet_client.h>
    3741
    3842#include <async.h>
    3943#include <errno.h>
    40 #include <ipc/ipc.h>
    4144#include <ipc/services.h>
     45#include <ipc/icmp.h>
    4246#include <sys/types.h>
    4347
    44 #include <net_messages.h>
    45 #include <net_modules.h>
    46 #include <icmp_interface.h>
    47 #include <packet/packet_client.h>
    48 #include <icmp_messages.h>
    49 
    50 int icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet){
    51         async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (ipcarg_t) code, (ipcarg_t) packet_get_id(packet), (ipcarg_t) mtu);
     48/** Sends the Destination Unreachable error notification packet.
     49 *
     50 * Beginning of the packet is sent as the notification packet data.
     51 * The source and the destination addresses should be set in the original
     52 * packet.
     53 *
     54 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
     55 * @param[in] code      The error specific code.
     56 * @param[in] mtu       The error MTU value.
     57 * @param[in] packet    The original packet.
     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 */
     62int
     63icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code,
     64    icmp_param_t mtu, packet_t *packet)
     65{
     66        async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
     67            (sysarg_t) packet_get_id(packet), (sysarg_t) mtu);
    5268        return EOK;
    5369}
    5470
    55 int icmp_source_quench_msg(int icmp_phone, packet_t packet){
    56         async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0, (ipcarg_t) packet_get_id(packet));
     71/** Sends the Source Quench error notification packet.
     72 *
     73 * Beginning of the packet is sent as the notification packet data.
     74 * The source and the destination addresses should be set in the original
     75 * packet.
     76 *
     77 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
     78 * @param[in] packet    The original packet.
     79 * @return              EOK on success.
     80 * @return              EPERM if the ICMP error notifications are disabled.
     81 * @return              ENOMEM if there is not enough memory left.
     82 */
     83int icmp_source_quench_msg(int icmp_phone, packet_t *packet)
     84{
     85        async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
     86            (sysarg_t) packet_get_id(packet));
    5787        return EOK;
    5888}
    5989
    60 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet){
    61         async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (ipcarg_t) code, (ipcarg_t) packet_get_id(packet));
     90/** Sends the Time Exceeded error notification packet.
     91 *
     92 * Beginning of the packet is sent as the notification packet data.
     93 * The source and the destination addresses should be set in the original
     94 * packet.
     95 *
     96 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
     97 * @param[in] code      The error specific code.
     98 * @param[in] packet    The original packet.
     99 * @return              EOK on success.
     100 * @return              EPERM if the ICMP error notifications are disabled.
     101 * @return              ENOMEM if there is not enough memory left.
     102 */
     103int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
     104{
     105        async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
     106            (sysarg_t) packet_get_id(packet));
    62107        return EOK;
    63108}
    64109
    65 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, icmp_param_t pointer, packet_t packet){
    66         async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (ipcarg_t) code, (ipcarg_t) packet_get_id(packet), (ipcarg_t) pointer);
     110/** Sends the Parameter Problem error notification packet.
     111 *
     112 * Beginning of the packet is sent as the notification packet data.
     113 * The source and the destination addresses should be set in the original
     114 * packet.
     115 *
     116 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
     117 * @param[in] code      The error specific code.
     118 * @param[in] pointer   The problematic parameter offset.
     119 * @param[in] packet    The original packet.
     120 * @return              EOK on success.
     121 * @return              EPERM if the ICMP error notifications are disabled.
     122 * @return              ENOMEM if there is not enough memory left.
     123 */
     124int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
     125    icmp_param_t pointer, packet_t *packet)
     126{
     127        async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
     128            (sysarg_t) packet_get_id(packet), (sysarg_t) pointer);
    67129        return EOK;
    68130}
     
    70132/** @}
    71133 */
     134
Note: See TracChangeset for help on using the changeset viewer.