Changeset 984a9ba in mainline for uspace/lib/c/generic/inet.c
- Timestamp:
- 2018-07-05T09:34:09Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63d46341
- Parents:
- 76f566d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet.c
r76f566d r984a9ba 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_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_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_call_t call; 186 186 size_t size; 187 if (!async_data_write_receive(&c handle, &size)) {188 async_answer_0( chandle, EINVAL);189 async_answer_0(icall _handle, EINVAL);187 if (!async_data_write_receive(&call, &size)) { 188 async_answer_0(&call, EINVAL); 189 async_answer_0(icall, EINVAL); 190 190 return; 191 191 } 192 192 193 193 if (size != sizeof(inet_addr_t)) { 194 async_answer_0( chandle, EINVAL);195 async_answer_0(icall _handle, EINVAL);196 return; 197 } 198 199 errno_t rc = async_data_write_finalize( chandle, &dgram.src, size);200 if (rc != EOK) { 201 async_answer_0( chandle, rc);202 async_answer_0(icall _handle, rc);203 return; 204 } 205 206 if (!async_data_write_receive(&c handle, &size)) {207 async_answer_0( chandle, EINVAL);208 async_answer_0(icall _handle, EINVAL);194 async_answer_0(&call, EINVAL); 195 async_answer_0(icall, EINVAL); 196 return; 197 } 198 199 errno_t rc = async_data_write_finalize(&call, &dgram.src, size); 200 if (rc != EOK) { 201 async_answer_0(&call, rc); 202 async_answer_0(icall, rc); 203 return; 204 } 205 206 if (!async_data_write_receive(&call, &size)) { 207 async_answer_0(&call, EINVAL); 208 async_answer_0(icall, EINVAL); 209 209 return; 210 210 } 211 211 212 212 if (size != sizeof(inet_addr_t)) { 213 async_answer_0( chandle, EINVAL);214 async_answer_0(icall _handle, EINVAL);215 return; 216 } 217 218 rc = async_data_write_finalize( chandle, &dgram.dest, size);219 if (rc != EOK) { 220 async_answer_0( chandle, rc);221 async_answer_0(icall _handle, rc);213 async_answer_0(&call, EINVAL); 214 async_answer_0(icall, EINVAL); 215 return; 216 } 217 218 rc = async_data_write_finalize(&call, &dgram.dest, size); 219 if (rc != EOK) { 220 async_answer_0(&call, rc); 221 async_answer_0(icall, 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(icall _handle, rc);227 async_answer_0(icall, rc); 228 228 return; 229 229 } … … 231 231 rc = inet_ev_ops->recv(&dgram); 232 232 free(dgram.data); 233 async_answer_0(icall _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(icall, rc); 234 } 235 236 static void inet_cb_conn(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 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( chandle,&call);249 inet_ev_recv(&call); 250 250 break; 251 251 default: 252 async_answer_0( chandle, ENOTSUP);252 async_answer_0(&call, ENOTSUP); 253 253 } 254 254 }
Note:
See TracChangeset
for help on using the changeset viewer.