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