Changes in uspace/srv/net/net/net_standalone.c [19f857a:14f1db0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/net/net_standalone.c
r19f857a r14f1db0 39 39 #include <ipc/ipc.h> 40 40 41 #include "../messages.h" 42 43 #include "../include/ip_interface.h" 44 45 #include "../structures/measured_strings.h" 46 #include "../structures/module_map.h" 47 #include "../structures/packet/packet_server.h" 41 #include <net_messages.h> 42 #include <ip_interface.h> 43 #include <adt/measured_strings.h> 44 #include <adt/module_map.h> 45 #include <packet/packet_server.h> 48 46 49 47 #include "net.h" … … 51 49 /** Networking module global data. 52 50 */ 53 extern net_globals_t 51 extern net_globals_t net_globals; 54 52 53 /** Initialize the networking module for the chosen subsystem build type. 54 * 55 * @param[in] client_connection The client connection processing function. 56 * The module skeleton propagates its own one. 57 * 58 * @return EOK on success. 59 * @return ENOMEM if there is not enough memory left. 60 * 61 */ 55 62 int net_initialize_build(async_client_conn_t client_connection){ 56 63 ERROR_DECLARE; 57 58 task_id_t task_id; 59 60 task_id = spawn("/srv/ip"); 61 if(! task_id){ 64 65 task_id_t task_id = spawn("/srv/ip"); 66 if (!task_id) 62 67 return EINVAL; 63 } 64 ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_id, ip_connect_module)); 65 if(! spawn("/srv/icmp")){ 68 69 ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, 70 IP_FILENAME, SERVICE_IP, task_id, ip_connect_module)); 71 72 if (!spawn("/srv/icmp")) 66 73 return EINVAL; 67 }68 if (! spawn("/srv/udp")){74 75 if (!spawn("/srv/udp")) 69 76 return EINVAL; 70 }71 if (! spawn("/srv/tcp")){77 78 if (!spawn("/srv/tcp")) 72 79 return EINVAL; 73 }80 74 81 return EOK; 75 82 } 76 83 77 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ 78 if(IS_NET_PACKET_MESSAGE(call)){ 84 /** Process the module message. 85 * 86 * Distribute the message to the right module. 87 * 88 * @param[in] callid The message identifier. 89 * @param[in] call The message parameters. 90 * @param[out] answer The message answer parameters. 91 * @param[out] answer_count The last parameter for the actual answer in 92 * the answer parameter. 93 * 94 * @return EOK on success. 95 * @return ENOTSUP if the message is not known. 96 * @return Other error codes as defined for each bundled module 97 * message function. 98 * 99 */ 100 int net_module_message(ipc_callid_t callid, ipc_call_t *call, 101 ipc_call_t *answer, int *answer_count) 102 { 103 if (IS_NET_PACKET_MESSAGE(call)) 79 104 return packet_server_message(callid, call, answer, answer_count); 80 }else{ 81 return net_message(callid, call, answer, answer_count); 82 } 105 106 return net_message(callid, call, answer, answer_count); 83 107 } 84 108
Note:
See TracChangeset
for help on using the changeset viewer.