Changes in uspace/lib/c/generic/inet.c [a46e56b:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet.c
ra46e56b ra35b458 36 36 #include <stdlib.h> 37 37 38 static void inet_cb_conn( cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg);38 static void inet_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg); 39 39 40 40 static async_sess_t *inet_sess = NULL; … … 176 176 } 177 177 178 static void inet_ev_recv( cap_call_handle_t icall_handle, ipc_call_t *icall)178 static void inet_ev_recv(ipc_callid_t iid, ipc_call_t *icall) 179 179 { 180 180 inet_dgram_t dgram; … … 183 183 dgram.iplink = IPC_GET_ARG2(*icall); 184 184 185 cap_call_handle_t chandle;185 ipc_callid_t callid; 186 186 size_t size; 187 if (!async_data_write_receive(&c handle, &size)) {188 async_answer_0(c handle, EINVAL);189 async_answer_0(i call_handle, EINVAL);187 if (!async_data_write_receive(&callid, &size)) { 188 async_answer_0(callid, EINVAL); 189 async_answer_0(iid, EINVAL); 190 190 return; 191 191 } 192 192 193 193 if (size != sizeof(inet_addr_t)) { 194 async_answer_0(c handle, EINVAL);195 async_answer_0(i call_handle, EINVAL);196 return; 197 } 198 199 errno_t rc = async_data_write_finalize(c handle, &dgram.src, size);200 if (rc != EOK) { 201 async_answer_0(c handle, rc);202 async_answer_0(i call_handle, rc);203 return; 204 } 205 206 if (!async_data_write_receive(&c handle, &size)) {207 async_answer_0(c handle, EINVAL);208 async_answer_0(i call_handle, EINVAL);194 async_answer_0(callid, EINVAL); 195 async_answer_0(iid, EINVAL); 196 return; 197 } 198 199 errno_t rc = async_data_write_finalize(callid, &dgram.src, size); 200 if (rc != EOK) { 201 async_answer_0(callid, rc); 202 async_answer_0(iid, rc); 203 return; 204 } 205 206 if (!async_data_write_receive(&callid, &size)) { 207 async_answer_0(callid, EINVAL); 208 async_answer_0(iid, EINVAL); 209 209 return; 210 210 } 211 211 212 212 if (size != sizeof(inet_addr_t)) { 213 async_answer_0(c handle, EINVAL);214 async_answer_0(i call_handle, EINVAL);215 return; 216 } 217 218 rc = async_data_write_finalize(c handle, &dgram.dest, size);219 if (rc != EOK) { 220 async_answer_0(c handle, rc);221 async_answer_0(i call_handle, rc);213 async_answer_0(callid, EINVAL); 214 async_answer_0(iid, EINVAL); 215 return; 216 } 217 218 rc = async_data_write_finalize(callid, &dgram.dest, size); 219 if (rc != EOK) { 220 async_answer_0(callid, rc); 221 async_answer_0(iid, rc); 222 222 return; 223 223 } … … 225 225 rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, &dgram.size); 226 226 if (rc != EOK) { 227 async_answer_0(i call_handle, rc);227 async_answer_0(iid, rc); 228 228 return; 229 229 } … … 231 231 rc = inet_ev_ops->recv(&dgram); 232 232 free(dgram.data); 233 async_answer_0(i call_handle, rc);234 } 235 236 static void inet_cb_conn( cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)233 async_answer_0(iid, rc); 234 } 235 236 static void inet_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 237 237 { 238 238 while (true) { 239 239 ipc_call_t call; 240 cap_call_handle_t chandle= async_get_call(&call);240 ipc_callid_t callid = async_get_call(&call); 241 241 242 242 if (!IPC_GET_IMETHOD(call)) { … … 247 247 switch (IPC_GET_IMETHOD(call)) { 248 248 case INET_EV_RECV: 249 inet_ev_recv(c handle, &call);249 inet_ev_recv(callid, &call); 250 250 break; 251 251 default: 252 async_answer_0(c handle, ENOTSUP);252 async_answer_0(callid, ENOTSUP); 253 253 } 254 254 }
Note:
See TracChangeset
for help on using the changeset viewer.