Changes in uspace/lib/c/generic/inetping.c [a46e56b:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inetping.c
ra46e56b ra35b458 38 38 #include <str.h> 39 39 40 static void inetping_cb_conn( cap_call_handle_t, ipc_call_t *, void *);41 static void inetping_ev_recv( cap_call_handle_t, ipc_call_t *);40 static void inetping_cb_conn(ipc_callid_t, ipc_call_t *, void *); 41 static void inetping_ev_recv(ipc_callid_t, ipc_call_t *); 42 42 43 43 static async_sess_t *inetping_sess = NULL; … … 150 150 } 151 151 152 static void inetping_ev_recv( cap_call_handle_t icall_handle, ipc_call_t *icall)152 static void inetping_ev_recv(ipc_callid_t iid, ipc_call_t *icall) 153 153 { 154 154 inetping_sdu_t sdu; … … 156 156 sdu.seq_no = IPC_GET_ARG1(*icall); 157 157 158 cap_call_handle_t chandle;158 ipc_callid_t callid; 159 159 size_t size; 160 if (!async_data_write_receive(&c handle, &size)) {161 async_answer_0(c handle, EREFUSED);162 async_answer_0(i call_handle, EREFUSED);160 if (!async_data_write_receive(&callid, &size)) { 161 async_answer_0(callid, EREFUSED); 162 async_answer_0(iid, EREFUSED); 163 163 return; 164 164 } 165 165 166 166 if (size != sizeof(sdu.src)) { 167 async_answer_0(c handle, EINVAL);168 async_answer_0(i call_handle, EINVAL);169 return; 170 } 171 172 errno_t rc = async_data_write_finalize(c handle, &sdu.src, size);173 if (rc != EOK) { 174 async_answer_0(c handle, rc);175 async_answer_0(i call_handle, rc);176 return; 177 } 178 179 if (!async_data_write_receive(&c handle, &size)) {180 async_answer_0(c handle, EREFUSED);181 async_answer_0(i call_handle, EREFUSED);167 async_answer_0(callid, EINVAL); 168 async_answer_0(iid, EINVAL); 169 return; 170 } 171 172 errno_t rc = async_data_write_finalize(callid, &sdu.src, size); 173 if (rc != EOK) { 174 async_answer_0(callid, rc); 175 async_answer_0(iid, rc); 176 return; 177 } 178 179 if (!async_data_write_receive(&callid, &size)) { 180 async_answer_0(callid, EREFUSED); 181 async_answer_0(iid, EREFUSED); 182 182 return; 183 183 } 184 184 185 185 if (size != sizeof(sdu.dest)) { 186 async_answer_0(c handle, EINVAL);187 async_answer_0(i call_handle, EINVAL);188 return; 189 } 190 191 rc = async_data_write_finalize(c handle, &sdu.dest, size);192 if (rc != EOK) { 193 async_answer_0(c handle, rc);194 async_answer_0(i call_handle, rc);186 async_answer_0(callid, EINVAL); 187 async_answer_0(iid, EINVAL); 188 return; 189 } 190 191 rc = async_data_write_finalize(callid, &sdu.dest, size); 192 if (rc != EOK) { 193 async_answer_0(callid, rc); 194 async_answer_0(iid, rc); 195 195 return; 196 196 } … … 198 198 rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size); 199 199 if (rc != EOK) { 200 async_answer_0(i call_handle, rc);200 async_answer_0(iid, rc); 201 201 return; 202 202 } … … 204 204 rc = inetping_ev_ops->recv(&sdu); 205 205 free(sdu.data); 206 async_answer_0(i call_handle, rc);207 } 208 209 static void inetping_cb_conn( cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)206 async_answer_0(iid, rc); 207 } 208 209 static void inetping_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 210 210 { 211 211 while (true) { 212 212 ipc_call_t call; 213 cap_call_handle_t chandle= async_get_call(&call);213 ipc_callid_t callid = async_get_call(&call); 214 214 215 215 if (!IPC_GET_IMETHOD(call)) { … … 220 220 switch (IPC_GET_IMETHOD(call)) { 221 221 case INETPING_EV_RECV: 222 inetping_ev_recv(c handle, &call);222 inetping_ev_recv(callid, &call); 223 223 break; 224 224 default: 225 async_answer_0(c handle, ENOTSUP);225 async_answer_0(callid, ENOTSUP); 226 226 } 227 227 }
Note:
See TracChangeset
for help on using the changeset viewer.