Changes in uspace/lib/net/tl/icmp_remote.c [6b82009:ffa2c8ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/tl/icmp_remote.c
r6b82009 rffa2c8ef 39 39 #include <net/modules.h> 40 40 #include <packet_client.h> 41 42 #include <async.h> 43 #include <errno.h> 41 44 #include <ipc/services.h> 42 45 #include <ipc/icmp.h> 43 46 #include <sys/types.h> 44 #include <async.h>45 #include <errno.h>46 47 47 /** Send the Destination Unreachable error notification packet.48 /** Sends the Destination Unreachable error notification packet. 48 49 * 49 50 * Beginning of the packet is sent as the notification packet data. … … 51 52 * packet. 52 53 * 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 * 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. 62 61 */ 63 int icmp_destination_unreachable_msg(async_sess_t *sess, icmp_code_t code, 62 int 63 icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, 64 64 icmp_param_t mtu, packet_t *packet) 65 65 { 66 async_exch_t *exch = async_exchange_begin(sess); 67 async_msg_3(exch, NET_ICMP_DEST_UNREACH, (sysarg_t) code, 66 async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (sysarg_t) code, 68 67 (sysarg_t) packet_get_id(packet), (sysarg_t) mtu); 69 async_exchange_end(exch);70 71 68 return EOK; 72 69 } 73 70 74 /** Send the Source Quench error notification packet.71 /** Sends the Source Quench error notification packet. 75 72 * 76 73 * Beginning of the packet is sent as the notification packet data. … … 78 75 * packet. 79 76 * 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 * 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. 87 82 */ 88 int icmp_source_quench_msg( async_sess_t *sess, packet_t *packet)83 int icmp_source_quench_msg(int icmp_phone, packet_t *packet) 89 84 { 90 async_exch_t *exch = async_exchange_begin(sess); 91 async_msg_2(exch, NET_ICMP_SOURCE_QUENCH, 0, 85 async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0, 92 86 (sysarg_t) packet_get_id(packet)); 93 async_exchange_end(exch);94 95 87 return EOK; 96 88 } 97 89 98 /** Send the Time Exceeded error notification packet.90 /** Sends the Time Exceeded error notification packet. 99 91 * 100 92 * Beginning of the packet is sent as the notification packet data. … … 102 94 * packet. 103 95 * 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 * 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. 112 102 */ 113 int icmp_time_exceeded_msg(async_sess_t *sess, icmp_code_t code, 114 packet_t *packet) 103 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet) 115 104 { 116 async_exch_t *exch = async_exchange_begin(sess); 117 async_msg_2(exch, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code, 105 async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code, 118 106 (sysarg_t) packet_get_id(packet)); 119 async_exchange_end(exch);120 121 107 return EOK; 122 108 } 123 109 124 /** Send the Parameter Problem error notification packet.110 /** Sends the Parameter Problem error notification packet. 125 111 * 126 112 * Beginning of the packet is sent as the notification packet data. … … 128 114 * packet. 129 115 * 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 * 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. 139 123 */ 140 int icmp_parameter_problem_msg( async_sess_t *sess, icmp_code_t code,124 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, 141 125 icmp_param_t pointer, packet_t *packet) 142 126 { 143 async_exch_t *exch = async_exchange_begin(sess); 144 async_msg_3(exch, NET_ICMP_PARAMETERPROB, (sysarg_t) code, 127 async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (sysarg_t) code, 145 128 (sysarg_t) packet_get_id(packet), (sysarg_t) pointer); 146 async_exchange_end(exch);147 148 129 return EOK; 149 130 } … … 151 132 /** @} 152 133 */ 134
Note:
See TracChangeset
for help on using the changeset viewer.