Changeset 24ab58b3 in mainline for uspace/srv/net/nil/nildummy/nildummy_module.c
- Timestamp:
- 2010-04-06T11:41:48Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 14f1db0
- Parents:
- 4dd8529
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/nildummy/nildummy_module.c
r4dd8529 r24ab58b3 51 51 #include "nildummy.h" 52 52 53 /** Starts the dummy nil module. 54 * 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. 55 * @param[in] client_connection The client connection processing function. The module skeleton propagates its own one. 56 * @returns EOK on success. 57 * @returns Other error codes as defined for the pm_init() function. 58 * @returns Other error codes as defined for the nil_initialize() function. 59 * @returns Other error codes as defined for the REGISTER_ME() macro function. 53 /** Start the dummy nil module. 54 * 55 * Initialize the client connection serving function, initialize 56 * the module, register the module service and start the async 57 * manager, processing IPC messages in an infinite loop. 58 * 59 * @param[in] client_connection The client connection processing 60 * function. The module skeleton propagates 61 * its own one. 62 * 63 * @return EOK on success. 64 * @return Other error codes as defined for the pm_init() function. 65 * @return Other error codes as defined for the nil_initialize() function. 66 * @return Other error codes as defined for the REGISTER_ME() macro function. 67 * 60 68 */ 61 int nil_module_start(async_client_conn_t client_connection){ 69 int nil_module_start(async_client_conn_t client_connection) 70 { 62 71 ERROR_DECLARE; 63 72 73 async_set_client_connection(client_connection); 74 int net_phone = net_connect_module(SERVICE_NETWORKING); 75 ERROR_PROPAGATE(pm_init()); 76 64 77 ipcarg_t phonehash; 65 int net_phone; 66 67 async_set_client_connection(client_connection); 68 net_phone = net_connect_module(SERVICE_NETWORKING); 69 ERROR_PROPAGATE(pm_init()); 70 if(ERROR_OCCURRED(nil_initialize(net_phone)) 71 || ERROR_OCCURRED(REGISTER_ME(SERVICE_NILDUMMY, &phonehash))){ 78 if (ERROR_OCCURRED(nil_initialize(net_phone)) 79 || ERROR_OCCURRED(REGISTER_ME(SERVICE_NILDUMMY, &phonehash))){ 72 80 pm_destroy(); 73 81 return ERROR_CODE; 74 82 } 75 83 76 84 async_manager(); 77 85 78 86 pm_destroy(); 79 87 return EOK; 80 88 } 81 89 82 /** Passes the parameters to the module specific nil_message() function. 83 * @param[in] callid The message identifier. 84 * @param[in] call The message parameters. 85 * @param[out] answer The message answer parameters. 86 * @param[out] answer_count The last parameter for the actual answer in the answer parameter. 87 * @returns EOK on success. 88 * @returns ENOTSUP if the message is not known. 89 * @returns Other error codes as defined for each specific module message function. 90 /** Pass the parameters to the module specific nil_message() function. 91 * 92 * @param[in] name Module name. 93 * @param[in] callid The message identifier. 94 * @param[in] call The message parameters. 95 * @param[out] answer The message answer parameters. 96 * @param[out] answer_count The last parameter for the actual answer 97 * in the answer parameter. 98 * 99 * @return EOK on success. 100 * @return ENOTSUP if the message is not known. 101 * @return Other error codes as defined for each specific 102 * module message function. 103 * 90 104 */ 91 int nil_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 92 return nil_message(callid, call, answer, answer_count); 105 int nil_module_message(const char *name, ipc_callid_t callid, 106 ipc_call_t *call, ipc_call_t *answer, int *answer_count) 107 { 108 return nil_message(name, callid, call, answer, answer_count); 93 109 } 94 110
Note:
See TracChangeset
for help on using the changeset viewer.