Changes in uspace/lib/c/generic/inet/udp.c [b7fd2a0:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet/udp.c
rb7fd2a0 rcde999a 48 48 * @return EOK on success or an error code 49 49 */ 50 static errno_t udp_callback_create(udp_t *udp)50 static int udp_callback_create(udp_t *udp) 51 51 { 52 52 async_exch_t *exch = async_exchange_begin(udp->sess); … … 55 55 56 56 port_id_t port; 57 errno_t rc = async_create_callback_port(exch, INTERFACE_UDP_CB, 0, 0,57 int rc = async_create_callback_port(exch, INTERFACE_UDP_CB, 0, 0, 58 58 udp_cb_conn, udp, &port); 59 59 … … 63 63 return rc; 64 64 65 errno_t retval;65 int retval; 66 66 async_wait_for(req, &retval); 67 67 … … 75 75 * cannot be contacted 76 76 */ 77 errno_t udp_create(udp_t **rudp)77 int udp_create(udp_t **rudp) 78 78 { 79 79 udp_t *udp; 80 80 service_id_t udp_svcid; 81 errno_t rc;81 int rc; 82 82 83 83 udp = calloc(1, sizeof(udp_t)); … … 160 160 * @return EOK on success or an error code. 161 161 */ 162 errno_t udp_assoc_create(udp_t *udp, inet_ep2_t *epp, udp_cb_t *cb, void *arg,162 int udp_assoc_create(udp_t *udp, inet_ep2_t *epp, udp_cb_t *cb, void *arg, 163 163 udp_assoc_t **rassoc) 164 164 { … … 173 173 exch = async_exchange_begin(udp->sess); 174 174 aid_t req = async_send_0(exch, UDP_ASSOC_CREATE, &answer); 175 errno_t rc = async_data_write_start(exch, (void *)epp,175 int rc = async_data_write_start(exch, (void *)epp, 176 176 sizeof(inet_ep2_t)); 177 177 async_exchange_end(exch); 178 178 179 179 if (rc != EOK) { 180 errno_t rc_orig;180 int rc_orig; 181 181 async_wait_for(req, &rc_orig); 182 182 if (rc_orig != EOK) … … 200 200 error: 201 201 free(assoc); 202 return ( errno_t) rc;202 return (int) rc; 203 203 } 204 204 … … 220 220 221 221 exch = async_exchange_begin(assoc->udp->sess); 222 errno_t rc = async_req_1_0(exch, UDP_ASSOC_DESTROY, assoc->id);222 int rc = async_req_1_0(exch, UDP_ASSOC_DESTROY, assoc->id); 223 223 async_exchange_end(exch); 224 224 … … 232 232 * @param flags Flags 233 233 */ 234 errno_t udp_assoc_set_nolocal(udp_assoc_t *assoc)234 int udp_assoc_set_nolocal(udp_assoc_t *assoc) 235 235 { 236 236 async_exch_t *exch; 237 237 238 238 exch = async_exchange_begin(assoc->udp->sess); 239 errno_t rc = async_req_1_0(exch, UDP_ASSOC_SET_NOLOCAL, assoc->id);239 int rc = async_req_1_0(exch, UDP_ASSOC_SET_NOLOCAL, assoc->id); 240 240 async_exchange_end(exch); 241 241 … … 252 252 * @return EOK on success or an error code 253 253 */ 254 errno_t udp_assoc_send_msg(udp_assoc_t *assoc, inet_ep_t *dest, void *data,254 int udp_assoc_send_msg(udp_assoc_t *assoc, inet_ep_t *dest, void *data, 255 255 size_t bytes) 256 256 { … … 260 260 aid_t req = async_send_1(exch, UDP_ASSOC_SEND_MSG, assoc->id, NULL); 261 261 262 errno_t rc = async_data_write_start(exch, (void *)dest,262 int rc = async_data_write_start(exch, (void *)dest, 263 263 sizeof(inet_ep_t)); 264 264 if (rc != EOK) { … … 318 318 * @return EOK on success or an error code. 319 319 */ 320 errno_t udp_rmsg_read(udp_rmsg_t *rmsg, size_t off, void *buf, size_t bsize)320 int udp_rmsg_read(udp_rmsg_t *rmsg, size_t off, void *buf, size_t bsize) 321 321 { 322 322 async_exch_t *exch; … … 325 325 exch = async_exchange_begin(rmsg->udp->sess); 326 326 aid_t req = async_send_1(exch, UDP_RMSG_READ, off, &answer); 327 errno_t rc = async_data_read_start(exch, buf, bsize);327 int rc = async_data_read_start(exch, buf, bsize); 328 328 async_exchange_end(exch); 329 329 … … 333 333 } 334 334 335 errno_t retval;335 int retval; 336 336 async_wait_for(req, &retval); 337 337 if (retval != EOK) { … … 382 382 * @return EOK on success or an error code 383 383 */ 384 static errno_t udp_rmsg_info(udp_t *udp, udp_rmsg_t *rmsg)384 static int udp_rmsg_info(udp_t *udp, udp_rmsg_t *rmsg) 385 385 { 386 386 async_exch_t *exch; … … 390 390 exch = async_exchange_begin(udp->sess); 391 391 aid_t req = async_send_0(exch, UDP_RMSG_INFO, &answer); 392 errno_t rc = async_data_read_start(exch, &ep, sizeof(inet_ep_t));392 int rc = async_data_read_start(exch, &ep, sizeof(inet_ep_t)); 393 393 async_exchange_end(exch); 394 394 … … 398 398 } 399 399 400 errno_t retval;400 int retval; 401 401 async_wait_for(req, &retval); 402 402 if (retval != EOK) … … 415 415 * @return EOK on success or an error code 416 416 */ 417 static errno_t udp_rmsg_discard(udp_t *udp)417 static int udp_rmsg_discard(udp_t *udp) 418 418 { 419 419 async_exch_t *exch; 420 420 421 421 exch = async_exchange_begin(udp->sess); 422 errno_t rc = async_req_0_0(exch, UDP_RMSG_DISCARD);422 int rc = async_req_0_0(exch, UDP_RMSG_DISCARD); 423 423 async_exchange_end(exch); 424 424 … … 434 434 * @return EOK on success, EINVAL if no association with the given ID exists 435 435 */ 436 static errno_t udp_assoc_get(udp_t *udp, sysarg_t id, udp_assoc_t **rassoc)436 static int udp_assoc_get(udp_t *udp, sysarg_t id, udp_assoc_t **rassoc) 437 437 { 438 438 list_foreach(udp->assoc, ludp, udp_assoc_t, assoc) { … … 459 459 udp_rmsg_t rmsg; 460 460 udp_assoc_t *assoc; 461 errno_t rc;461 int rc; 462 462 463 463 while (true) {
Note:
See TracChangeset
for help on using the changeset viewer.