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