Ignore:
Timestamp:
2010-04-09T12:54:57Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1caa3c2
Parents:
24ab58b3
Message:

networking overhaul:

  • separation of conserns
  • removal of (almost all) overlaping symbols, libnetif is not needed anymore
  • again, it is possible to build the networking in multiple architecture configurations (however, currently only the bundling netif and nil layers is supported, more to come)
  • code style updates and fixes (still a huge amount of work to do)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/socket/generic/net_modules.c

    r24ab58b3 r14f1db0  
    7777}
    7878
    79 int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver){
     79/** Create bidirectional connection with the needed module service and registers the message receiver.
     80 *
     81 * @param[in] need            The needed module service.
     82 * @param[in] arg1            The first parameter.
     83 * @param[in] arg2            The second parameter.
     84 * @param[in] arg3            The third parameter.
     85 * @param[in] client_receiver The message receiver.
     86 *
     87 * @return The phone of the needed service.
     88 * @return Other error codes as defined for the ipc_connect_to_me() function.
     89 *
     90 */
     91int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3,
     92    async_client_conn_t client_receiver)
     93{
    8094        return bind_service_timeout(need, arg1, arg2, arg3, client_receiver, 0);
    8195}
    8296
    83 int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout){
     97/** Create bidirectional connection with the needed module service and registers the message receiver.
     98 *
     99 * @param[in] need            The needed module service.
     100 * @param[in] arg1            The first parameter.
     101 * @param[in] arg2            The second parameter.
     102 * @param[in] arg3            The third parameter.
     103 * @param[in] client_receiver The message receiver.
     104 * @param[in] timeout         The connection timeout in microseconds.
     105 *                            No timeout if set to zero (0).
     106 *
     107 * @return The phone of the needed service.
     108 * @return ETIMEOUT if the connection timeouted.
     109 * @return Other error codes as defined for the ipc_connect_to_me() function.
     110 *
     111 */
     112int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2,
     113    ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
     114{
    84115        ERROR_DECLARE;
    85 
    86         int phone;
    87         ipcarg_t phonehash;
    88 
    89         // connect to the needed service
    90         phone = connect_to_service_timeout(need, timeout);
    91         // if connected
    92         if(phone >= 0){
    93                 // request the bidirectional connection
    94                 if(ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash))){
     116       
     117        /* Connect to the needed service */
     118        int phone = connect_to_service_timeout(need, timeout);
     119        if (phone >= 0) {
     120                /* Request the bidirectional connection */
     121                ipcarg_t phonehash;
     122                if (ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3,
     123                    &phonehash))) {
    95124                        ipc_hangup(phone);
    96125                        return ERROR_CODE;
     
    98127                async_new_connection(phonehash, 0, NULL, client_receiver);
    99128        }
     129       
    100130        return phone;
    101131}
Note: See TracChangeset for help on using the changeset viewer.