source:
rtems/testsuites/samples/pppd/init.c
@
f703e7f
Last change on this file since f703e7f was f703e7f, checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/17 at 11:59:05 | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[5f0cd34] | 1 | /* |
2 | * COPYRIGHT (c) 1989-2012. | |
3 | * On-Line Applications Research Corporation (OAR). | |
4 | * | |
5 | * The license and distribution terms for this file may be | |
6 | * found in the file LICENSE in this distribution or at | |
[c499856] | 7 | * http://www.rtems.org/license/LICENSE. |
[5f0cd34] | 8 | */ |
9 | ||
[e313551] | 10 | #ifdef HAVE_CONFIG_H |
11 | #include "config.h" | |
12 | #endif | |
13 | ||
[98c6d50] | 14 | #define TEST_INIT |
15 | ||
[478bb1e6] | 16 | #include <stdio.h> |
17 | #include <stdlib.h> | |
18 | #include <string.h> | |
19 | ||
20 | #define CONFIGURE_INIT | |
21 | #include "system.h" | |
22 | ||
[c0ec0d82] | 23 | #include <rtems/rtems_bsdnet.h> |
24 | #include <rtems/rtemspppd.h> | |
[3cbedb1] | 25 | #include <rtems/shell.h> |
[c0ec0d82] | 26 | #include "netconfig.h" |
[478bb1e6] | 27 | |
[9391f6d] | 28 | const char rtems_test_name[] = "PPPD"; |
29 | ||
[3cbedb1] | 30 | static void notification(int fd, int seconds_remaining, void *arg) |
31 | { | |
32 | printf( | |
33 | "Press any key to start pppd (%is remaining)\n", | |
34 | seconds_remaining | |
35 | ); | |
36 | } | |
37 | ||
[478bb1e6] | 38 | rtems_task Init(rtems_task_argument argument) |
39 | { | |
[3cbedb1] | 40 | rtems_status_code status; |
41 | ||
[3039e18] | 42 | rtems_print_printer_printf(&rtems_test_printer); |
43 | ||
[9391f6d] | 44 | rtems_test_begin(); |
45 | ||
[3cbedb1] | 46 | status = rtems_shell_wait_for_input( |
47 | STDIN_FILENO, | |
48 | 10, | |
49 | notification, | |
50 | NULL | |
51 | ); | |
52 | if (status != RTEMS_SUCCESSFUL) { | |
53 | rtems_test_end(); | |
54 | exit( 0 ); | |
55 | } | |
56 | ||
[478bb1e6] | 57 | /* initialize network */ |
58 | rtems_bsdnet_initialize_network(); | |
59 | rtems_pppd_initialize(); | |
60 | pppdapp_initialize(); | |
61 | rtems_task_delete(RTEMS_SELF); | |
62 | } |
Note: See TracBrowser
for help on using the repository browser.