Changeset f3386d7 in mainline for uspace/lib/c/generic/inetping.c
- Timestamp:
- 2013-07-15T20:44:54Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f8d3df3
- Parents:
- 273c976 (diff), a940f1d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inetping.c
r273c976 rf3386d7 79 79 { 80 80 async_exch_t *exch = async_exchange_begin(inetping_sess); 81 81 82 82 ipc_call_t answer; 83 aid_t req = async_send_3(exch, INETPING_SEND, sdu->src.ipv4,84 sdu->dest.ipv4, sdu->seq_no, &answer);83 aid_t req = async_send_3(exch, INETPING_SEND, (sysarg_t) sdu->src, 84 (sysarg_t) sdu->dest, sdu->seq_no, &answer); 85 85 sysarg_t retval = async_data_write_start(exch, sdu->data, sdu->size); 86 86 87 87 async_exchange_end(exch); 88 88 89 89 if (retval != EOK) { 90 90 async_forget(req); 91 91 return retval; 92 92 } 93 93 94 94 async_wait_for(req, &retval); 95 95 return retval; 96 96 } 97 97 98 int inetping_get_srcaddr( inet_addr_t *remote, inet_addr_t *local)98 int inetping_get_srcaddr(uint32_t remote, uint32_t *local) 99 99 { 100 async_exch_t *exch = async_exchange_begin(inetping_sess); 101 100 102 sysarg_t local_addr; 101 async_exch_t *exch = async_exchange_begin(inetping_sess); 102 103 int rc = async_req_1_1(exch, INETPING_GET_SRCADDR, remote->ipv4, 103 int rc = async_req_1_1(exch, INETPING_GET_SRCADDR, (sysarg_t) remote, 104 104 &local_addr); 105 105 106 async_exchange_end(exch); 106 107 107 108 if (rc != EOK) 108 109 return rc; 109 110 local->ipv4 =local_addr;110 111 *local = (uint32_t) local_addr; 111 112 return EOK; 112 113 } … … 114 115 static void inetping_ev_recv(ipc_callid_t callid, ipc_call_t *call) 115 116 { 116 int rc;117 117 inetping_sdu_t sdu; 118 119 sdu.src .ipv4= IPC_GET_ARG1(*call);120 sdu.dest .ipv4= IPC_GET_ARG2(*call);118 119 sdu.src = IPC_GET_ARG1(*call); 120 sdu.dest = IPC_GET_ARG2(*call); 121 121 sdu.seq_no = IPC_GET_ARG3(*call); 122 123 rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size);122 123 int rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size); 124 124 if (rc != EOK) { 125 125 async_answer_0(callid, rc); 126 126 return; 127 127 } 128 128 129 129 rc = inetping_ev_ops->recv(&sdu); 130 130 free(sdu.data);
Note:
See TracChangeset
for help on using the changeset viewer.