Changes in / [bc03679:ee3b6150] in mainline


Ignore:
Location:
uspace
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    rbc03679 ree3b6150  
    122122        generic/vfs/canonify.c \
    123123        generic/net/inet.c \
     124        generic/net/modules.c \
    124125        generic/net/socket_client.c \
    125126        generic/net/socket_parse.c \
  • uspace/lib/c/generic/net/socket_client.c

    rbc03679 ree3b6150  
    4444#include <errno.h>
    4545#include <task.h>
    46 #include <ns.h>
    4746#include <ipc/services.h>
    4847#include <ipc/socket.h>
     48#include <net/modules.h>
    4949#include <net/in.h>
    5050#include <net/socket.h>
     
    284284{
    285285        if (socket_globals.tcp_sess == NULL) {
    286                 socket_globals.tcp_sess = service_bind(SERVICE_TCP,
     286                socket_globals.tcp_sess = bind_service(SERVICE_TCP,
    287287                    0, 0, SERVICE_TCP, socket_connection);
    288288        }
     
    301301{
    302302        if (socket_globals.udp_sess == NULL) {
    303                 socket_globals.udp_sess = service_bind(SERVICE_UDP,
     303                socket_globals.udp_sess = bind_service(SERVICE_UDP,
    304304                    0, 0, SERVICE_UDP, socket_connection);
    305305        }
     
    378378 * @return              Other error codes as defined for the NET_SOCKET message.
    379379 * @return              Other error codes as defined for the
    380  *                      service_bind() function.
     380 *                      bind_service() function.
    381381 */
    382382int socket(int domain, int type, int protocol)
  • uspace/lib/c/generic/ns.c

    rbc03679 ree3b6150  
    3737#include <async.h>
    3838#include <macros.h>
    39 #include <errno.h>
    4039#include "private/ns.h"
    4140
     
    4948}
    5049
    51 async_sess_t *service_connect(exch_mgmt_t mgmt, services_t service, sysarg_t arg2,
     50async_sess_t *service_connect(exch_mgmt_t mgmt, sysarg_t service, sysarg_t arg2,
    5251    sysarg_t arg3)
    5352{
     
    7372}
    7473
    75 async_sess_t *service_connect_blocking(exch_mgmt_t mgmt, services_t service,
     74async_sess_t *service_connect_blocking(exch_mgmt_t mgmt, sysarg_t service,
    7675    sysarg_t arg2, sysarg_t arg3)
    7776{
     
    8281            async_connect_me_to_blocking(mgmt, exch, service, arg2, arg3);
    8382        async_exchange_end(exch);
    84        
     83
    8584        if (!sess)
    8685                return NULL;
     
    9291         */
    9392        async_sess_args_set(sess, arg2, arg3, 0);
    94        
    95         return sess;
    96 }
    97 
    98 /** Create bidirectional connection with a service
    99  *
    100  * @param[in] service         Service.
    101  * @param[in] arg1            First parameter.
    102  * @param[in] arg2            Second parameter.
    103  * @param[in] arg3            Third parameter.
    104  * @param[in] client_receiver Message receiver.
    105  *
    106  * @return Session to the service.
    107  * @return Other error codes as defined by async_connect_to_me().
    108  *
    109  */
    110 async_sess_t *service_bind(services_t service, sysarg_t arg1, sysarg_t arg2,
    111     sysarg_t arg3, async_client_conn_t client_receiver)
    112 {
    113         /* Connect to the needed service */
    114         async_sess_t *sess =
    115             service_connect_blocking(EXCHANGE_SERIALIZE, service, 0, 0);
    116         if (sess != NULL) {
    117                 /* Request callback connection */
    118                 async_exch_t *exch = async_exchange_begin(sess);
    119                 int rc = async_connect_to_me(exch, arg1, arg2, arg3,
    120                     client_receiver, NULL);
    121                 async_exchange_end(exch);
    122                
    123                 if (rc != EOK) {
    124                         async_hangup(sess);
    125                         errno = rc;
    126                         return NULL;
    127                 }
    128         }
    12993       
    13094        return sess;
  • uspace/lib/c/include/ns.h

    rbc03679 ree3b6150  
    3737
    3838#include <sys/types.h>
    39 #include <ipc/services.h>
    4039#include <task.h>
    4140#include <async.h>
    4241
    4342extern int service_register(sysarg_t);
    44 extern async_sess_t *service_connect(exch_mgmt_t, services_t, sysarg_t, sysarg_t);
    45 extern async_sess_t *service_connect_blocking(exch_mgmt_t, services_t, sysarg_t,
     43extern async_sess_t *service_connect(exch_mgmt_t, sysarg_t, sysarg_t, sysarg_t);
     44extern async_sess_t *service_connect_blocking(exch_mgmt_t, sysarg_t, sysarg_t,
    4645    sysarg_t);
    47 extern async_sess_t *service_bind(services_t, sysarg_t, sysarg_t, sysarg_t,
    48     async_client_conn_t);
    4946
    5047extern int ns_ping(void);
  • uspace/lib/net/tl/socket_core.c

    rbc03679 ree3b6150  
    3939#include <net/in.h>
    4040#include <net/inet.h>
     41#include <net/modules.h>
    4142#include <stdint.h>
    4243#include <stdlib.h>
  • uspace/srv/net/tcp/sock.c

    rbc03679 ree3b6150  
    4242#include <ipc/services.h>
    4343#include <ipc/socket.h>
     44#include <net/modules.h>
    4445#include <net/socket.h>
    4546#include <ns.h>
     
    143144        sock->sock_core = sock_core;
    144145
     146        refresh_answer(&answer, NULL);
    145147        SOCKET_SET_SOCKET_ID(answer, sock_id);
    146148
    147149        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, FRAGMENT_SIZE);
    148150        SOCKET_SET_HEADER_SIZE(answer, sizeof(tcp_header_t));
    149        
    150         async_answer_3(callid, EOK, IPC_GET_ARG1(answer),
    151             IPC_GET_ARG2(answer), IPC_GET_ARG3(answer));
     151        answer_call(callid, EOK, &answer, 3);
    152152}
    153153
     
    468468        assert(asock_core != NULL);
    469469
     470        refresh_answer(&answer, NULL);
     471
    470472        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, FRAGMENT_SIZE);
    471473        SOCKET_SET_SOCKET_ID(answer, asock_id);
    472474        SOCKET_SET_ADDRESS_LENGTH(answer, sizeof(struct sockaddr_in));
    473        
    474         async_answer_3(callid, asock_core->socket_id,
    475             IPC_GET_ARG1(answer), IPC_GET_ARG2(answer),
    476             IPC_GET_ARG3(answer));
    477        
     475
     476        answer_call(callid, asock_core->socket_id, &answer, 3);
     477
    478478        /* Push one fragment notification to client's queue */
    479479        log_msg(LVL_DEBUG, "tcp_sock_accept(): notify data\n");
     
    559559        }
    560560
    561         IPC_SET_ARG1(answer, 0);
     561        refresh_answer(&answer, NULL);
    562562        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, FRAGMENT_SIZE);
    563         async_answer_2(callid, EOK, IPC_GET_ARG1(answer),
    564             IPC_GET_ARG2(answer));
     563        answer_call(callid, EOK, &answer, 2);
    565564        fibril_mutex_unlock(&socket->lock);
    566565}
     
    680679
    681680        SOCKET_SET_READ_DATA_LENGTH(answer, length);
    682         async_answer_1(callid, EOK, IPC_GET_ARG1(answer));
    683        
     681        answer_call(callid, EOK, &answer, 1);
     682
    684683        /* Push one fragment notification to client's queue */
    685684        tcp_sock_notify_data(sock_core);
  • uspace/srv/net/udp/sock.c

    rbc03679 ree3b6150  
    4343#include <ipc/services.h>
    4444#include <ipc/socket.h>
     45#include <net/modules.h>
    4546#include <net/socket.h>
    4647#include <ns.h>
     
    133134        assert(sock_core != NULL);
    134135        sock->sock_core = sock_core;
    135        
     136
     137
     138        refresh_answer(&answer, NULL);
    136139        SOCKET_SET_SOCKET_ID(answer, sock_id);
    137140
    138141        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, FRAGMENT_SIZE);
    139142        SOCKET_SET_HEADER_SIZE(answer, sizeof(udp_header_t));
    140         async_answer_3(callid, EOK, IPC_GET_ARG1(answer),
    141             IPC_GET_ARG2(answer), IPC_GET_ARG3(answer));
     143        answer_call(callid, EOK, &answer, 3);
    142144}
    143145
     
    367369                }
    368370        }
    369        
    370         IPC_SET_ARG1(answer, 0);
     371
     372        refresh_answer(&answer, NULL);
    371373        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, FRAGMENT_SIZE);
    372         async_answer_2(callid, EOK, IPC_GET_ARG1(answer),
    373             IPC_GET_ARG2(answer));
     374        answer_call(callid, EOK, &answer, 2);
    374375        fibril_mutex_unlock(&socket->lock);
    375        
    376376out:
    377377        if (addr != NULL)
     
    486486
    487487        log_msg(LVL_DEBUG, "read_data_length <- %zu", length);
    488         IPC_SET_ARG2(answer, 0);
    489488        SOCKET_SET_READ_DATA_LENGTH(answer, length);
    490489        SOCKET_SET_ADDRESS_LENGTH(answer, sizeof(addr));
    491         async_answer_3(callid, EOK, IPC_GET_ARG1(answer),
    492             IPC_GET_ARG2(answer), IPC_GET_ARG3(answer));
    493        
     490        answer_call(callid, EOK, &answer, 3);
     491
    494492        /* Push one fragment notification to client's queue */
    495493        udp_sock_notify_data(sock_core);
Note: See TracChangeset for help on using the changeset viewer.