Changeset 59157eb in mainline for uspace/lib/c/generic/inet.c


Ignore:
Timestamp:
2012-02-02T15:18:46Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f834f90d
Parents:
ecff3d9
Message:

Implement INET_EV_RECV IPC.

File:
1 edited

Legend:

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

    recff3d9 r59157eb  
    148148}
    149149
     150static void inet_ev_recv(ipc_callid_t callid, ipc_call_t *call)
     151{
     152        int rc;
     153        inet_dgram_t dgram;
     154
     155        dgram.src.ipv4 = IPC_GET_ARG1(*call);
     156        dgram.dest.ipv4 = IPC_GET_ARG2(*call);
     157        dgram.tos = IPC_GET_ARG3(*call);
     158
     159        rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, &dgram.size);
     160        if (rc != EOK) {
     161                async_answer_0(callid, rc);
     162                return;
     163        }
     164
     165        rc = inet_ev_ops->recv(&dgram);
     166        async_answer_0(callid, rc);
     167}
     168
    150169static void inet_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    151170{
     
    153172                ipc_call_t call;
    154173                ipc_callid_t callid = async_get_call(&call);
    155                
     174
    156175                if (!IPC_GET_IMETHOD(call)) {
    157176                        /* TODO: Handle hangup */
    158177                        return;
    159178                }
    160                
     179
    161180                switch (IPC_GET_IMETHOD(call)) {
    162181                case INET_EV_RECV:
    163                         async_answer_0(callid, EOK);
     182                        inet_ev_recv(callid, &call);
    164183                        break;
    165184                default:
Note: See TracChangeset for help on using the changeset viewer.