Changeset 0b749a3 in mainline for uspace/srv/net/tl/tcp/tcp_module.c
- Timestamp:
- 2010-11-22T15:39:53Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0eddb76, aae339e9
- Parents:
- 9a1d8ab (diff), 8cd1aa5e (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/tcp/tcp_module.c
r9a1d8ab r0b749a3 28 28 29 29 /** @addtogroup tcp 30 * 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * TCP 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 34 * TCP 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 * @see module.c 38 39 */ 39 40 #include <async.h>41 #include <stdio.h>42 #include <ipc/ipc.h>43 #include <ipc/services.h>44 45 #include <net_err.h>46 #include <net_modules.h>47 #include <packet/packet.h>48 #include <net_interface.h>49 #include <ip_protocols.h>50 #include <ip_interface.h>51 #include <tl_local.h>52 40 53 41 #include "tcp.h" 54 42 #include "tcp_module.h" 55 43 56 /** TCP module global data. 57 */ 58 extern tcp_globals_t tcp_globals; 44 #include <async.h> 45 #include <stdio.h> 46 #include <errno.h> 47 #include <ipc/ipc.h> 48 #include <ipc/services.h> 59 49 60 /** Starts the TCP module. 61 * 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. 62 * @param[in] client_connection The client connection processing function. The module skeleton propagates its own one. 63 * @returns EOK on successful module termination. 64 * @returns Other error codes as defined for the tcp_initialize() function. 65 * @returns Other error codes as defined for the REGISTER_ME() macro function. 66 */ 50 #include <net/ip_protocols.h> 51 #include <net/modules.h> 52 #include <net/packet.h> 53 #include <net_interface.h> 54 55 #include <ip_interface.h> 56 #include <tl_local.h> 57 58 /** TCP module global data. */ 59 extern tcp_globals_t tcp_globals; 60 67 61 int tl_module_start_standalone(async_client_conn_t client_connection) 68 62 { 69 ERROR_DECLARE; 70 63 ipcarg_t phonehash; 64 int rc; 65 71 66 async_set_client_connection(client_connection); 72 tcp_globals.net_phone = net_connect_module(SERVICE_NETWORKING); 73 ERROR_PROPAGATE(pm_init()); 74 75 ipcarg_t phonehash; 76 if (ERROR_OCCURRED(tcp_initialize(client_connection)) 77 || ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))) { 78 pm_destroy(); 79 return ERROR_CODE; 80 } 67 tcp_globals.net_phone = net_connect_module(); 68 69 rc = pm_init(); 70 if (rc != EOK) 71 return rc; 72 73 rc = tcp_initialize(client_connection); 74 if (rc != EOK) 75 goto out; 76 77 rc = REGISTER_ME(SERVICE_TCP, &phonehash); 78 if (rc != EOK) 79 goto out; 81 80 82 81 async_manager(); 83 82 83 out: 84 84 pm_destroy(); 85 return EOK;85 return rc; 86 86 } 87 87 88 /** Processes the TCP 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 tcp_message() function. 95 */ 96 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 88 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call, 89 ipc_call_t *answer, int *answer_count) 90 { 97 91 return tcp_message_standalone(callid, call, answer, answer_count); 98 92 }
Note:
See TracChangeset
for help on using the changeset viewer.