Changeset ee603c4 in mainline for uspace/srv/udp/ucall.c
- Timestamp:
- 2012-04-04T21:10:22Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 92b42442
- Parents:
- 4794417
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/udp/ucall.c
r4794417 ree603c4 37 37 #include <io/log.h> 38 38 39 //#include "conn.h"39 #include "assoc.h" 40 40 #include "udp_type.h" 41 41 #include "ucall.h" … … 43 43 udp_error_t udp_uc_create(udp_assoc_t **assoc) 44 44 { 45 // udo_assoc_t *nassoc;45 udp_assoc_t *nassoc; 46 46 47 47 log_msg(LVL_DEBUG, "udp_uc_create()"); 48 nassoc = udp_assoc_new(NULL, NULL); 49 if (nassoc == NULL) 50 return UDP_ENORES; 48 51 52 udp_assoc_add(nassoc); 53 *assoc = nassoc; 49 54 return UDP_EOK; 50 55 } … … 52 57 udp_error_t udp_uc_set_foreign(udp_assoc_t *assoc, udp_sock_t *fsock) 53 58 { 54 // udo_assoc_t *nconn;55 56 59 log_msg(LVL_DEBUG, "udp_uc_set_foreign(%p, %p)", assoc, fsock); 57 60 61 udp_assoc_set_foreign(assoc, fsock); 58 62 return UDP_EOK; 59 63 } … … 61 65 udp_error_t udp_uc_set_local(udp_assoc_t *assoc, udp_sock_t *lsock) 62 66 { 63 // udo_assoc_t *nconn;64 65 67 log_msg(LVL_DEBUG, "udp_uc_set_local(%p, %p)", assoc, lsock); 66 68 69 udp_assoc_set_local(assoc, lsock); 67 70 return UDP_EOK; 68 71 } … … 71 74 size_t size, xflags_t flags) 72 75 { 76 int rc; 77 udp_msg_t msg; 78 73 79 log_msg(LVL_DEBUG, "%s: udp_uc_send()", assoc->name); 80 81 msg.data = data; 82 msg.data_size = size; 83 84 rc = udp_assoc_send(assoc, fsock, &msg); 85 switch (rc) { 86 case ENOMEM: 87 return UDP_ENORES; 88 case EINVAL: 89 return UDP_EUNSPEC; 90 case EIO: 91 return UDP_ENOROUTE; 92 } 74 93 return UDP_EOK; 75 94 } … … 92 111 void udp_uc_destroy(udp_assoc_t *assoc) 93 112 { 94 log_msg(LVL_DEBUG, "udp_uc_delete()"); 95 // udp_assoc_destroy(assoc); 113 log_msg(LVL_DEBUG, "udp_uc_destroy()"); 114 udp_assoc_remove(assoc); 115 udp_assoc_delete(assoc); 96 116 } 97 117
Note:
See TracChangeset
for help on using the changeset viewer.