Changeset b40bfac in mainline for uspace/srv/net/tl/icmp/icmp_module.c
- Timestamp:
- 2010-11-08T07:13:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63a1e60
- Parents:
- d70a463 (diff), 3da12d74 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp_module.c
rd70a463 rb40bfac 28 28 29 29 /** @addtogroup icmp 30 * 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 35 * 36 * 37 * 34 * ICMP 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 38 38 */ 39 40 #include "icmp.h" 41 #include "icmp_module.h" 39 42 40 43 #include <async.h> 41 44 #include <stdio.h> 42 #include <err .h>45 #include <errno.h> 43 46 #include <ipc/ipc.h> 44 47 #include <ipc/services.h> … … 47 50 #include <net/packet.h> 48 51 #include <net_interface.h> 52 49 53 #include <tl_local.h> 50 54 51 #include "icmp.h" 52 #include "icmp_module.h" 55 /** ICMP module global data. */ 56 extern icmp_globals_t icmp_globals; 53 57 54 /** ICMP module global data. 55 */ 56 extern icmp_globals_t icmp_globals; 57 58 /** Starts the ICMP module. 59 * 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. 60 * @param[in] client_connection The client connection processing function. The module skeleton propagates its own one. 61 * @returns EOK on successful module termination. 62 * @returns Other error codes as defined for the arp_initialize() function. 63 * @returns Other error codes as defined for the REGISTER_ME() macro function. 64 */ 65 int tl_module_start_standalone(async_client_conn_t client_connection){ 66 ERROR_DECLARE; 67 58 int tl_module_start_standalone(async_client_conn_t client_connection) 59 { 68 60 ipcarg_t phonehash; 61 int rc; 69 62 70 63 async_set_client_connection(client_connection); 71 64 icmp_globals.net_phone = net_connect_module(); 72 if (icmp_globals.net_phone < 0){65 if (icmp_globals.net_phone < 0) 73 66 return icmp_globals.net_phone; 74 } 75 ERROR_PROPAGATE(pm_init()); 76 if(ERROR_OCCURRED(icmp_initialize(client_connection)) 77 || ERROR_OCCURRED(REGISTER_ME(SERVICE_ICMP, &phonehash))){ 78 pm_destroy(); 79 return ERROR_CODE; 80 } 67 68 rc = pm_init(); 69 if (rc != EOK) 70 return rc; 71 72 rc = icmp_initialize(client_connection); 73 if (rc != EOK) 74 goto out; 75 76 rc = REGISTER_ME(SERVICE_ICMP, &phonehash); 77 if (rc != EOK) 78 goto out; 81 79 82 80 async_manager(); 83 81 82 out: 84 83 pm_destroy(); 85 return EOK;84 return rc; 86 85 } 87 86 88 /** Processes the ICMP message. 89 * @param[in] callid The message identifier. 90 * @param[in] call The message parameters. 91 * @param[out] answer The message answer parameters. 92 * @param[out] answer_count The last parameter for the actual answer in the answer parameter. 93 * @returns EOK on success. 94 * @returns Other error codes as defined for the icmp_message() function. 95 */ 96 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 87 int 88 tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call, 89 ipc_call_t *answer, int *answer_count) 90 { 97 91 return icmp_message_standalone(callid, call, answer, answer_count); 98 92 }
Note:
See TracChangeset
for help on using the changeset viewer.