Changeset b7fd2a0 in mainline for uspace/srv/net/udp
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/srv/net/udp
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/udp/assoc.c
r36f0738 rb7fd2a0 56 56 57 57 static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *); 58 static int udp_assoc_queue_msg(udp_assoc_t *, inet_ep2_t *, udp_msg_t *);58 static errno_t udp_assoc_queue_msg(udp_assoc_t *, inet_ep2_t *, udp_msg_t *); 59 59 60 60 /** Initialize associations. */ 61 int udp_assocs_init(void)62 { 63 int rc;61 errno_t udp_assocs_init(void) 62 { 63 errno_t rc; 64 64 65 65 rc = amap_create(&amap); … … 182 182 * Add association to the association map. 183 183 */ 184 int udp_assoc_add(udp_assoc_t *assoc)184 errno_t udp_assoc_add(udp_assoc_t *assoc) 185 185 { 186 186 inet_ep2_t aepp; 187 int rc;187 errno_t rc; 188 188 189 189 udp_assoc_addref(assoc); … … 242 242 * EIO if no route to destination exists 243 243 */ 244 int udp_assoc_send(udp_assoc_t *assoc, inet_ep_t *remote, udp_msg_t *msg)244 errno_t udp_assoc_send(udp_assoc_t *assoc, inet_ep_t *remote, udp_msg_t *msg) 245 245 { 246 246 udp_pdu_t *pdu; 247 247 inet_ep2_t epp; 248 int rc;248 errno_t rc; 249 249 250 250 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_send(%p, %p, %p)", … … 302 302 * Pull one message from the association's receive queue. 303 303 */ 304 int udp_assoc_recv(udp_assoc_t *assoc, udp_msg_t **msg, inet_ep_t *remote)304 errno_t udp_assoc_recv(udp_assoc_t *assoc, udp_msg_t **msg, inet_ep_t *remote) 305 305 { 306 306 link_t *link; … … 341 341 { 342 342 udp_assoc_t *assoc; 343 int rc;343 errno_t rc; 344 344 345 345 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_received(%p, %p)", repp, msg); … … 380 380 } 381 381 382 static int udp_assoc_queue_msg(udp_assoc_t *assoc, inet_ep2_t *epp,382 static errno_t udp_assoc_queue_msg(udp_assoc_t *assoc, inet_ep2_t *epp, 383 383 udp_msg_t *msg) 384 384 { … … 416 416 static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *epp) 417 417 { 418 int rc;418 errno_t rc; 419 419 void *arg; 420 420 udp_assoc_t *assoc; -
uspace/srv/net/udp/assoc.h
r36f0738 rb7fd2a0 40 40 #include "udp_type.h" 41 41 42 extern int udp_assocs_init(void);42 extern errno_t udp_assocs_init(void); 43 43 extern udp_assoc_t *udp_assoc_new(inet_ep2_t *, udp_assoc_cb_t *, void *); 44 44 extern void udp_assoc_delete(udp_assoc_t *); 45 extern int udp_assoc_add(udp_assoc_t *);45 extern errno_t udp_assoc_add(udp_assoc_t *); 46 46 extern void udp_assoc_remove(udp_assoc_t *); 47 47 extern void udp_assoc_addref(udp_assoc_t *); 48 48 extern void udp_assoc_delref(udp_assoc_t *); 49 49 extern void udp_assoc_set_iplink(udp_assoc_t *, service_id_t); 50 extern int udp_assoc_send(udp_assoc_t *, inet_ep_t *, udp_msg_t *);51 extern int udp_assoc_recv(udp_assoc_t *, udp_msg_t **, inet_ep_t *);50 extern errno_t udp_assoc_send(udp_assoc_t *, inet_ep_t *, udp_msg_t *); 51 extern errno_t udp_assoc_recv(udp_assoc_t *, udp_msg_t **, inet_ep_t *); 52 52 extern void udp_assoc_received(inet_ep2_t *, udp_msg_t *); 53 53 extern void udp_assoc_reset(udp_assoc_t *); -
uspace/srv/net/udp/pdu.c
r36f0738 rb7fd2a0 162 162 163 163 /** Decode incoming PDU */ 164 int udp_pdu_decode(udp_pdu_t *pdu, inet_ep2_t *epp, udp_msg_t **msg)164 errno_t udp_pdu_decode(udp_pdu_t *pdu, inet_ep2_t *epp, udp_msg_t **msg) 165 165 { 166 166 udp_msg_t *nmsg; … … 209 209 210 210 /** Encode outgoing PDU */ 211 int udp_pdu_encode(inet_ep2_t *epp, udp_msg_t *msg, udp_pdu_t **pdu)211 errno_t udp_pdu_encode(inet_ep2_t *epp, udp_msg_t *msg, udp_pdu_t **pdu) 212 212 { 213 213 udp_pdu_t *npdu; -
uspace/srv/net/udp/pdu.h
r36f0738 rb7fd2a0 42 42 extern udp_pdu_t *udp_pdu_new(void); 43 43 extern void udp_pdu_delete(udp_pdu_t *); 44 extern int udp_pdu_decode(udp_pdu_t *, inet_ep2_t *, udp_msg_t **);45 extern int udp_pdu_encode(inet_ep2_t *, udp_msg_t *, udp_pdu_t **);44 extern errno_t udp_pdu_decode(udp_pdu_t *, inet_ep2_t *, udp_msg_t **); 45 extern errno_t udp_pdu_encode(inet_ep2_t *, udp_msg_t *, udp_pdu_t **); 46 46 47 47 #endif -
uspace/srv/net/udp/service.c
r36f0738 rb7fd2a0 70 70 * @return EOK on success, ENOMEM if out of memory 71 71 */ 72 static int udp_cassoc_queue_msg(udp_cassoc_t *cassoc, inet_ep2_t *epp,72 static errno_t udp_cassoc_queue_msg(udp_cassoc_t *cassoc, inet_ep2_t *epp, 73 73 udp_msg_t *msg) 74 74 { … … 123 123 * @return EOK on soccess, ENOMEM if out of memory 124 124 */ 125 static int udp_cassoc_create(udp_client_t *client, udp_assoc_t *assoc,125 static errno_t udp_cassoc_create(udp_client_t *client, udp_assoc_t *assoc, 126 126 udp_cassoc_t **rcassoc) 127 127 { … … 168 168 * is found. 169 169 */ 170 static int udp_cassoc_get(udp_client_t *client, sysarg_t id,170 static errno_t udp_cassoc_get(udp_client_t *client, sysarg_t id, 171 171 udp_cassoc_t **rcassoc) 172 172 { … … 207 207 * @return EOK on success or an error code 208 208 */ 209 static int udp_assoc_create_impl(udp_client_t *client, inet_ep2_t *epp,209 static errno_t udp_assoc_create_impl(udp_client_t *client, inet_ep2_t *epp, 210 210 sysarg_t *rassoc_id) 211 211 { 212 212 udp_assoc_t *assoc; 213 213 udp_cassoc_t *cassoc; 214 int rc;214 errno_t rc; 215 215 216 216 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_create_impl"); … … 252 252 * @return EOK on success, ENOENT if no such association is found 253 253 */ 254 static int udp_assoc_destroy_impl(udp_client_t *client, sysarg_t assoc_id)254 static errno_t udp_assoc_destroy_impl(udp_client_t *client, sysarg_t assoc_id) 255 255 { 256 256 udp_cassoc_t *cassoc; 257 int rc;257 errno_t rc; 258 258 259 259 rc = udp_cassoc_get(client, assoc_id, &cassoc); … … 278 278 * @return EOK on success, ENOENT if no such association is found 279 279 */ 280 static int udp_assoc_set_nolocal_impl(udp_client_t *client, sysarg_t assoc_id)280 static errno_t udp_assoc_set_nolocal_impl(udp_client_t *client, sysarg_t assoc_id) 281 281 { 282 282 udp_cassoc_t *cassoc; 283 int rc;283 errno_t rc; 284 284 285 285 rc = udp_cassoc_get(client, assoc_id, &cassoc); … … 307 307 * @return EOK on success or an error code 308 308 */ 309 static int udp_assoc_send_msg_impl(udp_client_t *client, sysarg_t assoc_id,309 static errno_t udp_assoc_send_msg_impl(udp_client_t *client, sysarg_t assoc_id, 310 310 inet_ep_t *dest, void *data, size_t size) 311 311 { 312 312 udp_msg_t msg; 313 313 udp_cassoc_t *cassoc; 314 int rc;314 errno_t rc; 315 315 316 316 rc = udp_cassoc_get(client, assoc_id, &cassoc); … … 365 365 inet_ep2_t epp; 366 366 sysarg_t assoc_id; 367 int rc;367 errno_t rc; 368 368 369 369 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_create_srv()"); … … 409 409 { 410 410 sysarg_t assoc_id; 411 int rc;411 errno_t rc; 412 412 413 413 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_destroy_srv()"); … … 430 430 { 431 431 sysarg_t assoc_id; 432 int rc;432 errno_t rc; 433 433 434 434 log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_set_nolocal_srv()"); … … 455 455 sysarg_t assoc_id; 456 456 void *data; 457 int rc;457 errno_t rc; 458 458 459 459 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_send_msg_srv()"); … … 552 552 udp_crcv_queue_entry_t *enext; 553 553 sysarg_t assoc_id; 554 int rc;554 errno_t rc; 555 555 556 556 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_rmsg_info_srv()"); … … 601 601 size_t size; 602 602 size_t off; 603 int rc;603 errno_t rc; 604 604 605 605 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_rmsg_read_srv()"); … … 752 752 * @return EOK on success or an error code. 753 753 */ 754 int udp_service_init(void)755 { 756 int rc;754 errno_t udp_service_init(void) 755 { 756 errno_t rc; 757 757 service_id_t sid; 758 758 -
uspace/srv/net/udp/service.h
r36f0738 rb7fd2a0 36 36 #define SERVICE_H 37 37 38 extern int udp_service_init(void);38 extern errno_t udp_service_init(void); 39 39 40 40 #endif -
uspace/srv/net/udp/udp.c
r36f0738 rb7fd2a0 47 47 #define NAME "udp" 48 48 49 static int udp_init(void)49 static errno_t udp_init(void) 50 50 { 51 int rc;51 errno_t rc; 52 52 53 53 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_init()"); … … 76 76 int main(int argc, char **argv) 77 77 { 78 int rc;78 errno_t rc; 79 79 80 80 printf(NAME ": UDP (User Datagram Protocol) service\n"); -
uspace/srv/net/udp/udp_inet.c
r36f0738 rb7fd2a0 45 45 #include "udp_type.h" 46 46 47 static int udp_inet_ev_recv(inet_dgram_t *dgram);47 static errno_t udp_inet_ev_recv(inet_dgram_t *dgram); 48 48 static void udp_received_pdu(udp_pdu_t *pdu); 49 49 … … 53 53 54 54 /** Received datagram callback */ 55 static int udp_inet_ev_recv(inet_dgram_t *dgram)55 static errno_t udp_inet_ev_recv(inet_dgram_t *dgram) 56 56 { 57 57 udp_pdu_t *pdu; … … 77 77 78 78 /** Transmit PDU over network layer. */ 79 int udp_transmit_pdu(udp_pdu_t *pdu)79 errno_t udp_transmit_pdu(udp_pdu_t *pdu) 80 80 { 81 int rc;81 errno_t rc; 82 82 inet_dgram_t dgram; 83 83 … … 119 119 } 120 120 121 int udp_inet_init(void)121 errno_t udp_inet_init(void) 122 122 { 123 int rc;123 errno_t rc; 124 124 125 125 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_inet_init()"); -
uspace/srv/net/udp/udp_inet.h
r36f0738 rb7fd2a0 38 38 #include "udp_type.h" 39 39 40 extern int udp_inet_init(void);41 extern int udp_transmit_pdu(udp_pdu_t *);40 extern errno_t udp_inet_init(void); 41 extern errno_t udp_transmit_pdu(udp_pdu_t *); 42 42 43 43 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
