Changes in uspace/srv/net/nil/nildummy/nildummy.c [849ed54:e417b96] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/nildummy/nildummy.c
r849ed54 re417b96 45 45 #include <ipc/services.h> 46 46 47 #include <net_err.h> 48 #include <net_messages.h> 49 #include <net_modules.h> 50 #include <net_device.h> 51 #include <netif_interface.h> 52 #include <nil_interface.h> 53 #include <il_interface.h> 54 #include <adt/measured_strings.h> 55 #include <packet/packet.h> 56 #include <nil_module.h> 47 #include "../../err.h" 48 #include "../../messages.h" 49 #include "../../modules.h" 50 51 #include "../../include/device.h" 52 #include "../../include/netif_interface.h" 53 #include "../../include/nil_interface.h" 54 #include "../../include/il_interface.h" 55 56 #include "../../structures/measured_strings.h" 57 #include "../../structures/packet/packet.h" 58 59 #include "../nil_module.h" 57 60 58 61 #include "nildummy.h" 59 60 /** The module name.61 */62 #define NAME "Dummy nil protocol"63 62 64 63 /** Default maximum transmission unit. … … 374 373 } 375 374 376 #ifdef CONFIG_NETWORKING_modular377 378 #include <nil_standalone.h>379 380 /** Default thread for new connections.381 *382 * @param[in] iid The initial message identifier.383 * @param[in] icall The initial message call structure.384 *385 */386 static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)387 {388 /*389 * Accept the connection390 * - Answer the first IPC_M_CONNECT_ME_TO call.391 */392 ipc_answer_0(iid, EOK);393 394 while(true) {395 ipc_call_t answer;396 int answer_count;397 398 /* Clear the answer structure */399 refresh_answer(&answer, &answer_count);400 401 /* Fetch the next message */402 ipc_call_t call;403 ipc_callid_t callid = async_get_call(&call);404 405 /* Process the message */406 int res = nil_module_message(callid, &call, &answer, &answer_count);407 408 /* End if said to either by the message or the processing result */409 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))410 return;411 412 /* Answer the message */413 answer_call(callid, res, &answer, answer_count);414 }415 }416 417 /** Starts the module.418 *419 * @param argc The count of the command line arguments. Ignored parameter.420 * @param argv The command line parameters. Ignored parameter.421 *422 * @returns EOK on success.423 * @returns Other error codes as defined for each specific module start function.424 *425 */426 int main(int argc, char *argv[])427 {428 ERROR_DECLARE;429 430 /* Print the module label */431 printf("Task %d - %s\n", task_get_id(), NAME);432 433 /* Start the module */434 if (ERROR_OCCURRED(nil_module_start(nil_client_connection))) {435 printf(" - ERROR %i\n", ERROR_CODE);436 return ERROR_CODE;437 }438 439 return EOK;440 }441 442 #endif /* CONFIG_NETWORKING_modular */443 444 375 /** @} 445 376 */
Note:
See TracChangeset
for help on using the changeset viewer.