Changeset a46e56b in mainline for uspace/lib/c/generic/inet/tcp.c
- Timestamp:
- 2018-03-22T06:49:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet/tcp.c
r3e242d2 ra46e56b 637 637 * @param icall Call data 638 638 */ 639 static void tcp_ev_connected(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)639 static void tcp_ev_connected(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 640 640 { 641 641 tcp_conn_t *conn; … … 647 647 rc = tcp_conn_get(tcp, conn_id, &conn); 648 648 if (rc != EOK) { 649 async_answer_0(i id, ENOENT);649 async_answer_0(icall_handle, ENOENT); 650 650 return; 651 651 } … … 656 656 fibril_mutex_unlock(&conn->lock); 657 657 658 async_answer_0(i id, EOK);658 async_answer_0(icall_handle, EOK); 659 659 } 660 660 … … 665 665 * @param icall Call data 666 666 */ 667 static void tcp_ev_conn_failed(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)667 static void tcp_ev_conn_failed(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 668 668 { 669 669 tcp_conn_t *conn; … … 675 675 rc = tcp_conn_get(tcp, conn_id, &conn); 676 676 if (rc != EOK) { 677 async_answer_0(i id, ENOENT);677 async_answer_0(icall_handle, ENOENT); 678 678 return; 679 679 } … … 684 684 fibril_mutex_unlock(&conn->lock); 685 685 686 async_answer_0(i id, EOK);686 async_answer_0(icall_handle, EOK); 687 687 } 688 688 … … 693 693 * @param icall Call data 694 694 */ 695 static void tcp_ev_conn_reset(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)695 static void tcp_ev_conn_reset(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 696 696 { 697 697 tcp_conn_t *conn; … … 703 703 rc = tcp_conn_get(tcp, conn_id, &conn); 704 704 if (rc != EOK) { 705 async_answer_0(i id, ENOENT);705 async_answer_0(icall_handle, ENOENT); 706 706 return; 707 707 } … … 712 712 fibril_mutex_unlock(&conn->lock); 713 713 714 async_answer_0(i id, EOK);714 async_answer_0(icall_handle, EOK); 715 715 } 716 716 … … 721 721 * @param icall Call data 722 722 */ 723 static void tcp_ev_data(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)723 static void tcp_ev_data(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 724 724 { 725 725 tcp_conn_t *conn; … … 731 731 rc = tcp_conn_get(tcp, conn_id, &conn); 732 732 if (rc != EOK) { 733 async_answer_0(i id, ENOENT);733 async_answer_0(icall_handle, ENOENT); 734 734 return; 735 735 } … … 741 741 conn->cb->data_avail(conn); 742 742 743 async_answer_0(i id, EOK);743 async_answer_0(icall_handle, EOK); 744 744 } 745 745 … … 750 750 * @param icall Call data 751 751 */ 752 static void tcp_ev_urg_data(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)753 { 754 async_answer_0(i id, ENOTSUP);752 static void tcp_ev_urg_data(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 753 { 754 async_answer_0(icall_handle, ENOTSUP); 755 755 } 756 756 … … 761 761 * @param icall Call data 762 762 */ 763 static void tcp_ev_new_conn(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)763 static void tcp_ev_new_conn(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 764 764 { 765 765 tcp_listener_t *lst; … … 776 776 rc = tcp_listener_get(tcp, lst_id, &lst); 777 777 if (rc != EOK) { 778 async_answer_0(i id, ENOENT);778 async_answer_0(icall_handle, ENOENT); 779 779 return; 780 780 } … … 782 782 rc = tcp_conn_new(tcp, conn_id, lst->cb, lst->cb_arg, &conn); 783 783 if (rc != EOK) { 784 async_answer_0(i id, ENOMEM);784 async_answer_0(icall_handle, ENOMEM); 785 785 return; 786 786 } … … 789 789 cinfo = calloc(1, sizeof(tcp_in_conn_t)); 790 790 if (cinfo == NULL) { 791 async_answer_0(i id, ENOMEM);791 async_answer_0(icall_handle, ENOMEM); 792 792 return; 793 793 } … … 798 798 fid = fibril_create(tcp_conn_fibril, cinfo); 799 799 if (fid == 0) { 800 async_answer_0(i id, ENOMEM);800 async_answer_0(icall_handle, ENOMEM); 801 801 } 802 802 … … 804 804 } 805 805 806 async_answer_0(i id, EOK);806 async_answer_0(icall_handle, EOK); 807 807 } 808 808 … … 813 813 * @param arg Argument, TCP client 814 814 */ 815 static void tcp_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)815 static void tcp_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 816 816 { 817 817 tcp_t *tcp = (tcp_t *)arg; 818 818 819 async_answer_0(i id, EOK);819 async_answer_0(icall_handle, EOK); 820 820 821 821 while (true) { 822 822 ipc_call_t call; 823 cap_call_handle_t c allid= async_get_call(&call);823 cap_call_handle_t chandle = async_get_call(&call); 824 824 825 825 if (!IPC_GET_IMETHOD(call)) { … … 830 830 switch (IPC_GET_IMETHOD(call)) { 831 831 case TCP_EV_CONNECTED: 832 tcp_ev_connected(tcp, c allid, &call);832 tcp_ev_connected(tcp, chandle, &call); 833 833 break; 834 834 case TCP_EV_CONN_FAILED: 835 tcp_ev_conn_failed(tcp, c allid, &call);835 tcp_ev_conn_failed(tcp, chandle, &call); 836 836 break; 837 837 case TCP_EV_CONN_RESET: 838 tcp_ev_conn_reset(tcp, c allid, &call);838 tcp_ev_conn_reset(tcp, chandle, &call); 839 839 break; 840 840 case TCP_EV_DATA: 841 tcp_ev_data(tcp, c allid, &call);841 tcp_ev_data(tcp, chandle, &call); 842 842 break; 843 843 case TCP_EV_URG_DATA: 844 tcp_ev_urg_data(tcp, c allid, &call);844 tcp_ev_urg_data(tcp, chandle, &call); 845 845 break; 846 846 case TCP_EV_NEW_CONN: 847 tcp_ev_new_conn(tcp, c allid, &call);847 tcp_ev_new_conn(tcp, chandle, &call); 848 848 break; 849 849 default: 850 async_answer_0(c allid, ENOTSUP);850 async_answer_0(chandle, ENOTSUP); 851 851 break; 852 852 }
Note:
See TracChangeset
for help on using the changeset viewer.