Changeset 4687a26c in mainline for uspace/lib/net/tl/icmp_remote.c
- Timestamp:
- 2010-11-02T18:29:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 4f35b9ff
- Parents:
- 76e1121f (diff), 28f4adb (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/tl/icmp_remote.c
r76e1121f r4687a26c 27 27 */ 28 28 29 /** @addtogroup icmp29 /** @addtogroup libnet 30 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 35 * 34 * ICMP interface implementation for remote modules. 35 * @see icmp_interface.h 36 36 */ 37 38 #include <icmp_interface.h> 39 #include <net/modules.h> 40 #include <packet_client.h> 37 41 38 42 #include <async.h> … … 40 44 #include <ipc/ipc.h> 41 45 #include <ipc/services.h> 46 #include <ipc/icmp.h> 42 47 #include <sys/types.h> 43 48 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); 49 /** Sends the Destination Unreachable error notification packet. 50 * 51 * Beginning of the packet is sent as the notification packet data. 52 * The source and the destination addresses should be set in the original 53 * packet. 54 * 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 * @returns EOK on success. 60 * @returns EPERM if the ICMP error notifications are disabled. 61 * @returns ENOMEM if there is not enough memory left. 62 */ 63 int 64 icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, 65 icmp_param_t mtu, packet_t packet) 66 { 67 async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (ipcarg_t) code, 68 (ipcarg_t) packet_get_id(packet), (ipcarg_t) mtu); 52 69 return EOK; 53 70 } 54 71 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)); 72 /** Sends the Source Quench error notification packet. 73 * 74 * Beginning of the packet is sent as the notification packet data. 75 * The source and the destination addresses should be set in the original 76 * packet. 77 * 78 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls. 79 * @param[in] packet The original packet. 80 * @returns EOK on success. 81 * @returns EPERM if the ICMP error notifications are disabled. 82 * @returns ENOMEM if there is not enough memory left. 83 */ 84 int icmp_source_quench_msg(int icmp_phone, packet_t packet) 85 { 86 async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0, 87 (ipcarg_t) packet_get_id(packet)); 57 88 return EOK; 58 89 } 59 90 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)); 91 /** Sends the Time Exceeded error notification packet. 92 * 93 * Beginning of the packet is sent as the notification packet data. 94 * The source and the destination addresses should be set in the original 95 * packet. 96 * 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 * @returns EOK on success. 101 * @returns EPERM if the ICMP error notifications are disabled. 102 * @returns ENOMEM if there is not enough memory left. 103 */ 104 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet) 105 { 106 async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (ipcarg_t) code, 107 (ipcarg_t) packet_get_id(packet)); 62 108 return EOK; 63 109 } 64 110 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); 111 /** Sends the Parameter Problem error notification packet. 112 * 113 * Beginning of the packet is sent as the notification packet data. 114 * The source and the destination addresses should be set in the original 115 * packet. 116 * 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 * @returns EOK on success. 122 * @returns EPERM if the ICMP error notifications are disabled. 123 * @returns ENOMEM if there is not enough memory left. 124 */ 125 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, 126 icmp_param_t pointer, packet_t packet) 127 { 128 async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (ipcarg_t) code, 129 (ipcarg_t) packet_get_id(packet), (ipcarg_t) pointer); 67 130 return EOK; 68 131 } … … 70 133 /** @} 71 134 */ 135
Note:
See TracChangeset
for help on using the changeset viewer.