Changeset 19a4f73 in mainline for uspace/lib/c/generic/inet.c


Ignore:
Timestamp:
2013-06-20T15:21:48Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a2e3ee6
Parents:
3e66428
Message:

udp: use new network address infrastructure (towards IPv6 support)

File:
1 edited

Legend:

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

    r3e66428 r19a4f73  
    144144}
    145145
     146int inet2_get_srcaddr(inet2_addr_t *remote, uint8_t tos, inet2_addr_t *local)
     147{
     148        uint32_t remote_addr;
     149        int rc = inet2_addr_pack(remote, &remote_addr);
     150        if (rc != EOK)
     151                return rc;
     152       
     153        async_exch_t *exch = async_exchange_begin(inet_sess);
     154       
     155        sysarg_t local_addr;
     156        rc = async_req_2_1(exch, INET_GET_SRCADDR, (sysarg_t) remote_addr,
     157            tos, &local_addr);
     158       
     159        async_exchange_end(exch);
     160       
     161        if (rc != EOK)
     162                return rc;
     163       
     164        inet2_addr_unpack(local_addr, local);
     165        return EOK;
     166}
     167
    146168static void inet_ev_recv(ipc_callid_t callid, ipc_call_t *call)
    147169{
Note: See TracChangeset for help on using the changeset viewer.