Changeset f3386d7 in mainline for uspace/lib/c/generic/inetping.c


Ignore:
Timestamp:
2013-07-15T20:44:54Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
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.
Message:

mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/inetping.c

    r273c976 rf3386d7  
    7979{
    8080        async_exch_t *exch = async_exchange_begin(inetping_sess);
    81 
     81       
    8282        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);
    8585        sysarg_t retval = async_data_write_start(exch, sdu->data, sdu->size);
    86 
     86       
    8787        async_exchange_end(exch);
    88 
     88       
    8989        if (retval != EOK) {
    9090                async_forget(req);
    9191                return retval;
    9292        }
    93 
     93       
    9494        async_wait_for(req, &retval);
    9595        return retval;
    9696}
    9797
    98 int inetping_get_srcaddr(inet_addr_t *remote, inet_addr_t *local)
     98int inetping_get_srcaddr(uint32_t remote, uint32_t *local)
    9999{
     100        async_exch_t *exch = async_exchange_begin(inetping_sess);
     101       
    100102        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,
    104104            &local_addr);
     105       
    105106        async_exchange_end(exch);
    106 
     107       
    107108        if (rc != EOK)
    108109                return rc;
    109 
    110         local->ipv4 = local_addr;
     110       
     111        *local = (uint32_t) local_addr;
    111112        return EOK;
    112113}
     
    114115static void inetping_ev_recv(ipc_callid_t callid, ipc_call_t *call)
    115116{
    116         int rc;
    117117        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);
    121121        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);
    124124        if (rc != EOK) {
    125125                async_answer_0(callid, rc);
    126126                return;
    127127        }
    128 
     128       
    129129        rc = inetping_ev_ops->recv(&sdu);
    130130        free(sdu.data);
Note: See TracChangeset for help on using the changeset viewer.