Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip_module.c

    r02314f8 r614d065  
    3232
    3333/** @file
    34  * IP standalone module implementation.
    35  * Contains skeleton module functions mapping.
    36  * The functions are used by the module skeleton as module specific entry
    37  * points.
    38  *
    39  * @see module.c
     34 *  IP standalone module implementation.
     35 *  Contains skeleton module functions mapping.
     36 *  The functions are used by the module skeleton as module specific entry points.
     37 *  @see module.c
    4038 */
    4139
     
    4442#include <ipc/ipc.h>
    4543#include <ipc/services.h>
    46 #include <errno.h>
     44#include <err.h>
    4745
    4846#include <net/modules.h>
     
    5452#include "ip_module.h"
    5553
    56 /** IP module global data. */
     54/** IP module global data.
     55 */
    5756extern ip_globals_t ip_globals;
    5857
    59 int
    60 il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
    61     ipc_call_t *answer, int *answer_count)
    62 {
     58/** Processes the IP message.
     59 *  @param[in] callid The message identifier.
     60 *  @param[in] call The message parameters.
     61 *  @param[out] answer The message answer parameters.
     62 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     63 *  @returns EOK on success.
     64 *  @returns Other error codes as defined for the ip_message() function.
     65 */
     66int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    6367        return ip_message_standalone(callid, call, answer, answer_count);
    6468}
    6569
    66 int il_module_start_standalone(async_client_conn_t client_connection)
    67 {
    68         ipcarg_t phonehash;
    69         int rc;
     70/** Starts the IP module.
     71 *  Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.
     72 *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
     73 *  @returns EOK on successful module termination.
     74 *  @returns Other error codes as defined for the ip_initialize() function.
     75 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
     76 */
     77int il_module_start_standalone(async_client_conn_t client_connection){
     78        ERROR_DECLARE;
    7079       
    7180        async_set_client_connection(client_connection);
    7281        ip_globals.net_phone = net_connect_module();
    73 
    74         rc = pm_init();
    75         if (rc != EOK)
    76                 return rc;
     82        ERROR_PROPAGATE(pm_init());
    7783       
    78         rc = ip_initialize(client_connection);
    79         if (rc != EOK)
    80                 goto out;
    81        
    82         rc = REGISTER_ME(SERVICE_IP, &phonehash);
    83         if (rc != EOK)
    84                 goto out;
     84        ipcarg_t phonehash;
     85        if (ERROR_OCCURRED(ip_initialize(client_connection))
     86            || ERROR_OCCURRED(REGISTER_ME(SERVICE_IP, &phonehash))) {
     87                pm_destroy();
     88                return ERROR_CODE;
     89        }
    8590       
    8691        async_manager();
    87 
    88 out:
     92       
    8993        pm_destroy();
    90         return rc;
     94        return EOK;
    9195}
    9296
Note: See TracChangeset for help on using the changeset viewer.