Changeset b7fd2a0 in mainline for uspace/srv/net/tcp
- 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/tcp
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/conn.c
r36f0738 rb7fd2a0 84 84 85 85 /** Initialize connections. */ 86 int tcp_conns_init(void)87 { 88 int rc;86 errno_t tcp_conns_init(void) 87 { 88 errno_t rc; 89 89 90 90 rc = amap_create(&amap); … … 303 303 * Add connection to the connection map. 304 304 */ 305 int tcp_conn_add(tcp_conn_t *conn)305 errno_t tcp_conn_add(tcp_conn_t *conn) 306 306 { 307 307 inet_ep2_t aepp; 308 int rc;308 errno_t rc; 309 309 310 310 tcp_conn_addref(conn); … … 425 425 tcp_conn_t *tcp_conn_find_ref(inet_ep2_t *epp) 426 426 { 427 int rc;427 errno_t rc; 428 428 void *arg; 429 429 tcp_conn_t *conn; … … 1242 1242 inet_ep2_t aepp; 1243 1243 inet_ep2_t oldepp; 1244 int rc;1244 errno_t rc; 1245 1245 1246 1246 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_conn_segment_arrived(%p)", -
uspace/srv/net/tcp/conn.h
r36f0738 rb7fd2a0 40 40 #include "tcp_type.h" 41 41 42 extern int tcp_conns_init(void);42 extern errno_t tcp_conns_init(void); 43 43 extern void tcp_conns_fini(void); 44 44 extern tcp_conn_t *tcp_conn_new(inet_ep2_t *); 45 45 extern void tcp_conn_delete(tcp_conn_t *); 46 extern int tcp_conn_add(tcp_conn_t *);46 extern errno_t tcp_conn_add(tcp_conn_t *); 47 47 extern void tcp_conn_reset(tcp_conn_t *conn); 48 48 extern void tcp_conn_sync(tcp_conn_t *); -
uspace/srv/net/tcp/inet.c
r36f0738 rb7fd2a0 50 50 #define NAME "tcp" 51 51 52 static int tcp_inet_ev_recv(inet_dgram_t *dgram);52 static errno_t tcp_inet_ev_recv(inet_dgram_t *dgram); 53 53 static void tcp_received_pdu(tcp_pdu_t *pdu); 54 54 … … 58 58 59 59 /** Received datagram callback */ 60 static int tcp_inet_ev_recv(inet_dgram_t *dgram)60 static errno_t tcp_inet_ev_recv(inet_dgram_t *dgram) 61 61 { 62 62 uint8_t *pdu_raw; … … 121 121 void tcp_transmit_pdu(tcp_pdu_t *pdu) 122 122 { 123 int rc;123 errno_t rc; 124 124 uint8_t *pdu_raw; 125 125 size_t pdu_raw_size; … … 169 169 170 170 /** Initialize TCP inet interface. */ 171 int tcp_inet_init(void)171 errno_t tcp_inet_init(void) 172 172 { 173 int rc;173 errno_t rc; 174 174 175 175 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_inet_init()"); -
uspace/srv/net/tcp/inet.h
r36f0738 rb7fd2a0 38 38 #include "tcp_type.h" 39 39 40 extern int tcp_inet_init(void);40 extern errno_t tcp_inet_init(void); 41 41 extern void tcp_transmit_pdu(tcp_pdu_t *); 42 42 -
uspace/srv/net/tcp/iqueue.c
r36f0738 rb7fd2a0 137 137 * @return EOK on success, ENOENT if no segment is ready 138 138 */ 139 int tcp_iqueue_get_ready_seg(tcp_iqueue_t *iqueue, tcp_segment_t **seg)139 errno_t tcp_iqueue_get_ready_seg(tcp_iqueue_t *iqueue, tcp_segment_t **seg) 140 140 { 141 141 tcp_iqueue_entry_t *iqe; -
uspace/srv/net/tcp/iqueue.h
r36f0738 rb7fd2a0 41 41 extern void tcp_iqueue_insert_seg(tcp_iqueue_t *, tcp_segment_t *); 42 42 extern void tcp_iqueue_remove_seg(tcp_iqueue_t *, tcp_segment_t *); 43 extern int tcp_iqueue_get_ready_seg(tcp_iqueue_t *, tcp_segment_t **);43 extern errno_t tcp_iqueue_get_ready_seg(tcp_iqueue_t *, tcp_segment_t **); 44 44 45 45 #endif -
uspace/srv/net/tcp/ncsim.c
r36f0738 rb7fd2a0 123 123 124 124 /** Network condition simulator handler fibril. */ 125 static int tcp_ncsim_fibril(void *arg)125 static errno_t tcp_ncsim_fibril(void *arg) 126 126 { 127 127 link_t *link; 128 128 tcp_squeue_entry_t *sqe; 129 129 inet_ep2_t rident; 130 int rc;130 errno_t rc; 131 131 132 132 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_ncsim_fibril()"); -
uspace/srv/net/tcp/pdu.c
r36f0738 rb7fd2a0 191 191 } 192 192 193 static int tcp_header_encode(inet_ep2_t *epp, tcp_segment_t *seg,193 static errno_t tcp_header_encode(inet_ep2_t *epp, tcp_segment_t *seg, 194 194 void **header, size_t *size) 195 195 { … … 295 295 296 296 /** Decode incoming PDU */ 297 int tcp_pdu_decode(tcp_pdu_t *pdu, inet_ep2_t *epp, tcp_segment_t **seg)297 errno_t tcp_pdu_decode(tcp_pdu_t *pdu, inet_ep2_t *epp, tcp_segment_t **seg) 298 298 { 299 299 tcp_segment_t *nseg; … … 319 319 320 320 /** Encode outgoing PDU */ 321 int tcp_pdu_encode(inet_ep2_t *epp, tcp_segment_t *seg, tcp_pdu_t **pdu)321 errno_t tcp_pdu_encode(inet_ep2_t *epp, tcp_segment_t *seg, tcp_pdu_t **pdu) 322 322 { 323 323 tcp_pdu_t *npdu; 324 324 size_t text_size; 325 325 uint16_t checksum; 326 int rc;326 errno_t rc; 327 327 328 328 npdu = tcp_pdu_new(); -
uspace/srv/net/tcp/pdu.h
r36f0738 rb7fd2a0 43 43 extern tcp_pdu_t *tcp_pdu_create(void *, size_t, void *, size_t); 44 44 extern void tcp_pdu_delete(tcp_pdu_t *); 45 extern int tcp_pdu_decode(tcp_pdu_t *, inet_ep2_t *, tcp_segment_t **);46 extern int tcp_pdu_encode(inet_ep2_t *, tcp_segment_t *, tcp_pdu_t **);45 extern errno_t tcp_pdu_decode(tcp_pdu_t *, inet_ep2_t *, tcp_segment_t **); 46 extern errno_t tcp_pdu_encode(inet_ep2_t *, tcp_segment_t *, tcp_pdu_t **); 47 47 48 48 #endif -
uspace/srv/net/tcp/rqueue.c
r36f0738 rb7fd2a0 105 105 106 106 /** Receive queue handler fibril. */ 107 static int tcp_rqueue_fibril(void *arg)107 static errno_t tcp_rqueue_fibril(void *arg) 108 108 { 109 109 link_t *link; -
uspace/srv/net/tcp/service.c
r36f0738 rb7fd2a0 68 68 static void tcp_service_lst_cstate_change(tcp_conn_t *, void *, tcp_cstate_t); 69 69 70 static int tcp_cconn_create(tcp_client_t *, tcp_conn_t *, tcp_cconn_t **);70 static errno_t tcp_cconn_create(tcp_client_t *, tcp_conn_t *, tcp_cconn_t **); 71 71 72 72 /** Connection callbacks to tie us to lower layer */ … … 132 132 tcp_cconn_t *cconn; 133 133 inet_ep2_t epp; 134 int rc;134 errno_t rc; 135 135 tcp_error_t trc; 136 136 … … 298 298 * @return EOK on success or ENOMEM if out of memory 299 299 */ 300 static int tcp_cconn_create(tcp_client_t *client, tcp_conn_t *conn,300 static errno_t tcp_cconn_create(tcp_client_t *client, tcp_conn_t *conn, 301 301 tcp_cconn_t **rcconn) 302 302 { … … 345 345 * @return EOK on success or ENOMEM if out of memory 346 346 */ 347 static int tcp_clistener_create(tcp_client_t *client, tcp_conn_t *conn,347 static errno_t tcp_clistener_create(tcp_client_t *client, tcp_conn_t *conn, 348 348 tcp_clst_t **rclst) 349 349 { … … 390 390 * is found. 391 391 */ 392 static int tcp_cconn_get(tcp_client_t *client, sysarg_t id,392 static errno_t tcp_cconn_get(tcp_client_t *client, sysarg_t id, 393 393 tcp_cconn_t **rcconn) 394 394 { … … 412 412 * is found. 413 413 */ 414 static int tcp_clistener_get(tcp_client_t *client, sysarg_t id,414 static errno_t tcp_clistener_get(tcp_client_t *client, sysarg_t id, 415 415 tcp_clst_t **rclst) 416 416 { … … 435 435 * @return EOK on success or an error code 436 436 */ 437 static int tcp_conn_create_impl(tcp_client_t *client, inet_ep2_t *epp,437 static errno_t tcp_conn_create_impl(tcp_client_t *client, inet_ep2_t *epp, 438 438 sysarg_t *rconn_id) 439 439 { 440 440 tcp_conn_t *conn; 441 441 tcp_cconn_t *cconn; 442 int rc;442 errno_t rc; 443 443 tcp_error_t trc; 444 444 char *slocal; … … 482 482 * @return EOK on success, ENOENT if no such connection is found 483 483 */ 484 static int tcp_conn_destroy_impl(tcp_client_t *client, sysarg_t conn_id)484 static errno_t tcp_conn_destroy_impl(tcp_client_t *client, sysarg_t conn_id) 485 485 { 486 486 tcp_cconn_t *cconn; 487 int rc;487 errno_t rc; 488 488 489 489 rc = tcp_cconn_get(client, conn_id, &cconn); … … 509 509 * @return EOK on success or an error code 510 510 */ 511 static int tcp_listener_create_impl(tcp_client_t *client, inet_ep_t *ep,511 static errno_t tcp_listener_create_impl(tcp_client_t *client, inet_ep_t *ep, 512 512 sysarg_t *rlst_id) 513 513 { … … 515 515 tcp_clst_t *clst; 516 516 inet_ep2_t epp; 517 int rc;517 errno_t rc; 518 518 tcp_error_t trc; 519 519 … … 555 555 * @return EOK on success, ENOENT if no such listener is found 556 556 */ 557 static int tcp_listener_destroy_impl(tcp_client_t *client, sysarg_t lst_id)557 static errno_t tcp_listener_destroy_impl(tcp_client_t *client, sysarg_t lst_id) 558 558 { 559 559 tcp_clst_t *clst; 560 int rc;560 errno_t rc; 561 561 562 562 rc = tcp_clistener_get(client, lst_id, &clst); … … 580 580 * @return EOK on success or an error code 581 581 */ 582 static int tcp_conn_send_fin_impl(tcp_client_t *client, sysarg_t conn_id)582 static errno_t tcp_conn_send_fin_impl(tcp_client_t *client, sysarg_t conn_id) 583 583 { 584 584 tcp_cconn_t *cconn; 585 int rc;585 errno_t rc; 586 586 587 587 rc = tcp_cconn_get(client, conn_id, &cconn); … … 605 605 * @return EOK on success or an error code 606 606 */ 607 static int tcp_conn_push_impl(tcp_client_t *client, sysarg_t conn_id)607 static errno_t tcp_conn_push_impl(tcp_client_t *client, sysarg_t conn_id) 608 608 { 609 609 tcp_cconn_t *cconn; 610 int rc;610 errno_t rc; 611 611 612 612 rc = tcp_cconn_get(client, conn_id, &cconn); … … 630 630 * @return EOK on success or an error code 631 631 */ 632 static int tcp_conn_reset_impl(tcp_client_t *client, sysarg_t conn_id)632 static errno_t tcp_conn_reset_impl(tcp_client_t *client, sysarg_t conn_id) 633 633 { 634 634 tcp_cconn_t *cconn; 635 int rc;635 errno_t rc; 636 636 637 637 rc = tcp_cconn_get(client, conn_id, &cconn); … … 656 656 * @return EOK on success or an error code 657 657 */ 658 static int tcp_conn_send_impl(tcp_client_t *client, sysarg_t conn_id,658 static errno_t tcp_conn_send_impl(tcp_client_t *client, sysarg_t conn_id, 659 659 void *data, size_t size) 660 660 { 661 661 tcp_cconn_t *cconn; 662 int rc;662 errno_t rc; 663 663 tcp_error_t trc; 664 664 … … 686 686 * @return EOK on success or an error code 687 687 */ 688 static int tcp_conn_recv_impl(tcp_client_t *client, sysarg_t conn_id,688 static errno_t tcp_conn_recv_impl(tcp_client_t *client, sysarg_t conn_id, 689 689 void *data, size_t size, size_t *nrecv) 690 690 { 691 691 tcp_cconn_t *cconn; 692 692 xflags_t xflags; 693 int rc;693 errno_t rc; 694 694 tcp_error_t trc; 695 695 … … 758 758 inet_ep2_t epp; 759 759 sysarg_t conn_id; 760 int rc;760 errno_t rc; 761 761 762 762 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_srv()"); … … 802 802 { 803 803 sysarg_t conn_id; 804 int rc;804 errno_t rc; 805 805 806 806 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_destroy_srv()"); … … 826 826 inet_ep_t ep; 827 827 sysarg_t lst_id; 828 int rc;828 errno_t rc; 829 829 830 830 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_listener_create_srv()"); … … 870 870 { 871 871 sysarg_t lst_id; 872 int rc;872 errno_t rc; 873 873 874 874 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_listener_destroy_srv()"); … … 891 891 { 892 892 sysarg_t conn_id; 893 int rc;893 errno_t rc; 894 894 895 895 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_send_fin_srv()"); … … 912 912 { 913 913 sysarg_t conn_id; 914 int rc;914 errno_t rc; 915 915 916 916 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_push_srv()"); … … 933 933 { 934 934 sysarg_t conn_id; 935 int rc;935 errno_t rc; 936 936 937 937 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_reset_srv()"); … … 957 957 sysarg_t conn_id; 958 958 void *data; 959 int rc;959 errno_t rc; 960 960 961 961 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_send_srv())"); … … 1018 1018 size_t size, rsize; 1019 1019 void *data; 1020 int rc;1020 errno_t rc; 1021 1021 1022 1022 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_srv()"); … … 1074 1074 size_t size, rsize; 1075 1075 void *data; 1076 int rc;1076 errno_t rc; 1077 1077 1078 1078 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv()"); … … 1246 1246 * @return EOK on success or an error code. 1247 1247 */ 1248 int tcp_service_init(void)1249 { 1250 int rc;1248 errno_t tcp_service_init(void) 1249 { 1250 errno_t rc; 1251 1251 service_id_t sid; 1252 1252 -
uspace/srv/net/tcp/service.h
r36f0738 rb7fd2a0 36 36 #define SERVICE_H 37 37 38 extern int tcp_service_init(void);38 extern errno_t tcp_service_init(void); 39 39 40 40 #endif -
uspace/srv/net/tcp/tcp.c
r36f0738 rb7fd2a0 55 55 }; 56 56 57 static int tcp_init(void)57 static errno_t tcp_init(void) 58 58 { 59 int rc;59 errno_t rc; 60 60 61 61 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_init()"); … … 91 91 int main(int argc, char **argv) 92 92 { 93 int rc;93 errno_t rc; 94 94 95 95 printf(NAME ": TCP (Transmission Control Protocol) network module\n"); -
uspace/srv/net/tcp/test.c
r36f0738 rb7fd2a0 47 47 #define RCV_BUF_SIZE 64 48 48 49 static int test_srv(void *arg)49 static errno_t test_srv(void *arg) 50 50 { 51 51 tcp_conn_t *conn; … … 91 91 } 92 92 93 static int test_cli(void *arg)93 static errno_t test_cli(void *arg) 94 94 { 95 95 tcp_conn_t *conn; -
uspace/srv/net/tcp/test/conn.c
r36f0738 rb7fd2a0 46 46 PCUT_TEST_BEFORE 47 47 { 48 int rc;48 errno_t rc; 49 49 50 50 /* We will be calling functions that perform logging */ … … 89 89 tcp_conn_t *conn, *cfound; 90 90 inet_ep2_t epp; 91 int rc;91 errno_t rc; 92 92 93 93 inet_ep2_init(&epp); … … 119 119 tcp_conn_t *conn; 120 120 inet_ep2_t epp; 121 int rc;121 errno_t rc; 122 122 123 123 inet_ep2_init(&epp); … … 152 152 tcp_conn_t *cconn, *sconn; 153 153 inet_ep2_t cepp, sepp; 154 int rc;154 errno_t rc; 155 155 156 156 /* Client EPP */ -
uspace/srv/net/tcp/test/iqueue.c
r36f0738 rb7fd2a0 45 45 inet_ep2_t epp; 46 46 tcp_segment_t *rseg; 47 int rc;47 errno_t rc; 48 48 49 49 inet_ep2_init(&epp); … … 71 71 void *data; 72 72 size_t dsize; 73 int rc;73 errno_t rc; 74 74 75 75 inet_ep2_init(&epp); … … 117 117 void *data; 118 118 size_t dsize; 119 int rc;119 errno_t rc; 120 120 121 121 inet_ep2_init(&epp); -
uspace/srv/net/tcp/test/pdu.c
r36f0738 rb7fd2a0 47 47 tcp_pdu_t *pdu; 48 48 inet_ep2_t epp, depp; 49 int rc;49 errno_t rc; 50 50 51 51 inet_ep2_init(&epp); … … 78 78 uint8_t *data; 79 79 size_t i, dsize; 80 int rc;80 errno_t rc; 81 81 82 82 inet_ep2_init(&epp); -
uspace/srv/net/tcp/test/rqueue.c
r36f0738 rb7fd2a0 59 59 PCUT_TEST_BEFORE 60 60 { 61 int rc;61 errno_t rc; 62 62 63 63 /* We will be calling functions that perform logging */ -
uspace/srv/net/tcp/test/tqueue.c
r36f0738 rb7fd2a0 53 53 PCUT_TEST_BEFORE 54 54 { 55 int rc;55 errno_t rc; 56 56 57 57 /* We will be calling functions that perform logging */ -
uspace/srv/net/tcp/test/ucall.c
r36f0738 rb7fd2a0 60 60 PCUT_TEST_BEFORE 61 61 { 62 int rc;62 errno_t rc; 63 63 64 64 /* We will be calling functions that perform logging */ -
uspace/srv/net/tcp/tqueue.c
r36f0738 rb7fd2a0 63 63 static void tcp_tqueue_send_immed(tcp_conn_t *, tcp_segment_t *); 64 64 65 int tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn,65 errno_t tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn, 66 66 tcp_tqueue_cb_t *cb) 67 67 { -
uspace/srv/net/tcp/tqueue.h
r36f0738 rb7fd2a0 40 40 #include "tcp_type.h" 41 41 42 extern int tcp_tqueue_init(tcp_tqueue_t *, tcp_conn_t *,42 extern errno_t tcp_tqueue_init(tcp_tqueue_t *, tcp_conn_t *, 43 43 tcp_tqueue_cb_t *); 44 44 extern void tcp_tqueue_clear(tcp_tqueue_t *); -
uspace/srv/net/tcp/ucall.c
r36f0738 rb7fd2a0 69 69 { 70 70 tcp_conn_t *nconn; 71 int rc;71 errno_t rc; 72 72 73 73 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open(%p, %s, %s, %p)",
Note:
See TracChangeset
for help on using the changeset viewer.